From: Matthew Mondor Date: Sat, 27 Aug 2016 15:47:46 +0000 (+0000) Subject: ANSI and 64-bit related cleanup - format arguments X-Git-Tag: rubiks-ircd-1-0-6~4 X-Git-Url: http://git.pulsar-zone.net/?a=commitdiff_plain;h=980c6c7ffb559f294ec8efb5c624d16e453fa149;p=rubiks-ircd.git ANSI and 64-bit related cleanup - format arguments Code was built with -Werror=format-extra-args -Werror=format= and breaking cases fixed. --- diff --git a/TODO b/TODO index b3c494c..406ed2d 100644 --- a/TODO +++ b/TODO @@ -1,8 +1,7 @@ ANSI fixes ---------- -- Fix any function arg mismatch (use -Werror=) (too many arg) -- Fix format argument related warnings +- Build with -Werror=maybe-uninitialized - Recheck warnings with -Wall Future TODO List diff --git a/src/ircd.c b/src/ircd.c index 319caca..bfadb30 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -26,11 +26,13 @@ #include "numeric.h" #include "msg.h" #include "sbuf.h" +#include #include #include #include #include #include +#include #include #include #include @@ -214,7 +216,7 @@ void restart(char *mesg) was_here = YES; #ifdef USE_SYSLOG - (void) syslog(LOG_WARNING, "Restarting Server because: %s, sbrk(0)-etext: %lld", + (void) syslog(LOG_WARNING, "Restarting Server because: %s, sbrk(0)-etext: %ld", mesg, (intptr_t)sbrk((size_t)0) - (intptr_t)sbrk0); #endif server_reboot(); @@ -1016,8 +1018,9 @@ void io_loop() if (timeofday < lasttimeofday) { - ircsprintf(to_send, "System clock running backwards - (%d < %d)", - timeofday, lasttimeofday); + ircsprintf(to_send, "System clock running backwards - (%" PRIu64 + " < %" PRIu64 ")", + (uint64_t)timeofday, (uint64_t)lasttimeofday); report_error(to_send, &me); } diff --git a/src/m_rwho.c b/src/m_rwho.c index 594a3a8..061822e 100644 --- a/src/m_rwho.c +++ b/src/m_rwho.c @@ -1045,7 +1045,7 @@ static void rwho_reply(aClient *cptr, aClient *ac, char *buf, chanMember *cm) dst += ircsprintf(dst, " %d", rwho_opts.thismatches); if (rwho_opts.rplfields & RWO_TS) - dst += ircsprintf(dst, " %d", ac->tsinfo); + dst += ircsprintf(dst, " %ld", (long)ac->tsinfo); if (rwho_opts.rplfields & RWO_STYPE) dst += ircsprintf(dst, " %d", ac->user->servicetype); diff --git a/src/s_bsd.c b/src/s_bsd.c index db816b6..12bf7b1 100644 --- a/src/s_bsd.c +++ b/src/s_bsd.c @@ -1062,7 +1062,7 @@ static void set_sock_opts(int fd, aClient * cptr) else if (optlen > 0) { for (*readbuf = '\0'; optlen > 0; optlen--, s += 3) - ircsprintf(s, "%02.2x:", *t++); + ircsprintf(s, "%02x:", *t++); *s = '\0'; sendto_realops("Connection %s using IP opts: (%s)", get_client_name(cptr, HIDEME), readbuf); diff --git a/src/throttle.c b/src/throttle.c index cc5f52e..d239e20 100644 --- a/src/throttle.c +++ b/src/throttle.c @@ -480,8 +480,7 @@ throttle_check(char *host, int fd, time_t sotime) /* We steal this message from undernet, because mIRC detects it * and doesn't try to autoreconnect */ elength = ircsnprintf(errbufr, 512, "ERROR :Your host is trying " - "to (re)connect too fast -- throttled.\r\n", - tp->addr); + "to (re)connect too fast -- throttled.\r\n"); send(fd, errbufr, elength, 0); tp->zline_start = sotime;