]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Quash a load of compile warnings
authorkevin lyda <kevin@ie.suberic.net>
Fri, 14 Apr 2006 16:48:43 +0000 (17:48 +0100)
committerRichard P. Curnow <rc@rc0.org.uk>
Fri, 14 Apr 2006 23:31:29 +0000 (00:31 +0100)
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.

acquire.c
client.c
cmdmon.c
logging.c
logging.h
main.c
main.h
nameserv.c
ntp_core.c
ntp_io.c

index 0e3f2d2a355e2cb545c54d291e21cc96645d089d..94b4e61acf4e0fe5007e52fcf02806013d91d818 100644 (file)
--- 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;
index 424877c731ba0a2a3ee9061d8a49415caa310ed5..a5c441501d1e74cdc01ca4a9c479ff7fb0b0803a 100644 (file)
--- 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;
index c039c83c8cd59c98ed831506f2011e17afa74dd7..e88d7c363e7bdbd09a041aa85d32037e38ae596f 100644 (file)
--- 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;
index e5438e66bdd9d6c8bb96a0c45a50e962a21336ed..d432762f0cebcea7e7debc3113a66ce0561d1d14 100644 (file)
--- 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];
index 33a792dc1cbeea96d89dd3b98f68bbf2a153046c..6e73dbb6abf5c0778c3d506e8fa0b9f343a32f95 100644 (file)
--- 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 09b87d509bcf45113a428eb93c636436d2c56fa8..18312e02868cb00f3d16ade36688313b4dc923d8 100644 (file)
--- 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 aaf071a16f61282f160622cb15ba7a589b91e610..4bbaf1de6a79804674575159375017d796618d0d 100644 (file)
--- 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 */
 
index f509dfb3cb4ae3a9fceb08285787af7e6f2d2671..e57a610b3e653b03d319c3b4d411a1079561a3e8 100644 (file)
@@ -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);
index 6c18787d0ab2789c520ac61406da8c45b4b65f90..f21065ddd7ae3e48c5811687de168d8ec391f173 100644 (file)
@@ -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)) {
index 81b0230deb87cbf31033195b7339fca682b3348d..fb765dd97bc3bb0d451cfacd03c23895329e9a2d 100644 (file)
--- 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;