Descriptionwin: 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 #
Messages
Total messages: 3 (0 generated)
|