diff options
author | Neil Hodgson <unknown> | 2016-05-05 10:48:38 +1000 |
---|---|---|
committer | Neil Hodgson <unknown> | 2016-05-05 10:48:38 +1000 |
commit | 1c5cc9a5fc8a6bfb9b9791338c5c5a20b21288e8 (patch) | |
tree | b81725cb18083a8f5189e536e7f84ef1db12625f /gtk/ScintillaGTK.cxx | |
parent | e3783223da84055c7ad9cc5bead37d2649166170 (diff) | |
download | scintilla-mirror-1c5cc9a5fc8a6bfb9b9791338c5c5a20b21288e8.tar.gz |
Remove template adaptor as only g_iconv is used now. Use glib's gsize type as it
matches g_iconv exactly. Make character set name buffer dynamically sized.
Diffstat (limited to 'gtk/ScintillaGTK.cxx')
-rw-r--r-- | gtk/ScintillaGTK.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 14b861348..10514eece 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -926,15 +926,15 @@ static std::string ConvertText(const char *s, size_t len, const char *charSetDes std::string destForm; Converter conv(charSetDest, charSetSource, transliterations); if (conv) { - size_t outLeft = len*3+1; + gsize outLeft = len*3+1; destForm = std::string(outLeft, '\0'); // g_iconv does not actually write to its input argument so safe to cast away const char *pin = const_cast<char *>(s); - size_t inLeft = len; + gsize inLeft = len; char *putf = &destForm[0]; char *pout = putf; - size_t conversions = conv.Convert(&pin, &inLeft, &pout, &outLeft); - if (conversions == ((size_t)(-1))) { + gsize conversions = conv.Convert(&pin, &inLeft, &pout, &outLeft); + if (conversions == sizeFailure) { if (!silent) { if (len == 1) fprintf(stderr, "iconv %s->%s failed for %0x '%s'\n", |