curl-library
unsigned/signed conversions
Date: Thu, 4 Mar 2004 12:45:36 +0100
This change in lib/http_chunks.h (1.10 of 2004-01-29):
@@ -81,8 +81,8 @@
char hexbuffer[ MAXNUM_SIZE + 1];
int hexindex;
ChunkyState state;
- size_t datasize;
- size_t dataleft; /* untouched data amount at the end of the last buffer */
+ ssize_t datasize;
+ ssize_t dataleft; /* untouched data amount at the end of the last buffer */
};
results in this compiler remark (irix and other picky compilers):
cc-1506 cc: REMARK File = ../../curl/lib/http_chunks.c, Line = 134
There is an implicit conversion from "unsigned long" to "int"; rounding, sign
extension, or loss of accuracy may result.
ch->datasize=strtoul(ch->hexbuffer, NULL, 16);
^
because datasize is now signed instead of unsigned. But shouldn't it really
be unsigned (size_t), as it used to be? I'm not sure what warnings it fixed,
but maybe the fix should have been elsewhere.. anyway, the following should
get rid of the current warning, although I'm not sure if that's the logically
correct way of doing it.
(I know I know, I should rather be looking at the last ssl problem of aix,
but sometimes you have to just fool around a bit with other minor stuff :-)
-Tor
-- Index: lib/http_chunks.c =================================================================== RCS file: /repository/curl/lib/http_chunks.c,v retrieving revision 1.22 diff -u -p -r1.22 http_chunks.c --- lib/http_chunks.c 29 Jan 2004 13:56:45 -0000 1.22 +++ lib/http_chunks.c 4 Mar 2004 11:42:47 -0000 @@ -131,7 +131,7 @@ CHUNKcode Curl_httpchunk_read(struct con } /* length and datap are unmodified */ ch->hexbuffer[ch->hexindex]=0; - ch->datasize=strtoul(ch->hexbuffer, NULL, 16); + ch->datasize=strtol(ch->hexbuffer, NULL, 16); ch->state = CHUNK_POSTHEX; } break;Received on 2004-03-04