aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QUtil.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2020-04-16 17:43:37 +0200
committerJay Berkenbilt <ejb@ql.org>2020-04-16 18:41:43 +0200
commit92d3cbecd4ea375d8de95bffc0fe8651c698f568 (patch)
treedcaed532423d2b836251d8203a14db594adca2be /libqpdf/QUtil.cc
parent66198f447f45a87718b6457756976baa8defb2fd (diff)
downloadqpdf-92d3cbecd4ea375d8de95bffc0fe8651c698f568.tar.zst
Fix warnings reported by -Wshadow=local (fixes #431)
Diffstat (limited to 'libqpdf/QUtil.cc')
-rw-r--r--libqpdf/QUtil.cc20
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;
}