diff options
author | Nico Weber <thakis@chromium.org> | 2015-07-01 14:08:08 -0700 |
---|---|---|
committer | Nico Weber <thakis@chromium.org> | 2015-07-01 14:08:08 -0700 |
commit | ae195a4242a81899708eb58e109fd0d1a9cbbeeb (patch) | |
tree | ec71759983cc216df84a72695ea1c748516c823e /core | |
parent | ac9e977a913d134c5f536eeef60a2de6941f2863 (diff) | |
download | pdfium-ae195a4242a81899708eb58e109fd0d1a9cbbeeb.tar.xz |
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 'core')
-rw-r--r-- | core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp | 2 | ||||
-rw-r--r-- | core/src/fxcrt/fxcrt_windows.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp index ff1f6c4aa0..3d12ee9c82 100644 --- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp +++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp @@ -154,7 +154,7 @@ void CPDF_StreamContentParser::Handle_BeginImage() } void CPDF_StreamContentParser::ParsePathObject() { - FX_FLOAT params[6] = {0}; + FX_FLOAT params[6] = {}; int nParams = 0; int last_pos = m_pSyntax->GetPos(); while (1) { diff --git a/core/src/fxcrt/fxcrt_windows.cpp b/core/src/fxcrt/fxcrt_windows.cpp index 34d918b6fa..d4e3830cf2 100644 --- a/core/src/fxcrt/fxcrt_windows.cpp +++ b/core/src/fxcrt/fxcrt_windows.cpp @@ -98,7 +98,7 @@ FX_FILESIZE CFXCRT_FileAccess_Win64::GetSize() const if (!m_hFile) { return 0; } - LARGE_INTEGER size = {0, 0}; + LARGE_INTEGER size = {}; if (!::GetFileSizeEx(m_hFile, &size)) { return 0; } @@ -109,8 +109,8 @@ FX_FILESIZE CFXCRT_FileAccess_Win64::GetPosition() const if (!m_hFile) { return (FX_FILESIZE) - 1; } - LARGE_INTEGER dist = {0, 0}; - LARGE_INTEGER newPos = {0, 0}; + LARGE_INTEGER dist = {}; + LARGE_INTEGER newPos = {}; if (!::SetFilePointerEx(m_hFile, dist, &newPos, FILE_CURRENT)) { return (FX_FILESIZE) - 1; } @@ -123,7 +123,7 @@ FX_FILESIZE CFXCRT_FileAccess_Win64::SetPosition(FX_FILESIZE pos) } LARGE_INTEGER dist; dist.QuadPart = pos; - LARGE_INTEGER newPos = {0, 0}; + LARGE_INTEGER newPos = {}; if (!::SetFilePointerEx(m_hFile, dist, &newPos, FILE_BEGIN)) { return (FX_FILESIZE) - 1; } |