cURL / Mailing Lists / curl-users / Single Mail

curl-users

MSVC 6 warnings related to curl_off_t

From: David Byron <DByron_at_everdreamcorp.com>
Date: Thu, 8 Apr 2004 17:15:11 -0700

I'm building main.c (1.252) with MSVC 6 and I'm getting the following
warnings:

        cl.exe /MT /O2 /D "NDEBUG" /I "../lib" /I "../include" /I
"c:\src\cobra\
zlib" /nologo /W3 /GX /D "WIN32" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-DUSE_SSLEA
Y /Fo"mainr.obj" main.c
main.c
main.c(2274) : warning C4244: '=' : conversion from '__int64 ' to 'long ',
possi
ble loss of data
main.c(2347) : warning C4244: '=' : conversion from '__int64 ' to 'long ',
possi
ble loss of data
main.c(2357) : warning C4244: '=' : conversion from '__int64 ' to 'unsigned
int
', possible loss of data

Looks like we're half way through a change to curl_off_t in some places.

This is not so hard to resolve, but there are enough choices here that I
thought I'd ask before submitting a patch. Basically, if we change the type
of a few variables, and the signature of my_fread and go_sleep, we're there.

Only problem is, fread wants a size_t where we'd pass it a curl_off_t. Same
for Sleep(). The sleep is pretty easy -- if the number is too big, sleep
multiple times, etc.

The fread is a little harder. I figure we don't really want to change the
signature of my_fread after all.

In the end, some casting may be enough. I'm not sure I can justify it
though. The root of all this appears to be the argument to --limit-rate.
That's handled as a curl_off_t....

Any ideas?

Thanks much.

-DB
Received on 2004-04-09