aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF_String.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2013-02-24 03:46:21 +0100
committerJay Berkenbilt <ejb@ql.org>2013-03-04 22:45:16 +0100
commit30027481f7f9e9191f7c8deea51850b7a76b1b1f (patch)
tree815af293c2f6e38994e6096a4499be0dc9a476f9 /libqpdf/QPDF_String.cc
parentbabb47948a408ebad12c452ba3fdd78782360167 (diff)
downloadqpdf-30027481f7f9e9191f7c8deea51850b7a76b1b1f.tar.zst
Remove all old-style casts from C++ code
Diffstat (limited to 'libqpdf/QPDF_String.cc')
-rw-r--r--libqpdf/QPDF_String.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/libqpdf/QPDF_String.cc b/libqpdf/QPDF_String.cc
index 619adef6..db6fb2f5 100644
--- a/libqpdf/QPDF_String.cc
+++ b/libqpdf/QPDF_String.cc
@@ -140,7 +140,7 @@ QPDF_String::unparse(bool force_binary)
}
else
{
- sprintf(num, "\\%03o", (unsigned char)ch);
+ sprintf(num, "\\%03o", static_cast<unsigned char>(ch));
result += num;
}
break;
@@ -181,8 +181,8 @@ QPDF_String::getUTF8Val() const
// discarded, and a low codepoint not preceded by a high
// codepoint will just get its low 10 bits output.
unsigned short bits =
- (((unsigned char) this->val[i]) << 8) +
- ((unsigned char) this->val[i+1]);
+ (static_cast<unsigned char>(this->val[i]) << 8) +
+ static_cast<unsigned char>(this->val[i+1]);
if ((bits & 0xFC00) == 0xD800)
{
codepoint = 0x10000 + ((bits & 0x3FF) << 10);
@@ -209,7 +209,7 @@ QPDF_String::getUTF8Val() const
{
for (unsigned int i = 0; i < len; ++i)
{
- result += QUtil::toUTF8((unsigned char) this->val[i]);
+ result += QUtil::toUTF8(static_cast<unsigned char>(this->val[i]));
}
}
return result;