diff --git a/ChangeLog b/ChangeLog index 05d37dc4a..39284fdb3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20000408 + - Avoid some compiler warnings in fake-get*.c + - Add IPTOS macros for systems which lack them + 20000406 - OpenBSD CVS update: - [channels.c] diff --git a/defines.h b/defines.h index b22d703f5..f8a23b88d 100644 --- a/defines.h +++ b/defines.h @@ -9,6 +9,8 @@ #include /* For IPv6 macros */ +#include /* For IPTOS macros */ + #ifdef HAVE_SYS_BITYPES_H # include /* For u_intXX_t */ #endif @@ -55,6 +57,14 @@ enum # define SHUT_RDWR SHUT_RDWR #endif +#ifndef IPTOS_LOWDELAY +# define IPTOS_LOWDELAY 0x10 +# define IPTOS_THROUGHPUT 0x08 +# define IPTOS_RELIABILITY 0x04 +# define IPTOS_LOWCOST 0x02 +# define IPTOS_MINCOST IPTOS_LOWCOST +#endif /* IPTOS_LOWDELAY */ + /* Types */ /* If sys/types.h does not supply intXX_t, supply them ourselves */ diff --git a/entropy.c b/entropy.c index 94e7dcec1..f304e21c1 100644 --- a/entropy.c +++ b/entropy.c @@ -41,7 +41,7 @@ # include #endif -RCSID("$Id: entropy.c,v 1.3 2000/04/04 05:04:10 damien Exp $"); +RCSID("$Id: entropy.c,v 1.4 2000/04/08 07:48:56 damien Exp $"); #ifdef EGD_SOCKET #ifndef offsetof @@ -198,7 +198,6 @@ entropy_source_t entropy_sources[] = { { 0.000, NULL, { NULL, NULL, NULL, NULL, NULL } }, }; - double stir_from_system(void) { diff --git a/fake-getaddrinfo.c b/fake-getaddrinfo.c index b918798c4..456c41e58 100644 --- a/fake-getaddrinfo.c +++ b/fake-getaddrinfo.c @@ -41,7 +41,7 @@ struct addrinfo *ai; do { next = ai->ai_next; free(ai); - } while (ai = next); + } while (NULL != (ai = next)); } #endif /* !HAVE_FREEADDRINFO */ @@ -53,8 +53,8 @@ u_long addr; { struct addrinfo *ai; - if (ai = (struct addrinfo *)malloc(sizeof(struct addrinfo) + - sizeof(struct sockaddr_in))) { + if (NULL != (ai = (struct addrinfo *)malloc(sizeof(struct addrinfo) + + sizeof(struct sockaddr_in)))) { memset(ai, 0, sizeof(struct addrinfo) + sizeof(struct sockaddr_in)); ai->ai_addr = (struct sockaddr *)(ai + 1); /* XXX -- ssh doesn't use sa_len */ @@ -83,25 +83,25 @@ struct addrinfo **res; else port = 0; if (hints && hints->ai_flags & AI_PASSIVE) - if (*res = malloc_ai(port, htonl(0x00000000))) + if (NULL != (*res = malloc_ai(port, htonl(0x00000000)))) return 0; else return EAI_MEMORY; if (!hostname) - if (*res = malloc_ai(port, htonl(0x7f000001))) + if (NULL != (*res = malloc_ai(port, htonl(0x7f000001)))) return 0; else return EAI_MEMORY; if (inet_addr(hostname) != -1) - if (*res = malloc_ai(port, inet_addr(hostname))) + if (NULL != (*res = malloc_ai(port, inet_addr(hostname)))) return 0; else return EAI_MEMORY; if ((hp = gethostbyname(hostname)) && hp->h_name && hp->h_name[0] && hp->h_addr_list[0]) { for (i = 0; hp->h_addr_list[i]; i++) - if (cur = malloc_ai(port, - ((struct in_addr *)hp->h_addr_list[i])->s_addr)) { + if (NULL != (cur = malloc_ai(port, + ((struct in_addr *)hp->h_addr_list[i])->s_addr))) { if (prev) prev->ai_next = cur; else diff --git a/fake-getnameinfo.c b/fake-getnameinfo.c index bf1184e24..f74f3128f 100644 --- a/fake-getnameinfo.c +++ b/fake-getnameinfo.c @@ -46,8 +46,8 @@ int flags; return 0; } else - if (hp = gethostbyaddr((char *)&sin->sin_addr, sizeof(struct in_addr), - AF_INET)) + if (NULL != (hp = gethostbyaddr((char *)&sin->sin_addr, + sizeof(struct in_addr), AF_INET))) if (strlen(hp->h_name) > hostlen) return EAI_MEMORY; else {