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

Issue 2733503002: Fix the conditional operator's usage (Closed)

Created:
3 years, 9 months ago by chengx
Modified:
3 years, 9 months ago
Reviewers:
Avi (use Gerrit), eae
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.

Description

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/+/76905b16d9f5ba9533a7e8d41724fcd383fa4d37

Patch Set 1 #

Total comments: 1

Patch Set 2 : change min() to max(). #

Patch Set 3 : add unittests. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+22 lines, -1 line) Patch
M third_party/WebKit/Source/platform/geometry/FloatQuad.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/platform/geometry/FloatQuadTest.cpp View 1 2 2 chunks +21 lines, -0 lines 0 comments Download

Messages

Total messages: 36 (25 generated)
chengx
PTAL~
3 years, 9 months ago (2017-03-03 02:00:31 UTC) #5
Avi (use Gerrit)
https://codereview.chromium.org/2733503002/diff/1/third_party/WebKit/Source/platform/geometry/FloatQuad.cpp File third_party/WebKit/Source/platform/geometry/FloatQuad.cpp (left): https://codereview.chromium.org/2733503002/diff/1/third_party/WebKit/Source/platform/geometry/FloatQuad.cpp#oldcode85 third_party/WebKit/Source/platform/geometry/FloatQuad.cpp:85: : std::numeric_limits<int>::min(); It seems likely that they meant return ...
3 years, 9 months ago (2017-03-03 02:03:44 UTC) #7
sky
I'm removing myself as a reviewer as I'm not an owner of this file.
3 years, 9 months ago (2017-03-03 04:08:34 UTC) #14
Avi (use Gerrit)
On 2017/03/03 04:08:34, sky wrote: > I'm removing myself as a reviewer as I'm not ...
3 years, 9 months ago (2017-03-03 04:24:19 UTC) #15
chengx
Hi pfeldman@, codereview tool shows you are an owner of this file, but I am ...
3 years, 9 months ago (2017-03-03 04:36:59 UTC) #17
pfeldman
Fix is fine, but Emil should look at it to add a test.
3 years, 9 months ago (2017-03-03 15:44:27 UTC) #19
chengx
FloatQuad.cpp seems not well covered by unittests, where more dev efforts are needed. For this ...
3 years, 9 months ago (2017-03-03 21:21:33 UTC) #20
pdr.
On 2017/03/03 at 21:21:33, chengx wrote: > FloatQuad.cpp seems not well covered by unittests, where ...
3 years, 9 months ago (2017-03-03 21:48:22 UTC) #21
eae
LGTM, thank you!
3 years, 9 months ago (2017-03-04 04:51:26 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2733503002/60001
3 years, 9 months ago (2017-03-04 05:35:07 UTC) #33
commit-bot: I haz the power
3 years, 9 months ago (2017-03-04 05:39:30 UTC) #36
Message was sent while issue was closed.
Committed patchset #3 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/76905b16d9f5ba9533a7e8d41724...

Powered by Google App Engine
This is Rietveld 408576698