From: kevin lyda Date: Fri, 14 Apr 2006 16:48:43 +0000 (+0100) Subject: Quash a load of compile warnings X-Git-Tag: mandriva-1.22~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a30c56f0335c417a5461db244753dde6c5e82e0;p=thirdparty%2Fchrony.git Quash a load of compile warnings Kevin Lyda writes: I enclose the following patch which removes all but three of the warnings. i don't have any non-linux systems handy to test a fix to the round() function. but having it return a double should be fine. It doesn't actually fix anything, it just shuts up -Wall, so it's certainly an optional type of patch. --- diff --git a/acquire.c b/acquire.c index 0e3f2d2a..94b4e61a 100644 --- a/acquire.c +++ b/acquire.c @@ -358,7 +358,7 @@ read_from_socket(void *anything) int status; ReceiveBuffer msg; struct sockaddr_in his_addr; - int his_addr_len; + socklen_t his_addr_len; int flags; int message_length; unsigned long remote_ip; diff --git a/client.c b/client.c index 424877c7..a5c44150 100644 --- a/client.c +++ b/client.c @@ -146,7 +146,7 @@ read_line(void) static unsigned long get_address(const char *hostname) { - unsigned char *address0; + char *address0; struct hostent *host; unsigned long result; @@ -746,7 +746,7 @@ static int accheck_getaddr(char *line, unsigned long *addr) { unsigned long a, b, c, d, ip; - unsigned char *p, *q; + char *p, *q; p = line; while (*p && isspace(*p)) p++; if (!*p) { @@ -1124,7 +1124,7 @@ static int submit_request(CMD_Request *request, CMD_Reply *reply, int *reply_auth_ok) { unsigned long tx_sequence; - int where_from_len; + socklen_t where_from_len; struct sockaddr_in where_from; int bad_length, bad_sender, bad_sequence, bad_header; int select_status; diff --git a/cmdmon.c b/cmdmon.c index c039c83c..e88d7c36 100644 --- a/cmdmon.c +++ b/cmdmon.c @@ -1584,7 +1584,7 @@ read_from_cmd_socket(void *anything) CMD_Reply tx_message, *prev_tx_message; int rx_message_length, tx_message_length; struct sockaddr_in where_from; - int from_length; + socklen_t from_length; unsigned long remote_ip; unsigned short remote_port; int md5_ok; diff --git a/logging.c b/logging.c index e5438e66..d432762f 100644 --- a/logging.c +++ b/logging.c @@ -116,7 +116,7 @@ LOG_Line_Function(LOG_Severity severity, LOG_Facility facility, const char *form /* ================================================== */ -volatile void +void LOG_Fatal_Function(LOG_Facility facility, const char *format, ...) { char buf[2048]; diff --git a/logging.h b/logging.h index 33a792dc..6e73dbb6 100644 --- a/logging.h +++ b/logging.h @@ -77,7 +77,7 @@ extern void LOG_Finalise(void); extern void LOG_Line_Function(LOG_Severity severity, LOG_Facility facility, const char *format, ...); /* Logging function for fatal errors */ -extern volatile void LOG_Fatal_Function(LOG_Facility facility, const char *format, ...); +extern void LOG_Fatal_Function(LOG_Facility facility, const char *format, ...); /* Position in code reporting function */ extern void LOG_Position(const char *filename, int line_number, const char *function_name); diff --git a/main.c b/main.c index 09b87d50..18312e02 100644 --- a/main.c +++ b/main.c @@ -74,7 +74,7 @@ delete_pidfile(void) /* ================================================== */ -volatile void +void MAI_CleanupAndExit(void) { if (!initialised) exit(0); diff --git a/main.h b/main.h index aaf071a1..4bbaf1de 100644 --- a/main.h +++ b/main.h @@ -32,7 +32,7 @@ #define GOT_MAIN_H /* Function to clean up at end of run */ -extern volatile void MAI_CleanupAndExit(void); +extern void MAI_CleanupAndExit(void); #endif /* GOT_MAIN_H */ diff --git a/nameserv.c b/nameserv.c index f509dfb3..e57a610b 100644 --- a/nameserv.c +++ b/nameserv.c @@ -39,7 +39,7 @@ unsigned long DNS_Name2IPAddress(const char *name) { struct hostent *host; - unsigned char *address0; + char *address0; unsigned long result; host = gethostbyname(name); diff --git a/ntp_core.c b/ntp_core.c index 6c18787d..f21065dd 100644 --- a/ntp_core.c +++ b/ntp_core.c @@ -378,7 +378,7 @@ generate_packet_auth(NTP_Packet *pkt, unsigned long keyid) if (keyok) { pkt->auth_keyid = htonl(keyid); MD5Init(&ctx); - MD5Update(&ctx, keytext, keylen); + MD5Update(&ctx, (unsigned char *) keytext, keylen); MD5Update(&ctx, (unsigned char *) pkt, offsetof(NTP_Packet, auth_keyid)); MD5Final(&ctx); memcpy(&(pkt->auth_data), &ctx.digest, 16); @@ -447,7 +447,7 @@ check_packet_auth(NTP_Packet *pkt, unsigned long keyid) if (keyok) { pkt->auth_keyid = htonl(keyid); MD5Init(&ctx); - MD5Update(&ctx, keytext, keylen); + MD5Update(&ctx, (unsigned char *) keytext, keylen); MD5Update(&ctx, (unsigned char *) pkt, offsetof(NTP_Packet, auth_keyid)); MD5Final(&ctx); if (!memcmp((void *) &ctx.digest, (void *) &(pkt->auth_data), 16)) { diff --git a/ntp_io.c b/ntp_io.c index 81b0230d..fb765dd9 100644 --- a/ntp_io.c +++ b/ntp_io.c @@ -184,7 +184,7 @@ read_from_socket(void *anything) ReceiveBuffer message; int message_length; struct sockaddr_in where_from; - int from_length; + socklen_t from_length; unsigned int flags = 0; struct timeval now; NTP_Remote_Address remote_addr;