From 65ffa4a4ee599194118a0ddf3c26fc3674120b4a Mon Sep 17 00:00:00 2001 From: weili Date: Wed, 13 Apr 2016 10:26:53 -0700 Subject: Re-enable warning 4701 for GN build and some cleanup Clean up three 4701 warnings (use potientially uninitialized variable) which are the only ones left; Re-enable warning 4701 for GN build; Remove an unused data structure; BUG=pdfium:29 Review URL: https://codereview.chromium.org/1885093002 --- BUILD.gn | 1 - core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp | 2 +- core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp | 5 +++- core/fxcodec/jbig2/JBig2_Context.cpp | 2 +- xfa/fgas/localization/fgas_datetime.h | 31 ------------------------ 5 files changed, 6 insertions(+), 35 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 74903bf682..bb0b5cb3c6 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -44,7 +44,6 @@ config("pdfium_config") { if (is_win) { cflags += [ "/wd4267", - "/wd4701", ] } diff --git a/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp b/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp index 379e75938e..c3d4ca621a 100644 --- a/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp +++ b/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp @@ -354,7 +354,7 @@ CPDF_Font* CPDF_Document::AddWindowsFont(LOGFONTA* pLogFont, pFontDict = new CPDF_Dictionary; CFX_ByteString cmap; CFX_ByteString ordering; - int supplement; + int supplement = 0; CPDF_Array* pWidthArray = new CPDF_Array; switch (pLogFont->lfCharSet) { case CHINESEBIG5_CHARSET: diff --git a/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp index 48f9f5d98a..6ac380e43a 100644 --- a/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp +++ b/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp @@ -653,7 +653,10 @@ struct CPDF_PatchDrawer { FX_BOOL bSmall = C1.Distance() < 2 && C2.Distance() < 2 && D1.Distance() < 2 && D2.Distance() < 2; Coon_Color div_colors[4]; - int d_bottom, d_left, d_top, d_right; + int d_bottom = 0; + int d_left = 0; + int d_top = 0; + int d_right = 0; div_colors[0].BiInterpol(patch_colors, left, bottom, x_scale, y_scale); if (!bSmall) { div_colors[1].BiInterpol(patch_colors, left, bottom + 1, x_scale, diff --git a/core/fxcodec/jbig2/JBig2_Context.cpp b/core/fxcodec/jbig2/JBig2_Context.cpp index 1ff78e121f..5a0b2c0d73 100644 --- a/core/fxcodec/jbig2/JBig2_Context.cpp +++ b/core/fxcodec/jbig2/JBig2_Context.cpp @@ -1285,7 +1285,7 @@ JBig2HuffmanCode* CJBig2_Context::decodeSymbolIDHuffmanTable( std::unique_ptr SBSYMCODES( FX_Alloc(JBig2HuffmanCode, SBNUMSYMS)); - int32_t run; + int32_t run = 0; int32_t i = 0; while (i < (int)SBNUMSYMS) { size_t j; diff --git a/xfa/fgas/localization/fgas_datetime.h b/xfa/fgas/localization/fgas_datetime.h index df2989fc58..7c8f111bfc 100644 --- a/xfa/fgas/localization/fgas_datetime.h +++ b/xfa/fgas/localization/fgas_datetime.h @@ -205,37 +205,6 @@ struct FX_DATETIME { } Time; }; -struct FX_DATETIMEZONE { - union { - struct { - union { - struct { - int32_t year; - uint8_t month; - uint8_t day; - }; - FX_DATE date; - }; - union { - struct { - uint8_t hour; - uint8_t minute; - uint8_t second; - uint16_t millisecond; - }; - FX_TIME time; - }; - }; - FX_DATETIME dt; - }; - union { - struct { - int8_t tzHour; - uint8_t tzMinute; - }; - FX_TIMEZONE tz; - }; -}; #if _FX_OS_ != _FX_ANDROID_ #pragma pack(pop) #endif -- cgit v1.2.3