From 0994d7811f691f0b5c6743ae8d3ce90310cd7cea Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Tue, 2 Sep 2008 18:36:39 +0000 Subject: [PATCH] Removed some redundant type casts --- lib/base64.c | 4 ++-- lib/hostip.c | 2 +- lib/ssh.c | 2 +- lib/tftp.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/base64.c b/lib/base64.c index 6b9331083f..da9d01a93d 100644 --- a/lib/base64.c +++ b/lib/base64.c @@ -117,7 +117,7 @@ size_t Curl_base64_decode(const char *src, unsigned char **outptr) /* Decode all but the last quantum (which may not decode to a multiple of 3 bytes) */ for(i = 0; i < numQuantums - 1; i++) { - decodeQuantum((unsigned char *)newstr, src); + decodeQuantum(newstr, src); newstr += 3; src += 4; } @@ -153,7 +153,7 @@ size_t Curl_base64_encode(struct SessionHandle *data, char *convbuf = NULL; #endif - char *indata = (char *)inp; + const char *indata = inp; *outptr = NULL; /* set to NULL in case of failure before we reach the end */ diff --git a/lib/hostip.c b/lib/hostip.c index 4e0df25466..604dbbbdcb 100644 --- a/lib/hostip.c +++ b/lib/hostip.c @@ -619,7 +619,7 @@ Curl_addrinfo *Curl_ip2addr(in_addr_t num, const char *hostname, int port) h->h_aliases = NULL; /* Now store the dotted version of the address */ - snprintf((char *)h->h_name, 16, "%s", hostname); + snprintf(h->h_name, 16, "%s", hostname); #if defined(VMS) && \ defined(__INITIAL_POINTER_SIZE) && (__INITIAL_POINTER_SIZE == 64) diff --git a/lib/ssh.c b/lib/ssh.c index 95ce96fe74..c86b2530c6 100644 --- a/lib/ssh.c +++ b/lib/ssh.c @@ -765,7 +765,7 @@ static CURLcode ssh_statemach_act(struct connectdata *conn) else if(rc > 0) { /* It seems that this string is not always NULL terminated */ tempHome[rc] = '\0'; - sshc->homedir = (char *)strdup(tempHome); + sshc->homedir = strdup(tempHome); if(!sshc->homedir) { state(conn, SSH_SFTP_CLOSE); sshc->actualcode = CURLE_OUT_OF_MEMORY; diff --git a/lib/tftp.c b/lib/tftp.c index 8478fd6f91..65c35427e5 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -803,7 +803,7 @@ static CURLcode tftp_do(struct connectdata *conn, bool *done) break; case TFTP_EVENT_ERROR: state->error = (tftp_error_t)getrpacketblock(&state->rpacket); - infof(data, "%s\n", (char *)&state->rpacket.data[4]); + infof(data, "%s\n", (const char *)&state->rpacket.data[4]); break; case TFTP_EVENT_ACK: break;