diff options
Diffstat (limited to 'libqpdf/QUtil.cc')
-rw-r--r-- | libqpdf/QUtil.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libqpdf/QUtil.cc b/libqpdf/QUtil.cc index c3c4f12f..072a939c 100644 --- a/libqpdf/QUtil.cc +++ b/libqpdf/QUtil.cc @@ -812,7 +812,7 @@ QUtil::toUTF8(unsigned long uval) // maximum value that will fit in the current number of bytes unsigned char maxval = 0x3f; // six bits - while (uval > maxval) + while (uval > QIntC::to_ulong(maxval)) { // Assign low six bits plus 10000000 to lowest unused // byte position, then shift @@ -2163,12 +2163,12 @@ QUtil::win_ansi_to_utf8(std::string const& val) for (unsigned int i = 0; i < len; ++i) { unsigned char ch = static_cast<unsigned char>(val.at(i)); - unsigned short val = ch; + unsigned short ch_short = ch; if ((ch >= 128) && (ch <= 160)) { - val = win_ansi_to_unicode[ch - 128]; + ch_short = win_ansi_to_unicode[ch - 128]; } - result += QUtil::toUTF8(val); + result += QUtil::toUTF8(ch_short); } return result; } @@ -2181,12 +2181,12 @@ QUtil::mac_roman_to_utf8(std::string const& val) for (unsigned int i = 0; i < len; ++i) { unsigned char ch = static_cast<unsigned char>(val.at(i)); - unsigned short val = ch; + unsigned short ch_short = ch; if (ch >= 128) { - val = mac_roman_to_unicode[ch - 128]; + ch_short = mac_roman_to_unicode[ch - 128]; } - result += QUtil::toUTF8(val); + result += QUtil::toUTF8(ch_short); } return result; } @@ -2199,12 +2199,12 @@ QUtil::pdf_doc_to_utf8(std::string const& val) for (unsigned int i = 0; i < len; ++i) { unsigned char ch = static_cast<unsigned char>(val.at(i)); - unsigned short val = ch; + unsigned short ch_short = ch; if ((ch >= 128) && (ch <= 160)) { - val = pdf_doc_to_unicode[ch - 128]; + ch_short = pdf_doc_to_unicode[ch - 128]; } - result += QUtil::toUTF8(val); + result += QUtil::toUTF8(ch_short); } return result; } |