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

Issue 1843253002: 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:
Tom Sepez
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Target Ref:
refs/heads/master
Project:
pdfium
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: m_IAID.resize(1 << SBSYMCODELEN); The destination is a size_t so the warning only shows up on 64-bit builds and doesn't indicate a real bug. But, casting the '1' constant to size_t makes the behavior/intent more obvious and consistent and allows enabling C4334 in Chromium. BUG=593448 R=tsepez@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/5a839e938bad5b766a928fb545f0b0aba39e3829

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -1 line) Patch
M core/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 5 (2 generated)
brucedawson
4 years, 8 months ago (2016-03-30 21:31:35 UTC) #2
Tom Sepez
lgtm
4 years, 8 months ago (2016-03-30 22:12:03 UTC) #3
brucedawson
4 years, 8 months ago (2016-03-30 22:27:04 UTC) #5
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
5a839e938bad5b766a928fb545f0b0aba39e3829 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698