From: Dave Hart Date: Wed, 18 Apr 2012 05:03:10 +0000 (+0000) Subject: Remove inttoa() and uinttoa(), convert solitary use of latter X-Git-Tag: NTP_4_2_7P273~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce56bf734e1c9edbade016f30969780797650272;p=thirdparty%2Fntp.git Remove inttoa() and uinttoa(), convert solitary use of latter to simpler code. bk: 4f8e4b0eM-Ud6xQn229JAhqlBZ7JaQ --- diff --git a/include/ntp_stdlib.h b/include/ntp_stdlib.h index 4f31c9d3a..9c4215cb3 100644 --- a/include/ntp_stdlib.h +++ b/include/ntp_stdlib.h @@ -153,7 +153,6 @@ extern int atouint (const char *, u_long *); extern int hextoint (const char *, u_long *); extern char * humanlogtime (void); extern char * humantime (time_t); -extern char * inttoa (long); extern char * mfptoa (u_int32, u_int32, short); extern char * mfptoms (u_int32, u_int32, short); extern const char * modetoa (int); @@ -177,7 +176,6 @@ extern int octtoint (const char *, u_long *); extern u_long ranp2 (int); extern const char *refnumtoa (sockaddr_u *); extern const char *refid_str (u_int32, int); -extern char * uinttoa (u_long); extern int decodenetnum (const char *, sockaddr_u *); diff --git a/libntp/Makefile.am b/libntp/Makefile.am index 970f48ae7..9a25fd23a 100644 --- a/libntp/Makefile.am +++ b/libntp/Makefile.am @@ -66,7 +66,6 @@ libntp_a_SRCS = \ hextolfp.c \ humandate.c \ icom.c \ - inttoa.c \ iosignal.c \ lib_strbuf.c \ machines.c \ @@ -100,7 +99,6 @@ libntp_a_SRCS = \ timetoa.c \ timevalops.c \ uglydate.c \ - uinttoa.c \ work_fork.c \ work_thread.c \ ymd2yd.c \ diff --git a/libntp/inttoa.c b/libntp/inttoa.c deleted file mode 100644 index f34710e1c..000000000 --- a/libntp/inttoa.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * inttoa - return an asciized signed integer - */ -#include -#include - -#include "lib_strbuf.h" -#include "ntp_stdlib.h" - -char * -inttoa( - long val - ) -{ - register char *buf; - - LIB_GETBUF(buf); - snprintf(buf, LIB_BUFLENGTH, "%ld", val); - - return buf; -} diff --git a/libntp/uinttoa.c b/libntp/uinttoa.c deleted file mode 100644 index f1925f4bf..000000000 --- a/libntp/uinttoa.c +++ /dev/null @@ -1,21 +0,0 @@ -/* - * uinttoa - return an asciized unsigned integer - */ -#include -#include - -#include "lib_strbuf.h" -#include "ntp_stdlib.h" - -char * -uinttoa( - u_long uval - ) -{ - register char *buf; - - LIB_GETBUF(buf); - snprintf(buf, LIB_BUFLENGTH, "%lu", uval); - - return buf; -} diff --git a/ntpq/ntpq-subs.c b/ntpq/ntpq-subs.c index d11d5db66..2297d3132 100644 --- a/ntpq/ntpq-subs.c +++ b/ntpq/ntpq-subs.c @@ -1126,7 +1126,6 @@ printassoc( const char *auth; const char *condition = ""; const char *last_event; - const char *cnt; char buf[128]; if (numassoc == 0) { @@ -1281,12 +1280,11 @@ printassoc( last_event = ""; break; } - cnt = uinttoa(event_count); snprintf(buf, sizeof(buf), - "%3d %5u %04x %3.3s %4s %4.4s %9.9s %11s %2s", + "%3d %5u %04x %3.3s %4s %4.4s %9.9s %11s %2lu", i + 1, assoc_cache[i].assid, assoc_cache[i].status, conf, reach, auth, - condition, last_event, cnt); + condition, last_event, event_count); bp = buf + strlen(buf); while (bp > buf && ' ' == bp[-1]) --bp; diff --git a/ports/winnt/vs2005/libntp.vcproj b/ports/winnt/vs2005/libntp.vcproj index c998cc842..26d51d2f8 100644 --- a/ports/winnt/vs2005/libntp.vcproj +++ b/ports/winnt/vs2005/libntp.vcproj @@ -308,10 +308,6 @@ RelativePath="..\..\..\lib\isc\win32\interfaceiter.c" > - - @@ -528,10 +524,6 @@ RelativePath="..\..\..\libntp\uglydate.c" > - - diff --git a/ports/winnt/vs2008/libntp/libntp.vcproj b/ports/winnt/vs2008/libntp/libntp.vcproj index 74c1969b9..37e301bed 100644 --- a/ports/winnt/vs2008/libntp/libntp.vcproj +++ b/ports/winnt/vs2008/libntp/libntp.vcproj @@ -323,10 +323,6 @@ RelativePath="..\..\..\..\lib\isc\win32\interfaceiter.c" > - - @@ -547,10 +543,6 @@ RelativePath="..\..\..\..\libntp\uglydate.c" > - - @@ -865,11 +857,11 @@ >