INET: fix a few GCC compilation warnings

This commit is contained in:
Thomas Veerman 2012-01-31 15:43:00 +00:00
parent 71634240a0
commit 224a0f6e90
6 changed files with 20 additions and 10 deletions

View file

@ -15,10 +15,14 @@ SRCS= buf.c clock.c inet.c inet_config.c \
DPADD+= ${LIBCHARDRIVER} ${LIBSYS} ${LIBMINIXUTIL} DPADD+= ${LIBCHARDRIVER} ${LIBSYS} ${LIBMINIXUTIL}
LDADD+= -lchardriver -lsys -lminixutil LDADD+= -lchardriver -lsys -lminixutil
.if ${COMPILER_TYPE} == "gnu"
LDADD+= -lc
.endif
MAN= MAN=
BINDIR?= /usr/sbin BINDIR?= /usr/sbin
CPPFLAGS+= -I${.CURDIR} -D_MINIX CPPFLAGS+= -I${.CURDIR} -D_MINIX -Wall -Werror
.include <minix.service.mk> .include <minix.service.mk>

View file

@ -227,9 +227,8 @@ int bf_linkcheck ARGS(( acc_t *acc ));
* the underlying buffer. * the underlying buffer.
*/ */
#define ptr2acc_data(/* acc_t * */ a) (bf_temporary_acc=(a), \ #define ptr2acc_data(/* acc_t * */ a) (&((acc_t *)(a))->acc_buffer-> \
(&bf_temporary_acc->acc_buffer->buf_data_p[bf_temporary_acc-> \ buf_data_p[((acc_t *)(a))->acc_offset])
acc_offset]))
#define bf_chkbuf(buf) ((buf)? (compare((buf)->acc_linkC,>,0), \ #define bf_chkbuf(buf) ((buf)? (compare((buf)->acc_linkC,>,0), \
compare((buf)->acc_buffer, !=, 0), \ compare((buf)->acc_buffer, !=, 0), \

View file

@ -213,7 +213,7 @@ SYN-SENT:
if (tcp_hdr_flags & THF_ACK) if (tcp_hdr_flags & THF_ACK)
{ {
if (tcp_LEmod4G(seg_ack, tcp_conn->tc_ISS) || if (tcp_LEmod4G(seg_ack, tcp_conn->tc_ISS) ||
tcp_Gmod4G(seg_ack, tcp_conn->tc_SND_NXT)) tcp_Gmod4G(seg_ack, tcp_conn->tc_SND_NXT)) {
if (tcp_hdr_flags & THF_RST) if (tcp_hdr_flags & THF_RST)
break; break;
else else
@ -227,6 +227,7 @@ SYN-SENT:
tcp_conn_write(tcp_conn, 1); tcp_conn_write(tcp_conn, 1);
break; break;
} }
}
acceptable_ACK= (tcp_LEmod4G(tcp_conn->tc_SND_UNA, acceptable_ACK= (tcp_LEmod4G(tcp_conn->tc_SND_UNA,
seg_ack) && tcp_LEmod4G(seg_ack, seg_ack) && tcp_LEmod4G(seg_ack,
tcp_conn->tc_SND_NXT)); tcp_conn->tc_SND_NXT));

View file

@ -874,11 +874,12 @@ udp_fd_t *udp_fd;
result= (*udp_fd->uf_put_userdata)(udp_fd->uf_srfd, result= (*udp_fd->uf_put_userdata)(udp_fd->uf_srfd,
(size_t)0, pack, FALSE); (size_t)0, pack, FALSE);
if (result >= 0) if (result >= 0) {
if (size > transf_size) if (size > transf_size)
result= EPACKSIZE; result= EPACKSIZE;
else else
result= transf_size; result= transf_size;
}
udp_fd->uf_flags &= ~UFF_READ_IP; udp_fd->uf_flags &= ~UFF_READ_IP;
result= (*udp_fd->uf_put_userdata)(udp_fd->uf_srfd, result, result= (*udp_fd->uf_put_userdata)(udp_fd->uf_srfd, result,

View file

@ -247,7 +247,7 @@ static unsigned number(char *str, unsigned max)
void read_conf(void) void read_conf(void)
{ {
int i, j, ifno, type, port, enable; int i, j, ifno = -1, type = -1, port = -1, enable;
struct eth_conf *ecp; struct eth_conf *ecp;
struct psip_conf *pcp; struct psip_conf *pcp;
struct ip_conf *icp; struct ip_conf *icp;
@ -304,8 +304,7 @@ void read_conf(void)
} }
ecp++; ecp++;
eth_conf_nr++; eth_conf_nr++;
} else } else if (strncmp(word, "psip", 4) == 0) {
if (strncmp(word, "psip", 4) == 0) {
pcp->pc_ifno= ifno= number(word+4, IP_PORT_MAX-1); pcp->pc_ifno= ifno= number(word+4, IP_PORT_MAX-1);
type= NETTYPE_PSIP; type= NETTYPE_PSIP;
port= psip_conf_nr; port= psip_conf_nr;
@ -315,6 +314,12 @@ void read_conf(void)
printf("inet: Unknown device '%s'\n", word); printf("inet: Unknown device '%s'\n", word);
error(); error();
} }
if (type == -1 || ifno == -1 || port == -1) {
printf("inet: faulty configuration\n");
exit(1);
}
iftype[ifno]= type; iftype[ifno]= type;
icp->ic_ifno= ifno; icp->ic_ifno= ifno;
icp->ic_devtype= type; icp->ic_devtype= type;

View file

@ -118,7 +118,7 @@ PUBLIC void sr_rec(m)
mq_t *m; mq_t *m;
{ {
int result; int result;
int send_reply, free_mess; int send_reply = 0, free_mess = 0;
if (repl_queue) if (repl_queue)
{ {