diff options
author | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-09-20 08:07:15 +0000 |
---|---|---|
committer | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-09-20 08:07:15 +0000 |
commit | 261d5c3644118dd62ba2805ed83fe5af1440cace (patch) | |
tree | cb4b966c352048c2466a7d4e8f3a036a436a77eb | |
parent | bcc691aa9efec015d4d793e6353d10c9cd0632e8 (diff) | |
download | slirp-261d5c3644118dd62ba2805ed83fe5af1440cace.zip slirp-261d5c3644118dd62ba2805ed83fe5af1440cace.tar.gz slirp-261d5c3644118dd62ba2805ed83fe5af1440cace.tar.bz2 |
Suppress gcc 4.x -Wpointer-sign (included in -Wall) warnings
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5275 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r-- | bootp.c | 3 | ||||
-rw-r--r-- | tcp_subr.c | 4 | ||||
-rw-r--r-- | tftp.c | 18 |
3 files changed, 15 insertions, 10 deletions
@@ -173,7 +173,8 @@ static void bootp_reply(struct bootp_t *bp) } if (bootp_filename) - snprintf(rbp->bp_file, sizeof(rbp->bp_file), "%s", bootp_filename); + snprintf((char *)rbp->bp_file, sizeof(rbp->bp_file), "%s", + bootp_filename); dprintf("offered addr=%08x\n", ntohl(daddr.sin_addr.s_addr)); @@ -436,7 +436,7 @@ void tcp_connect(inso) struct socket *inso; { struct socket *so; struct sockaddr_in addr; - int addrlen = sizeof(struct sockaddr_in); + socklen_t addrlen = sizeof(struct sockaddr_in); struct tcpcb *tp; int s, opt; @@ -634,7 +634,7 @@ struct mbuf *m; { struct socket *tmpso; struct sockaddr_in addr; - int addrlen = sizeof(struct sockaddr_in); + socklen_t addrlen = sizeof(struct sockaddr_in); struct sbuf *so_rcv = &so->so_rcv; memcpy(so_rcv->sb_wptr, m->m_data, m->m_len); @@ -148,8 +148,12 @@ static int tftp_send_oack(struct tftp_session *spt, const char *key, m->m_data += sizeof(struct udpiphdr); tp->tp_op = htons(TFTP_OACK); - n += snprintf(tp->x.tp_buf + n, sizeof(tp->x.tp_buf) - n, "%s", key) + 1; - n += snprintf(tp->x.tp_buf + n, sizeof(tp->x.tp_buf) - n, "%u", value) + 1; + n += snprintf((char *)tp->x.tp_buf + n, sizeof(tp->x.tp_buf) - n, "%s", + key) + + 1; + n += snprintf((char *)tp->x.tp_buf + n, sizeof(tp->x.tp_buf) - n, "%u", + value) + + 1; saddr.sin_addr = recv_tp->ip.ip_dst; saddr.sin_port = recv_tp->udp.uh_dport; @@ -187,7 +191,7 @@ static int tftp_send_error(struct tftp_session *spt, u_int16_t errorcode, tp->tp_op = htons(TFTP_ERROR); tp->x.tp_error.tp_error_code = htons(errorcode); - pstrcpy(tp->x.tp_error.tp_msg, sizeof(tp->x.tp_error.tp_msg), msg); + pstrcpy((char *)tp->x.tp_error.tp_msg, sizeof(tp->x.tp_error.tp_msg), msg); saddr.sin_addr = recv_tp->ip.ip_dst; saddr.sin_port = recv_tp->udp.uh_dport; @@ -319,8 +323,8 @@ static void tftp_handle_rrq(struct tftp_t *tp, int pktlen) /* do sanity checks on the filename */ if ((spt->filename[0] != '/') || - (spt->filename[strlen(spt->filename) - 1] == '/') || - strstr(spt->filename, "/../")) { + (spt->filename[strlen((char *)spt->filename) - 1] == '/') || + strstr((char *)spt->filename, "/../")) { tftp_send_error(spt, 2, "Access violation", tp); return; } @@ -347,7 +351,7 @@ static void tftp_handle_rrq(struct tftp_t *tp, int pktlen) while (k < n) { const char *key, *value; - key = src + k; + key = (char *)src + k; k += strlen(key) + 1; if (k >= n) { @@ -355,7 +359,7 @@ static void tftp_handle_rrq(struct tftp_t *tp, int pktlen) return; } - value = src + k; + value = (char *)src + k; k += strlen(value) + 1; if (strcmp(key, "tsize") == 0) { |