summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2015-07-01 14:08:08 -0700
committerNico Weber <thakis@chromium.org>2015-07-01 14:11:22 -0700
commit2827bddd85edd37a9af6fb4e47882334f007e59b (patch)
treefa1bac0681681b5dc31997a23a15d01ad377b040 /fpdfsdk/src/javascript
parent606346f584700bdae0741066f2e6d2481744032c (diff)
downloadpdfium-2827bddd85edd37a9af6fb4e47882334f007e59b.tar.xz
Cherry-pick to XFA: Fix some clang warnings with -Wmissing-braces in pdfium.
Clang warns if there are missing braces around a subobject initializer. The most common idiom that triggers this is: STRUCT s = {0}; if the first field of STRUCT is itself a struct. This can be more simply written as: STRUCT s = {}; which also prevents the warning from firing. Other instances of the warning have been fixed by adding braces where appropriate. R=brucedawson@chromium.org Review URL: https://codereview.chromium.org/1213523004.
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r--fpdfsdk/src/javascript/util.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/fpdfsdk/src/javascript/util.cpp b/fpdfsdk/src/javascript/util.cpp
index 22e1c6dd99..c4f03093a7 100644
--- a/fpdfsdk/src/javascript/util.cpp
+++ b/fpdfsdk/src/javascript/util.cpp
@@ -303,7 +303,7 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
iMin = jsDate.GetMinutes();
iSec = jsDate.GetSeconds();
- struct tm time = {0};
+ struct tm time = {};
time.tm_year = iYear-1900;
time.tm_mon = iMonth;
time.tm_mday = iDay;
@@ -360,7 +360,7 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
CFX_WideString strFormat;
// strFormat.Format(L"%d,%d,%d,%d,%d,%d",iYear, iMonth, iDay, iHour, iMin, iSec);
// CString strFormat = cppTm.Format(cFormat.c_str());
- wchar_t buf[64] = {0};
+ wchar_t buf[64] = {};
strFormat = wcsftime(buf, 64, cFormat.c_str(), &time);
cFormat = buf;
vRet = cFormat.c_str();
@@ -399,7 +399,7 @@ void util::printd(const std::wstring &cFormat2, CJS_Date jsDate, bool bXFAPictur
iMin = jsDate.GetMinutes();
iSec = jsDate.GetSeconds();
- struct tm time = {0};
+ struct tm time = {};
time.tm_year = iYear-1900;
time.tm_mon = iMonth;
time.tm_mday = iDay;
@@ -454,7 +454,7 @@ void util::printd(const std::wstring &cFormat2, CJS_Date jsDate, bool bXFAPictur
}
CFX_WideString strFormat;
- wchar_t buf[64] = {0};
+ wchar_t buf[64] = {};
strFormat = wcsftime(buf, 64, cFormat.c_str(), &time);
cFormat = buf;
cPurpose = cFormat;