Bug #1260: Fix win32.c compiler warnings
http://redmine.ruby-lang.org/issues/show/1260

Author: Charlie Savage
Status: Open, Priority: Normal
Category: core, Target version: 1.9.1
ruby -v: ruby 1.9.2dev (2009-03-06) [i386-mswin32_90]

This patch fixes the majority of compiler warnings for win32.c.

At a minimum I'd recommend the change to include rtcapi.h. I'd also recommend the extra parentheses in:

((1 << ((filename[0] & 0x5f) - 'A')) & GetLogicalDrives()) == 0)) {

To clarify the code (according to operator preference the - happens before the <<.

Thanks,

Charlie

-----------------------



cl -nologo -nologo -MD -RTC1 -Zi -Od -W3 -wd4996 -Od  -Zm600 -DRUBY_EXPORT -I. -I.ext/include/i386-mswin32_90 -I./../include -I./.. -I./../missing  -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE   -I. -I./.. -I./../missing -IC:\Development\msvc\include -DLIBRUBY_SO=\"ruby19.dll\" -Fowin32.obj -c -Tcwin32.c win32.c
win32.c(539) : warning C4013: '_RTC_SetErrorFunc' undefined; assuming extern returning int
win32.c(1599) : warning C4554: '<<' : check operator precedence for possible error; use parentheses to clarify precedence
win32.c(2142) : warning C4018: '<' : signed/unsigned mismatch
win32.c(2148) : warning C4018: '<' : signed/unsigned mismatch
win32.c(2153) : warning C4018: '>=' : signed/unsigned mismatch
win32.c(2176) : warning C4018: '<' : signed/unsigned mismatch
win32.c(2179) : warning C4018: '<' : signed/unsigned mismatch
win32.c(2383) : warning C4018: '>' : signed/unsigned mismatch
win32.c(2384) : warning C4018: '>' : signed/unsigned mismatch
win32.c(2385) : warning C4018: '>' : signed/unsigned mismatch
win32.c(3214) : warning C4018: '>' : signed/unsigned mismatch
win32.c(3260) : warning C4244: '=' : conversion from 'unsigned __int64' to 'long', possible loss of data
win32.c(3720) : warning C4244: '=' : conversion from '__int64' to '_off_t', possible loss of data
win32.c(4619) : warning C4018: '<' : signed/unsigned mismatch
win32.c(4737) : warning C4018: '<' : signed/unsigned mismatch


----------------------------------------
http://redmine.ruby-lang.org