Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: fpdfsdk/fsdk_baseannot.cpp

Issue 2124083002: Fix compilation with strict format checking (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Use std::abs and static_cast in both tzHour prints Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fsdk_baseannot.cpp
diff --git a/fpdfsdk/fsdk_baseannot.cpp b/fpdfsdk/fsdk_baseannot.cpp
index 9b214738d8db62992f0856947490067bdf15e3bc..2ef28716d08ce922269f93c272e7cb27c6960fd3 100644
--- a/fpdfsdk/fsdk_baseannot.cpp
+++ b/fpdfsdk/fsdk_baseannot.cpp
@@ -289,7 +289,7 @@ CFX_ByteString CPDFSDK_DateTime::ToCommonDateTimeString() {
else
str1 += "+";
CFX_ByteString str2;
- str2.Format("%02d:%02u", abs(dt.tzHour), dt.tzMinute);
+ str2.Format("%02d:%02u", std::abs(static_cast<int>(dt.tzHour)), dt.tzMinute);
return str1 + str2;
}
@@ -305,8 +305,8 @@ CFX_ByteString CPDFSDK_DateTime::ToPDFDateTimeString() {
else
dtStr += CFX_ByteString("+");
memset(tempStr, 0, sizeof(tempStr));
- FXSYS_snprintf(tempStr, sizeof(tempStr) - 1, "%02d'%02u'", abs(dt.tzHour),
- dt.tzMinute);
+ FXSYS_snprintf(tempStr, sizeof(tempStr) - 1, "%02d'%02u'",
+ std::abs(static_cast<int>(dt.tzHour)), dt.tzMinute);
dtStr += CFX_ByteString(tempStr);
return dtStr;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698