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

Issue 1433513002: Revert "Revert "Revert "Revert "Cleanup some numeric code."""" (Closed)

Created:
5 years, 1 month ago by dsinclair
Modified:
5 years, 1 month ago
Reviewers:
Tom Sepez
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Revert "Revert "Revert "Revert "Cleanup some numeric code."""" This reverts commit da06e60fb5a095a91c9a4f509466667878624cb3. Cleanup some numeric code. This changes the various comparisons of char >= '0' && char <= '9' and char < '0' || char > '9' to use std::isdigit checks. It also cleans up a handful of hex to digit conversions to call one common method. R=tsepez@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/b27902b8995bb3e003daed6b0811ed746763c68d

Patch Set 1 #

Patch Set 2 : #

Total comments: 4

Patch Set 3 : #

Total comments: 3

Patch Set 4 : #

Total comments: 23

Patch Set 5 : #

Total comments: 3

Patch Set 6 : Rebase to master #

Patch Set 7 : #

Patch Set 8 : #

Patch Set 9 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+313 lines, -353 lines) Patch
M BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M core/include/fxcrt/fx_ext.h View 1 2 3 4 4 chunks +23 lines, -14 lines 0 comments Download
M core/src/fpdfapi/fpdf_font/fpdf_font.cpp View 1 2 3 4 5 6 7 8 4 chunks +13 lines, -38 lines 0 comments Download
M core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp View 1 2 3 4 5 6 7 8 4 chunks +10 lines, -34 lines 0 comments Download
M core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp View 1 2 3 4 5 6 7 8 5 chunks +24 lines, -40 lines 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp View 1 2 3 4 5 6 7 8 2 chunks +14 lines, -18 lines 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp View 1 2 3 4 5 6 7 8 15 chunks +74 lines, -89 lines 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp View 1 2 3 4 5 6 7 8 3 chunks +4 lines, -13 lines 0 comments Download
M core/src/fpdftext/fpdf_text.cpp View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -3 lines 0 comments Download
M core/src/fpdftext/fpdf_text_int.cpp View 1 2 3 4 5 6 7 8 3 chunks +5 lines, -6 lines 0 comments Download
M core/src/fxcodec/codec/fx_codec.cpp View 1 2 3 4 5 6 7 8 7 chunks +27 lines, -22 lines 0 comments Download
M core/src/fxcrt/fx_basic_bstring.cpp View 1 2 3 4 5 6 7 8 3 chunks +5 lines, -4 lines 0 comments Download
M core/src/fxcrt/fx_basic_gcc.cpp View 1 2 3 4 5 6 7 8 2 chunks +34 lines, -14 lines 0 comments Download
M core/src/fxcrt/fx_basic_util.cpp View 1 2 3 4 5 6 7 8 4 chunks +9 lines, -9 lines 0 comments Download
M core/src/fxcrt/fx_basic_wstring.cpp View 1 2 3 4 5 6 7 8 5 chunks +8 lines, -6 lines 0 comments Download
M core/src/fxcrt/fx_extension.cpp View 1 2 3 4 5 6 7 8 3 chunks +2 lines, -12 lines 0 comments Download
A core/src/fxcrt/fx_extension_unittest.cpp View 1 2 3 1 chunk +24 lines, -0 lines 0 comments Download
M core/src/fxcrt/fx_xml_parser.cpp View 1 2 3 4 5 6 7 8 3 chunks +4 lines, -4 lines 0 comments Download
M fpdfsdk/src/fsdk_baseannot.cpp View 1 2 3 4 10 chunks +20 lines, -22 lines 0 comments Download
M fpdfsdk/src/javascript/PublicMethods.cpp View 1 2 3 4 5 3 chunks +3 lines, -2 lines 0 comments Download
M fpdfsdk/src/javascript/util.cpp View 4 chunks +4 lines, -3 lines 0 comments Download
M pdfium.gyp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 14 (1 generated)
dsinclair
PTAL. Fixes windows in PS2. https://codereview.chromium.org/1433513002/diff/20001/core/include/fxcrt/fx_ext.h File core/include/fxcrt/fx_ext.h (right): https://codereview.chromium.org/1433513002/diff/20001/core/include/fxcrt/fx_ext.h#newcode46 core/include/fxcrt/fx_ext.h:46: inline int FXSYS_toDecimalDigit(const FX_WCHAR ...
5 years, 1 month ago (2015-11-03 21:05:48 UTC) #2
Tom Sepez
https://codereview.chromium.org/1433513002/diff/20001/core/include/fxcrt/fx_ext.h File core/include/fxcrt/fx_ext.h (right): https://codereview.chromium.org/1433513002/diff/20001/core/include/fxcrt/fx_ext.h#newcode46 core/include/fxcrt/fx_ext.h:46: inline int FXSYS_toDecimalDigit(const FX_WCHAR c) { On 2015/11/03 21:05:48, ...
5 years, 1 month ago (2015-11-03 21:54:37 UTC) #3
Tom Sepez
https://codereview.chromium.org/1433513002/diff/20001/core/include/fxcrt/fx_ext.h File core/include/fxcrt/fx_ext.h (right): https://codereview.chromium.org/1433513002/diff/20001/core/include/fxcrt/fx_ext.h#newcode46 core/include/fxcrt/fx_ext.h:46: inline int FXSYS_toDecimalDigit(const FX_WCHAR c) { If its http://build.chromium.org/p/client.pdfium/builders/windows/builds/56/steps/compile%20with%20ninja/logs/stdio ...
5 years, 1 month ago (2015-11-03 22:02:51 UTC) #4
dsinclair
https://codereview.chromium.org/1433513002/diff/20001/core/include/fxcrt/fx_ext.h File core/include/fxcrt/fx_ext.h (right): https://codereview.chromium.org/1433513002/diff/20001/core/include/fxcrt/fx_ext.h#newcode46 core/include/fxcrt/fx_ext.h:46: inline int FXSYS_toDecimalDigit(const FX_WCHAR c) { On 2015/11/03 22:02:51, ...
5 years, 1 month ago (2015-11-04 14:45:01 UTC) #5
Tom Sepez
I think we're at a point, where much like std::isxdigit() and std::iswxdigit(), we want to ...
5 years, 1 month ago (2015-11-04 17:49:25 UTC) #6
dsinclair
On 2015/11/04 17:49:25, Tom Sepez wrote: > I think we're at a point, where much ...
5 years, 1 month ago (2015-11-04 17:54:57 UTC) #7
Tom Sepez
Better. But this is a really hard problem to do right. https://codereview.chromium.org/1433513002/diff/60001/core/include/fxcrt/fx_ext.h File core/include/fxcrt/fx_ext.h (right): ...
5 years, 1 month ago (2015-11-04 18:42:46 UTC) #8
dsinclair
PTAL. Went through and found a few more places we should be using the Wide ...
5 years, 1 month ago (2015-11-04 20:16:24 UTC) #9
Tom Sepez
Almost. How about using base's safe numerics instead? The checks are more convoluted than I ...
5 years, 1 month ago (2015-11-04 20:33:11 UTC) #10
dsinclair
https://codereview.chromium.org/1433513002/diff/80001/core/src/fxcrt/fx_basic_util.cpp File core/src/fxcrt/fx_basic_util.cpp (right): https://codereview.chromium.org/1433513002/diff/80001/core/src/fxcrt/fx_basic_util.cpp#newcode114 core/src/fxcrt/fx_basic_util.cpp:114: if (integer > std::numeric_limits<int>::max() - 9) On 2015/11/04 20:33:11, ...
5 years, 1 month ago (2015-11-04 21:31:28 UTC) #11
dsinclair
https://codereview.chromium.org/1433513002/diff/80001/core/src/fxcrt/fx_basic_util.cpp File core/src/fxcrt/fx_basic_util.cpp (right): https://codereview.chromium.org/1433513002/diff/80001/core/src/fxcrt/fx_basic_util.cpp#newcode114 core/src/fxcrt/fx_basic_util.cpp:114: if (integer > std::numeric_limits<int>::max() - 9) On 2015/11/04 21:31:28, ...
5 years, 1 month ago (2015-11-10 00:47:03 UTC) #12
Tom Sepez
lgtm
5 years, 1 month ago (2015-11-10 17:06:18 UTC) #13
dsinclair
5 years, 1 month ago (2015-11-10 18:18:04 UTC) #14
Message was sent while issue was closed.
Committed patchset #9 (id:160001) manually as
b27902b8995bb3e003daed6b0811ed746763c68d (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698