|
|
Chromium Code Reviews|
Created:
3 years, 9 months ago by chengx Modified:
3 years, 9 months ago CC:
chromium-reviews, krit, drott+blinkwatch_chromium.org, blink-reviews-platform-graphics_chromium.org, dshwang, pdr+graphicswatchlist_chromium.org, jbroman, fmalita+watch_chromium.org, Rik, Stephen Chennney, Justin Novosad, blink-reviews, kinuko+watch, ajuma+watch_chromium.org, danakj+watch_chromium.org, rwlbuis Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionFix the conditional operator's usage
PVS-Studio pointed out that for the code touched in this CL, the '?:'
operator, regardless of its conditional expression, always returns one
and the same value: std::numeric_limits <int>::min(). The second min()
should be fixed to max().
This CL fixed this bug and added unittests.
BUG=697659
Review-Url: https://codereview.chromium.org/2733503002
Cr-Commit-Position: refs/heads/master@{#454763}
Committed: https://chromium.googlesource.com/chromium/src/+/76905b16d9f5ba9533a7e8d41724fcd383fa4d37
Patch Set 1 #
Total comments: 1
Patch Set 2 : change min() to max(). #Patch Set 3 : add unittests. #
Messages
Total messages: 36 (25 generated)
The CQ bit was checked by chengx@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Fix nits. BUG=697659 ========== to ========== Remove the conditional expression as it is useless PVS-Studio pointed out that for the code touched in this CL, the '?:' operator, regardless of its conditional expression, always returns one and the same value: std::numeric_limits <int>::min(). This should be fixed. BUG=697659 ==========
chengx@chromium.org changed reviewers: + sky@chromium.org
PTAL~
avi@chromium.org changed reviewers: + avi@chromium.org
https://codereview.chromium.org/2733503002/diff/1/third_party/WebKit/Source/p... File third_party/WebKit/Source/platform/geometry/FloatQuad.cpp (left): https://codereview.chromium.org/2733503002/diff/1/third_party/WebKit/Source/p... third_party/WebKit/Source/platform/geometry/FloatQuad.cpp:85: : std::numeric_limits<int>::min(); It seems likely that they meant return std::signbit(value) ? std::numeric_limits<int>::min() : std::numeric_limits<int>::max();
The CQ bit was checked by chengx@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Remove the conditional expression as it is useless PVS-Studio pointed out that for the code touched in this CL, the '?:' operator, regardless of its conditional expression, always returns one and the same value: std::numeric_limits <int>::min(). This should be fixed. BUG=697659 ========== to ========== Fix the conditional operator's usage PVS-Studio pointed out that for the code touched in this CL, the '?:' operator, regardless of its conditional expression, always returns one and the same value: std::numeric_limits <int>::min(). The second min() should be fixed to max(). BUG=697659 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
sky@chromium.org changed reviewers: - sky@chromium.org
I'm removing myself as a reviewer as I'm not an owner of this file.
On 2017/03/03 04:08:34, sky wrote: > I'm removing myself as a reviewer as I'm not an owner of this file. I'm not an owner either, but I ran across this CL and it seemed wrong. PS2 LGTM but you need to find an owner.
chengx@chromium.org changed reviewers: + pfeldman@chromium.org - avi@chromium.org
Hi pfeldman@, codereview tool shows you are an owner of this file, but I am not sure. If you are, PTAL~
pfeldman@chromium.org changed reviewers: + eae@chromium.org - pfeldman@chromium.org
Fix is fine, but Emil should look at it to add a test.
FloatQuad.cpp seems not well covered by unittests, where more dev efforts are needed. For this CL, the bug is so obvious that I think maybe it is better to separate it from the CLs adding the unittests (not necessarily only for the function owning this bug), IMHO. On 2017/03/03 15:44:27, pfeldman wrote: > Fix is fine, but Emil should look at it to add a test.
On 2017/03/03 at 21:21:33, chengx wrote: > FloatQuad.cpp seems not well covered by unittests, where more dev efforts are needed. Can you add a simple test to third_party/WebKit/Source/platform/geometry/FloatQuadTest.cpp?
The CQ bit was checked by chengx@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was checked by chengx@chromium.org to run a CQ dry run
Patchset #3 (id:40001) has been deleted
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== Fix the conditional operator's usage PVS-Studio pointed out that for the code touched in this CL, the '?:' operator, regardless of its conditional expression, always returns one and the same value: std::numeric_limits <int>::min(). The second min() should be fixed to max(). BUG=697659 ========== to ========== Fix the conditional operator's usage PVS-Studio pointed out that for the code touched in this CL, the '?:' operator, regardless of its conditional expression, always returns one and the same value: std::numeric_limits <int>::min(). The second min() should be fixed to max(). This CL fixed this bug and added unittests. BUG=697659 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
LGTM, thank you!
The CQ bit was checked by chengx@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from avi@chromium.org Link to the patchset: https://codereview.chromium.org/2733503002/#ps60001 (title: "add unittests.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 60001, "attempt_start_ts": 1488605700107800,
"parent_rev": "5cff667b54049eb1d52cb5fadac3e9ed08e68460", "commit_rev":
"76905b16d9f5ba9533a7e8d41724fcd383fa4d37"}
Message was sent while issue was closed.
Description was changed from ========== Fix the conditional operator's usage PVS-Studio pointed out that for the code touched in this CL, the '?:' operator, regardless of its conditional expression, always returns one and the same value: std::numeric_limits <int>::min(). The second min() should be fixed to max(). This CL fixed this bug and added unittests. BUG=697659 ========== to ========== Fix the conditional operator's usage PVS-Studio pointed out that for the code touched in this CL, the '?:' operator, regardless of its conditional expression, always returns one and the same value: std::numeric_limits <int>::min(). The second min() should be fixed to max(). This CL fixed this bug and added unittests. BUG=697659 Review-Url: https://codereview.chromium.org/2733503002 Cr-Commit-Position: refs/heads/master@{#454763} Committed: https://chromium.googlesource.com/chromium/src/+/76905b16d9f5ba9533a7e8d41724... ==========
Message was sent while issue was closed.
Committed patchset #3 (id:60001) as https://chromium.googlesource.com/chromium/src/+/76905b16d9f5ba9533a7e8d41724... |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
