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

Issue 2027273002: Fix all the code which has duplicate variable declarations (Closed)

Created:
4 years, 6 months ago by Wei Li
Modified:
4 years, 6 months ago
Reviewers:
Lei Zhang, Tom Sepez
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Target Ref:
refs/heads/master
Project:
pdfium
Visibility:
Public.

Description

Fix all the code which has duplicate variable declarations When there are duplicate variable declarations, the inner names shadow the outter ones. This is error prone and harder to read. Remove all the instances found by /analyze. BUG=chromium:613623, chromium:427616 Committed: https://pdfium.googlesource.com/pdfium/+/db444d2063df6c574882d9263e885c4fe1134133

Patch Set 1 : #

Patch Set 2 : fix loop conditions #

Patch Set 3 : rebase #

Total comments: 18

Patch Set 4 : address comments #

Patch Set 5 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+357 lines, -455 lines) Patch
M core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M core/fpdfapi/fpdf_font/cpdf_cidfont.cpp View 1 2 3 2 chunks +9 lines, -10 lines 0 comments Download
M core/fpdfapi/fpdf_page/fpdf_page_parser.cpp View 1 2 3 1 chunk +10 lines, -25 lines 0 comments Download
M core/fpdfapi/fpdf_parser/cpdf_security_handler.cpp View 1 2 3 5 chunks +16 lines, -22 lines 0 comments Download
M core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp View 5 chunks +6 lines, -8 lines 0 comments Download
M core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp View 2 chunks +5 lines, -6 lines 0 comments Download
M core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M core/fpdfdoc/doc_annot.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M core/fpdftext/fpdf_text_int.cpp View 2 chunks +9 lines, -12 lines 0 comments Download
M core/fxcodec/codec/fx_codec_fax.cpp View 1 chunk +5 lines, -5 lines 0 comments Download
M core/fxge/dib/fx_dib_composite.cpp View 1 2 3 11 chunks +43 lines, -64 lines 0 comments Download
M core/fxge/dib/fx_dib_convert.cpp View 3 chunks +3 lines, -4 lines 0 comments Download
M core/fxge/dib/fx_dib_transform.cpp View 2 chunks +1 line, -1 line 0 comments Download
M core/fxge/ge/fx_ge_device.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M fpdfsdk/formfiller/cffl_iformfiller.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M fpdfsdk/fpdf_flatten.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M fpdfsdk/fpdf_transformpage.cpp View 1 2 3 4 chunks +12 lines, -8 lines 0 comments Download
M fpdfsdk/javascript/Field.cpp View 2 chunks +5 lines, -5 lines 0 comments Download
M fpdfsdk/jsapi/fxjs_v8_embeddertest.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M fpdfsdk/pdfwindow/PWL_Edit.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M xfa/fde/cfde_txtedtengine.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M xfa/fde/cfx_wordbreak.cpp View 2 chunks +4 lines, -8 lines 0 comments Download
M xfa/fde/tto/fde_textout.cpp View 2 chunks +8 lines, -12 lines 0 comments Download
M xfa/fgas/font/fgas_gefont.cpp View 1 2 3 4 1 chunk +4 lines, -4 lines 0 comments Download
M xfa/fgas/layout/fgas_rtfbreak.cpp View 1 chunk +1 line, -2 lines 0 comments Download
M xfa/fgas/layout/fgas_textbreak.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M xfa/fwl/basewidget/fwl_comboboximp.cpp View 1 2 3 4 1 chunk +14 lines, -14 lines 0 comments Download
M xfa/fwl/basewidget/fwl_datetimepickerimp.cpp View 1 chunk +0 lines, -4 lines 0 comments Download
M xfa/fwl/basewidget/fwl_listboximp.cpp View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M xfa/fxbarcode/BC_TwoDimWriter.cpp View 1 chunk +2 lines, -3 lines 0 comments Download
M xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonDecoder.cpp View 2 chunks +4 lines, -4 lines 0 comments Download
M xfa/fxbarcode/datamatrix/BC_DataMatrixDataBlock.cpp View 4 chunks +11 lines, -16 lines 0 comments Download
M xfa/fxbarcode/datamatrix/BC_DataMatrixDecoder.cpp View 2 chunks +4 lines, -6 lines 0 comments Download
M xfa/fxbarcode/oned/BC_OneDimWriter.cpp View 1 chunk +2 lines, -3 lines 0 comments Download
M xfa/fxfa/app/xfa_ffdocview.cpp View 2 chunks +3 lines, -4 lines 0 comments Download
M xfa/fxfa/app/xfa_ffwidget.cpp View 6 chunks +10 lines, -12 lines 0 comments Download
M xfa/fxfa/app/xfa_textlayout.cpp View 7 chunks +21 lines, -36 lines 0 comments Download
M xfa/fxfa/fm2js/xfa_fm2jscontext.cpp View 1 2 3 4 13 chunks +51 lines, -53 lines 0 comments Download
M xfa/fxfa/fm2js/xfa_fmparse.cpp View 1 chunk +2 lines, -4 lines 0 comments Download
M xfa/fxfa/parser/xfa_document_datamerger_imp.cpp View 2 chunks +4 lines, -4 lines 0 comments Download
M xfa/fxfa/parser/xfa_document_serialize.cpp View 1 chunk +4 lines, -5 lines 0 comments Download
M xfa/fxfa/parser/xfa_layout_itemlayout.cpp View 8 chunks +17 lines, -21 lines 0 comments Download
M xfa/fxfa/parser/xfa_layout_pagemgr_new.cpp View 5 chunks +18 lines, -17 lines 0 comments Download
M xfa/fxfa/parser/xfa_object_imp.cpp View 1 2 3 4 5 chunks +11 lines, -15 lines 0 comments Download
M xfa/fxfa/parser/xfa_script_imp.cpp View 1 2 3 4 2 chunks +7 lines, -7 lines 0 comments Download

Messages

Total messages: 13 (6 generated)
Wei Li
pls review, thanks
4 years, 6 months ago (2016-06-01 21:46:11 UTC) #4
Tom Sepez
https://codereview.chromium.org/2027273002/diff/80001/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp File core/fpdfapi/fpdf_font/cpdf_cidfont.cpp (right): https://codereview.chromium.org/2027273002/diff/80001/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp#newcode818 core/fpdfapi/fpdf_font/cpdf_cidfont.cpp:818: if (CPDF_Array* array_elem = pObj->AsArray()) { nit: pSomething, also ...
4 years, 6 months ago (2016-06-01 22:23:04 UTC) #5
Tom Sepez
https://codereview.chromium.org/2027273002/diff/80001/core/fxge/dib/fx_dib_composite.cpp File core/fxge/dib/fx_dib_composite.cpp (right): https://codereview.chromium.org/2027273002/diff/80001/core/fxge/dib/fx_dib_composite.cpp#newcode3591 core/fxge/dib/fx_dib_composite.cpp:3591: uint8_t dest_scan_o[3] = {dest_scan[2], dest_scan[1], dest_scan[0]}; nit: can we ...
4 years, 6 months ago (2016-06-01 22:49:21 UTC) #6
Wei Li
thanks! https://codereview.chromium.org/2027273002/diff/80001/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp File core/fpdfapi/fpdf_font/cpdf_cidfont.cpp (right): https://codereview.chromium.org/2027273002/diff/80001/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp#newcode818 core/fpdfapi/fpdf_font/cpdf_cidfont.cpp:818: if (CPDF_Array* array_elem = pObj->AsArray()) { On 2016/06/01 ...
4 years, 6 months ago (2016-06-01 23:40:13 UTC) #7
Tom Sepez
lgtm
4 years, 6 months ago (2016-06-02 20:32:20 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2027273002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2027273002/120001
4 years, 6 months ago (2016-06-02 22:38:55 UTC) #11
commit-bot: I haz the power
4 years, 6 months ago (2016-06-02 22:48:25 UTC) #13
Message was sent while issue was closed.
Committed patchset #5 (id:120001) as
https://pdfium.googlesource.com/pdfium/+/db444d2063df6c574882d9263e885c4fe113...

Powered by Google App Engine
This is Rietveld 408576698