summaryrefslogtreecommitdiff
path: root/fpdfsdk/fsdk_baseannot.cpp
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-06-03 11:22:16 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-03 11:22:16 -0700
commit12367cb5e83e771cd67948c810fdd5f63d61af87 (patch)
tree47daac780e5c028ba531830b514c0c60102f1368 /fpdfsdk/fsdk_baseannot.cpp
parent79d798da0d4b5f9f1fc27917102bdd7bcfbe863e (diff)
downloadpdfium-12367cb5e83e771cd67948c810fdd5f63d61af87.tar.xz
Fix some code which causes warnings when compiled by /analyze tool
The code may not cause error conditions, but can be improved. These warnings include uninitialized variables, signed/unsigned mismatch, redundant condition, and using bool in arithmetic operations. Also remove a chunk of unused code. BUG=chromium:613623, chromium:427616 Review-Url: https://codereview.chromium.org/2036203004
Diffstat (limited to 'fpdfsdk/fsdk_baseannot.cpp')
-rw-r--r--fpdfsdk/fsdk_baseannot.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/fpdfsdk/fsdk_baseannot.cpp b/fpdfsdk/fsdk_baseannot.cpp
index e2ee6f7c73..1345f234b6 100644
--- a/fpdfsdk/fsdk_baseannot.cpp
+++ b/fpdfsdk/fsdk_baseannot.cpp
@@ -346,14 +346,14 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::FromPDFDateTimeString(
CFX_ByteString CPDFSDK_DateTime::ToCommonDateTimeString() {
CFX_ByteString str1;
- str1.Format("%04d-%02d-%02d %02d:%02d:%02d ", dt.year, dt.month, dt.day,
+ str1.Format("%04d-%02u-%02u %02u:%02u:%02u ", dt.year, dt.month, dt.day,
dt.hour, dt.minute, dt.second);
if (dt.tzHour < 0)
str1 += "-";
else
str1 += "+";
CFX_ByteString str2;
- str2.Format("%02d:%02d", abs(dt.tzHour), dt.tzMinute);
+ str2.Format("%02d:%02u", abs(dt.tzHour), dt.tzMinute);
return str1 + str2;
}
@@ -361,7 +361,7 @@ CFX_ByteString CPDFSDK_DateTime::ToPDFDateTimeString() {
CFX_ByteString dtStr;
char tempStr[32];
memset(tempStr, 0, sizeof(tempStr));
- FXSYS_snprintf(tempStr, sizeof(tempStr) - 1, "D:%04d%02d%02d%02d%02d%02d",
+ FXSYS_snprintf(tempStr, sizeof(tempStr) - 1, "D:%04d%02u%02u%02u%02u%02u",
dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second);
dtStr = CFX_ByteString(tempStr);
if (dt.tzHour < 0)
@@ -369,7 +369,7 @@ CFX_ByteString CPDFSDK_DateTime::ToPDFDateTimeString() {
else
dtStr += CFX_ByteString("+");
memset(tempStr, 0, sizeof(tempStr));
- FXSYS_snprintf(tempStr, sizeof(tempStr) - 1, "%02d'%02d'", abs(dt.tzHour),
+ FXSYS_snprintf(tempStr, sizeof(tempStr) - 1, "%02d'%02u'", abs(dt.tzHour),
dt.tzMinute);
dtStr += CFX_ByteString(tempStr);
return dtStr;