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

Issue 1849753004: Fix C4434 warning about 32-bit shift assigned to 64-bits (Closed)

Created:
4 years, 8 months ago by brucedawson
Modified:
4 years, 8 months ago
Reviewers:
aluebs-webrtc
CC:
webrtc-reviews_webrtc.org, peah-webrtc, Andrew MacDonald, tterriberry_mozilla.com, audio-team_agora.io, hlundin-webrtc, kwiberg-webrtc, minyue-webrtc, the sun, aluebs-webrtc, bjornv1
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Fix C4434 warning about 32-bit shift assigned to 64-bits VS 2015 has a new or louder warning about 32-bit shifts that are then assigned to a 64-bit target. This type of code triggers it: int64_t size = 1 << shift_amount; Because the '1' being shifted is a 32-bit int the result of the shift will be a 32-bit result, so assigning it to a 64-bit variable is just misleading. In this case the code that triggers it is this: size_t window_size = static_cast<size_t>(1 << shift_amount); The destination is a size_t so the warning only shows up on 64-bit builds and doesn't indicate a real bug. It's curious that the code had a cast already - presumably to suppress some other warning - but the cast is not in the ideal place and doesn't avoid this new warning. Moving the cast allows shift_amount to be log2(size_t) and allows enabling C4334 in Chromium. BUG=593448 Committed: https://crrev.com/d81dc49c5be9a9322bdd47aef050a456e759a9f6 Cr-Commit-Position: refs/heads/master@{#12199}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -1 line) Patch
M webrtc/modules/audio_processing/intelligibility/intelligibility_enhancer.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 12 (5 generated)
brucedawson
Tiny change to let us enable C4334 in Chromium. PTAL.
4 years, 8 months ago (2016-03-31 20:56:48 UTC) #2
aluebs-webrtc
lgtm Thank you for taking care of this and for the clear explanation! :)
4 years, 8 months ago (2016-03-31 22:35:21 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1849753004/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1849753004/1
4 years, 8 months ago (2016-03-31 23:23:36 UTC) #5
commit-bot: I haz the power
Try jobs failed on following builders: android_arm64_rel on tryserver.webrtc (JOB_TIMED_OUT, no build URL) win_baremetal on ...
4 years, 8 months ago (2016-04-01 01:24:19 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1849753004/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1849753004/1
4 years, 8 months ago (2016-04-01 17:14:59 UTC) #9
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 8 months ago (2016-04-01 17:16:20 UTC) #10
commit-bot: I haz the power
4 years, 8 months ago (2016-04-01 17:16:28 UTC) #12
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/d81dc49c5be9a9322bdd47aef050a456e759a9f6
Cr-Commit-Position: refs/heads/master@{#12199}

Powered by Google App Engine
This is Rietveld 408576698