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

Issue 491883003: win: Fix a 64bit warning. (Closed)

Created:
6 years, 4 months ago by Nico
Modified:
6 years, 4 months ago
Reviewers:
brettw
CC:
chromium-reviews, erikwright+watch_chromium.org
Project:
chromium
Visibility:
Public.

Description

win: Fix a 64bit warning. clang warns: ..\..\base\files\file_path.cc(695,47) : warning(clang): cast to 'wchar_t *' from smaller integer type 'LONG' (aka 'long') [-Wint-to-pointer-cast] wchar_t c1 = (wchar_t)LOWORD(::CharUpperW((LPWSTR)MAKELONG(*i1, 0))); ^ CharUpper() is a pretty whacko: It takes a pointer, but: """ A null-terminated string, or a single character. If the high-order word of this parameter is zero, the low-order word must contain a single character to be converted.""" (!) It's not clear to me what this means on 64bit, but the code as-is casted a 32bit int (a DWORD) to a pointer, which I think doesn't guarantee that the upper 4 byte of the 8 byte pointer are zero. So insert a cast to a pointer-wide int type to guarantee this, and to fix this warning. BUG=82385 R=brettw@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=290905

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -2 lines) Patch
M base/files/file_path.cc View 1 chunk +4 lines, -2 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Nico
6 years, 4 months ago (2014-08-20 17:16:08 UTC) #1
brettw
LGTM
6 years, 4 months ago (2014-08-20 20:09:48 UTC) #2
Nico
6 years, 4 months ago (2014-08-20 20:12:22 UTC) #3
Message was sent while issue was closed.
Committed patchset #1 manually as 290905 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698