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

Issue 1384773002: Fix VC++ 2015 64-bit truncation warning in zlib (Closed)

Created:
5 years, 2 months ago by brucedawson
Modified:
5 years, 2 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix VC++ 2015 64-bit truncation warning in zlib VC++ 2015 64-bit builds were giving this warning: crc_folding.c(286): warning C4311: 'type cast': pointer truncation from 'const unsigned char *' to 'unsigned long' Converting from unsigned char* to long is normally dodgy but is safe in this case because of the masking with 0xF. Casting through uintptr_t is sufficient to allay VC++'s fears that we are making a mistake. R=pkasting@chromium.org,gavinp@chromium.org BUG=440500 Committed: https://crrev.com/b474ca01fcc5376eb538f71e524351e52319d396 Cr-Commit-Position: refs/heads/master@{#352900}

Patch Set 1 #

Total comments: 3

Patch Set 2 : Simplify patch #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -1 line) Patch
M third_party/zlib/README.chromium View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/zlib/crc_folding.c View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/zlib/google.patch View 1 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (5 generated)
brucedawson
You made the last changes to zlib to suppress conversion warnings so I thought you'd ...
5 years, 2 months ago (2015-10-02 22:17:00 UTC) #1
Peter Kasting
https://codereview.chromium.org/1384773002/diff/1/third_party/zlib/crc_folding.c File third_party/zlib/crc_folding.c (right): https://codereview.chromium.org/1384773002/diff/1/third_party/zlib/crc_folding.c#newcode288 third_party/zlib/crc_folding.c:288: algn_diff = 0 - (unsigned long)(size_t)src & 0xF; I'm ...
5 years, 2 months ago (2015-10-05 03:56:04 UTC) #3
brucedawson
https://codereview.chromium.org/1384773002/diff/1/third_party/zlib/crc_folding.c File third_party/zlib/crc_folding.c (right): https://codereview.chromium.org/1384773002/diff/1/third_party/zlib/crc_folding.c#newcode288 third_party/zlib/crc_folding.c:288: algn_diff = 0 - (unsigned long)(size_t)src & 0xF; On ...
5 years, 2 months ago (2015-10-05 16:03:24 UTC) #4
Peter Kasting
https://codereview.chromium.org/1384773002/diff/1/third_party/zlib/crc_folding.c File third_party/zlib/crc_folding.c (right): https://codereview.chromium.org/1384773002/diff/1/third_party/zlib/crc_folding.c#newcode288 third_party/zlib/crc_folding.c:288: algn_diff = 0 - (unsigned long)(size_t)src & 0xF; On ...
5 years, 2 months ago (2015-10-05 18:33:03 UTC) #5
brucedawson
None of those work as listed because src is a pointer and you can't and ...
5 years, 2 months ago (2015-10-05 22:10:32 UTC) #6
Peter Kasting
On 2015/10/05 22:10:32, brucedawson wrote: > None of those work as listed because src is ...
5 years, 2 months ago (2015-10-05 22:38:51 UTC) #7
Peter Kasting
Also pre-emptive LGTM on that so you don't have to round-trip through me again.
5 years, 2 months ago (2015-10-05 22:39:07 UTC) #8
brucedawson
Adding gavinp@ for OWNER approval I updated the .cc file and the google.patch file (both ...
5 years, 2 months ago (2015-10-05 22:57:51 UTC) #10
gavinp
lgtm. I'm very sad here about the sheer quantity of undefined code here, but you're ...
5 years, 2 months ago (2015-10-07 17:29:24 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1384773002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1384773002/20001
5 years, 2 months ago (2015-10-07 17:40:49 UTC) #14
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 2 months ago (2015-10-07 18:46:17 UTC) #15
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/b474ca01fcc5376eb538f71e524351e52319d396 Cr-Commit-Position: refs/heads/master@{#352900}
5 years, 2 months ago (2015-10-07 18:47:13 UTC) #16
scottmg
I think this shouldn't have been added to google.patch because crc_folding.c isn't part of the ...
5 years, 2 months ago (2015-10-07 19:33:58 UTC) #18
brucedawson
On 2015/10/07 19:33:58, scottmg wrote: > I think this shouldn't have been added to google.patch ...
5 years, 2 months ago (2015-10-07 21:10:54 UTC) #19
gavinp
On 2015/10/07 21:10:54, brucedawson wrote: > On 2015/10/07 19:33:58, scottmg wrote: > > I think ...
5 years, 2 months ago (2015-10-08 14:02:51 UTC) #20
brucedawson
5 years, 2 months ago (2015-10-08 18:01:58 UTC) #21
Message was sent while issue was closed.
I created https://codereview.chromium.org/1397813003 to address this.

Powered by Google App Engine
This is Rietveld 408576698