From 92d3cbecd4ea375d8de95bffc0fe8651c698f568 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Thu, 16 Apr 2020 11:43:37 -0400 Subject: Fix warnings reported by -Wshadow=local (fixes #431) --- libqpdf/QUtil.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'libqpdf/QUtil.cc') 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(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(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(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; } -- cgit v1.2.3-54-g00ecf