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

Issue 893703004: Rewriting patch logic without the comma operator. (Closed)

Created:
5 years, 10 months ago by brucedawson
Modified:
5 years, 10 months ago
Reviewers:
grt (UTC plus 2)
CC:
chromium-reviews, grt+watch_chromium.org, wfh+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Rewriting patch logic without the comma operator. When running /analyze on all of Chrome there were three warnings about using the comma operator in a tested expression. One was a genuine bug and the other two were in UncompressAndPatchChromeArchive. Rewriting to use nested if statements resolves these warnings (getting the count to zero) and makes the code clearer. Resolving the warning is not crucial, but it makes it easier to make a zero-tolerance policy for that warning and thus avoid future bugs. Plus, it makes the setup code easier to read. The warnings are: src\chrome\installer\setup\setup_main.cc(174) : warning C6319: Use of the comma-operator in a tested expression causes the left argument to be ignored when it has no side-effects. src\chrome\installer\setup\setup_main.cc(176) : warning C6319: Use of the comma-operator in a tested expression causes the left argument to be ignored when it has no side-effects. The bug that was found through this warning, which could eventually have been very serious, was fixed here: https://codereview.chromium.org/678193003 BUG=427616 Committed: https://crrev.com/944c28c5ee375cd1eec61e4530750e37c29f65be Cr-Commit-Position: refs/heads/master@{#314389}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Fixing indentation as per code-review. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -9 lines) Patch
M chrome/installer/setup/setup_main.cc View 1 1 chunk +9 lines, -9 lines 0 comments Download

Messages

Total messages: 9 (2 generated)
brucedawson
What do you think about this? Clearer? The code builds but I'm not sure how ...
5 years, 10 months ago (2015-02-03 18:44:00 UTC) #2
grt (UTC plus 2)
lgtm with a formatting nit. thanks for taking care of this. https://codereview.chromium.org/893703004/diff/1/chrome/installer/setup/setup_main.cc File chrome/installer/setup/setup_main.cc (right): ...
5 years, 10 months ago (2015-02-03 18:49:08 UTC) #3
brucedawson
Any thoughts on testing? Are try-bots/canary sufficient? I'm not sure how to practically exercise this. ...
5 years, 10 months ago (2015-02-03 19:02:22 UTC) #4
grt (UTC plus 2)
On 2015/02/03 19:02:22, brucedawson wrote: > Any thoughts on testing? Are try-bots/canary sufficient? I'm not ...
5 years, 10 months ago (2015-02-03 19:06:16 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/893703004/20001
5 years, 10 months ago (2015-02-03 19:18:04 UTC) #7
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 10 months ago (2015-02-03 19:54:18 UTC) #8
commit-bot: I haz the power
5 years, 10 months ago (2015-02-03 19:55:54 UTC) #9
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/944c28c5ee375cd1eec61e4530750e37c29f65be
Cr-Commit-Position: refs/heads/master@{#314389}

Powered by Google App Engine
This is Rietveld 408576698