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/PlatGTK.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/PlatGTK.cxx')
-rw-r--r-- | gtk/PlatGTK.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 700e88164..74f095bc5 100644 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -655,12 +655,12 @@ static std::string UTF8FromIconv(const Converter &conv, const char *s, int len) if (conv) { std::string utfForm(len*3+1, '\0'); char *pin = const_cast<char *>(s); - size_t inLeft = len; + gsize inLeft = len; char *putf = &utfForm[0]; char *pout = putf; - size_t outLeft = len*3+1; - size_t conversions = conv.Convert(&pin, &inLeft, &pout, &outLeft); - if (conversions != ((size_t)(-1))) { + gsize outLeft = len*3+1; + gsize conversions = conv.Convert(&pin, &inLeft, &pout, &outLeft); + if (conversions != sizeFailure) { *pout = '\0'; utfForm.resize(pout - putf); return utfForm; @@ -675,11 +675,11 @@ static size_t MultiByteLenFromIconv(const Converter &conv, const char *s, size_t for (size_t lenMB=1; (lenMB<4) && (lenMB <= len); lenMB++) { char wcForm[2]; char *pin = const_cast<char *>(s); - size_t inLeft = lenMB; + gsize inLeft = lenMB; char *pout = wcForm; - size_t outLeft = 2; - size_t conversions = conv.Convert(&pin, &inLeft, &pout, &outLeft); - if (conversions != ((size_t)(-1))) { + gsize outLeft = 2; + gsize conversions = conv.Convert(&pin, &inLeft, &pout, &outLeft); + if (conversions != sizeFailure) { return lenMB; } } |