diff options
author | Yang Tse <yangsita@gmail.com> | 2008-09-06 04:28:43 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2008-09-06 04:28:43 +0000 |
commit | 861b647e7b1da564b831a5b07312a30feb7b6c58 (patch) | |
tree | 0bf8f137e7db222deefccc94fe3a22eecadba7d8 /lib | |
parent | 70e57dad8856c2b99d947344661ae260c6fff594 (diff) |
remove unnecessary typecasting of realloc()
Diffstat (limited to 'lib')
-rw-r--r-- | lib/base64.c | 2 | ||||
-rw-r--r-- | lib/http.c | 2 | ||||
-rw-r--r-- | lib/http_chunks.c | 2 | ||||
-rw-r--r-- | lib/http_digest.c | 2 | ||||
-rw-r--r-- | lib/mprintf.c | 2 | ||||
-rw-r--r-- | lib/transfer.c | 4 | ||||
-rw-r--r-- | lib/url.c | 3 |
7 files changed, 8 insertions, 9 deletions
diff --git a/lib/base64.c b/lib/base64.c index 9dbf9f4ea..0453624fb 100644 --- a/lib/base64.c +++ b/lib/base64.c @@ -356,7 +356,7 @@ void *suck(int *lenptr) do { cursize *= 2; - buf = (unsigned char *)realloc(buf, cursize); + buf = realloc(buf, cursize); memset(buf + len, 0, cursize - len); lastread = fread(buf + len, 1, cursize - len, stdin); len += lastread; diff --git a/lib/http.c b/lib/http.c index 77a99cc6a..3b05184ad 100644 --- a/lib/http.c +++ b/lib/http.c @@ -1190,7 +1190,7 @@ CURLcode add_buffer(send_buffer *in, const void *inptr, size_t size) if(in->buffer) /* we have a buffer, enlarge the existing one */ - new_rb = (char *)realloc(in->buffer, new_size); + new_rb = realloc(in->buffer, new_size); else /* create a new buffer */ new_rb = (char *)malloc(new_size); diff --git a/lib/http_chunks.c b/lib/http_chunks.c index ad9783404..45199866f 100644 --- a/lib/http_chunks.c +++ b/lib/http_chunks.c @@ -305,7 +305,7 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn, char *ptr; if(conn->trlMax) { conn->trlMax *= 2; - ptr = (char*)realloc(conn->trailer,conn->trlMax); + ptr = realloc(conn->trailer,conn->trlMax); } else { conn->trlMax=128; diff --git a/lib/http_digest.c b/lib/http_digest.c index ddeb93747..a3c2ad7d7 100644 --- a/lib/http_digest.c +++ b/lib/http_digest.c @@ -460,7 +460,7 @@ CURLcode Curl_output_digest(struct connectdata *conn, } /* append CRLF to the userpwd header */ - tmp = (char*) realloc(*allocuserpwd, strlen(*allocuserpwd) + 3 + 1); + tmp = realloc(*allocuserpwd, strlen(*allocuserpwd) + 3 + 1); if(!tmp) return CURLE_OUT_OF_MEMORY; strcat(tmp, "\r\n"); diff --git a/lib/mprintf.c b/lib/mprintf.c index 02a25f6de..255eb11df 100644 --- a/lib/mprintf.c +++ b/lib/mprintf.c @@ -1079,7 +1079,7 @@ static int alloc_addbyter(int output, FILE *data) else if(infop->len+1 >= infop->alloc) { char *newptr; - newptr = (char *)realloc(infop->buffer, infop->alloc*2); + newptr = realloc(infop->buffer, infop->alloc*2); if(!newptr) { infop->fail = 1; diff --git a/lib/transfer.c b/lib/transfer.c index 36b1953fc..baf7c19e8 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -702,7 +702,7 @@ static CURLcode readwrite_headers(struct SessionHandle *data, size_t newsize=CURLMAX((k->hbuflen+*nread)*3/2, data->state.headersize*2); hbufp_index = k->hbufp - data->state.headerbuff; - newbuff = (char *)realloc(data->state.headerbuff, newsize); + newbuff = realloc(data->state.headerbuff, newsize); if(!newbuff) { failf (data, "Failed to alloc memory for big header!"); return CURLE_OUT_OF_MEMORY; @@ -747,7 +747,7 @@ static CURLcode readwrite_headers(struct SessionHandle *data, size_t newsize=CURLMAX((k->hbuflen+full_length)*3/2, data->state.headersize*2); hbufp_index = k->hbufp - data->state.headerbuff; - newbuff = (char *)realloc(data->state.headerbuff, newsize); + newbuff = realloc(data->state.headerbuff, newsize); if(!newbuff) { failf (data, "Failed to alloc memory for big header!"); return CURLE_OUT_OF_MEMORY; @@ -602,8 +602,7 @@ CURLcode Curl_ch_connc(struct SessionHandle *data, data->state.lastconnect = -1; } if(newamount > 0) { - newptr= (struct connectdata **) - realloc(c->connects, sizeof(struct connectdata *) * newamount); + newptr = realloc(c->connects, sizeof(struct connectdata *) * newamount); if(!newptr) /* we closed a few connections in vain, but so what? */ return CURLE_OUT_OF_MEMORY; |