corrected a few mistakes that caused compiler warnings on 64bit hosts

This commit is contained in:
Gerhard Rieger 2008-05-22 20:09:48 +02:00
parent d086001911
commit c4751d50ec
5 changed files with 10 additions and 8 deletions

View file

@ -7,6 +7,8 @@ corrections:
RECVFROM addresses with FORK option hung after processing the first RECVFROM addresses with FORK option hung after processing the first
packet. packet.
corrected a few mistakes that caused compiler warnings on 64bit hosts
####################### V 1.6.0.1: ####################### V 1.6.0.1:
new features: new features:

View file

@ -1 +1 @@
"1.6.0.1+ip4bind+recvfromfork" "1.6.0.1+ip4bind+recvfromfork+x64"

View file

@ -1,5 +1,5 @@
/* source: error.c */ /* source: error.c */
/* Copyright Gerhard Rieger 2001-2007 */ /* Copyright Gerhard Rieger 2001-2008 */
/* Published under the GNU General Public License V.2, see file COPYING */ /* Published under the GNU General Public License V.2, see file COPYING */
/* the logging subsystem */ /* the logging subsystem */
@ -100,7 +100,7 @@ void diag_set(char what, const char *arg) {
sizeof(facilitynames)/sizeof(struct wordent))) == NULL) { sizeof(facilitynames)/sizeof(struct wordent))) == NULL) {
Error1("unknown syslog facility \"%s\"", arg); Error1("unknown syslog facility \"%s\"", arg);
} else { } else {
diagopts.logfacility = (int)keywd->desc; diagopts.logfacility = (int)(size_t)keywd->desc;
} }
} }
openlog(diagopts.progname, LOG_PID, diagopts.logfacility); openlog(diagopts.progname, LOG_PID, diagopts.logfacility);

View file

@ -20,7 +20,7 @@ int procan_cdefs(FILE *outfile) {
fprintf(outfile, "#define FD_SETSIZE %u\n", FD_SETSIZE); fprintf(outfile, "#define FD_SETSIZE %u\n", FD_SETSIZE);
#endif #endif
#ifdef NFDBITS #ifdef NFDBITS
fprintf(outfile, "#define NFDBITS %u\n", NFDBITS); fprintf(outfile, "#define NFDBITS %u\n", (unsigned int)NFDBITS);
#endif #endif
#ifdef O_RDONLY #ifdef O_RDONLY
fprintf(outfile, "#define O_RDONLY %u\n", O_RDONLY); fprintf(outfile, "#define O_RDONLY %u\n", O_RDONLY);

View file

@ -2030,7 +2030,7 @@ int parseopts_table(const char **a, unsigned int groups, struct opt **opts,
#if WITH_IP4 #if WITH_IP4
case TYPE_IP4NAME: case TYPE_IP4NAME:
{ {
struct sockaddr_in sa; size_t salen = sizeof(sa); struct sockaddr_in sa; socklen_t salen = sizeof(sa);
const char *ends[] = { NULL }; const char *ends[] = { NULL };
const char *nests[] = { "[","]", NULL }; const char *nests[] = { "[","]", NULL };
char buff[512], *buffp=buff; size_t bufspc = sizeof(buff)-1; char buff[512], *buffp=buff; size_t bufspc = sizeof(buff)-1;
@ -3515,9 +3515,9 @@ mc:ifname|ifind
mc:addr mc:addr
*/ */
union sockaddr_union sockaddr1; union sockaddr_union sockaddr1;
size_t socklen1 = sizeof(sockaddr1.ip4); socklen_t socklen1 = sizeof(sockaddr1.ip4);
union sockaddr_union sockaddr2; union sockaddr_union sockaddr2;
size_t socklen2 = sizeof(sockaddr2.ip4); socklen_t socklen2 = sizeof(sockaddr2.ip4);
/* first parameter is alway multicast address */ /* first parameter is alway multicast address */
/*! result */ /*! result */
@ -3613,7 +3613,7 @@ mc:addr
{ {
struct ipv6_mreq ip6_mreq = {{{{0}}}}; struct ipv6_mreq ip6_mreq = {{{{0}}}};
union sockaddr_union sockaddr1; union sockaddr_union sockaddr1;
size_t socklen1 = sizeof(sockaddr1.ip6); socklen_t socklen1 = sizeof(sockaddr1.ip6);
/* always two parameters */ /* always two parameters */
/* first parameter is multicast address */ /* first parameter is multicast address */