From: millert Date: Sat, 22 Sep 2018 17:10:28 +0000 (+0000) Subject: Remove unused Table_size define and digits() function. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=ead56677727cb56e8d7e8531b39034c028e6b4aa;p=openbsd Remove unused Table_size define and digits() function. --- diff --git a/usr.bin/top/top.local.h b/usr.bin/top/top.local.h index f13a8ace66b..93f4abdd74b 100644 --- a/usr.bin/top/top.local.h +++ b/usr.bin/top/top.local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: top.local.h,v 1.4 2008/04/02 16:41:24 deraadt Exp $ */ +/* $OpenBSD: top.local.h,v 1.5 2018/09/22 17:10:28 millert Exp $ */ /* * Top - a top users display for Berkeley Unix @@ -20,18 +20,6 @@ #define LoadMax 5.0 #endif -/* - * "Table_size" defines the size of the hash tables used to map uid to - * username. The number of users in /etc/passwd CANNOT be greater than - * this number. If the error message "table overflow: too many users" - * is printed by top, then "Table_size" needs to be increased. Things will - * work best if the number is a prime number that is about twice the number - * of lines in /etc/passwd. - */ -#ifndef Table_size -#define Table_size 503 -#endif - /* * "Nominal_TOPN" is used as the default TOPN when Default_TOPN is Infinity * and the output is a dumb terminal. If we didn't do this, then diff --git a/usr.bin/top/utils.c b/usr.bin/top/utils.c index 29fb3d84abe..044c49b5070 100644 --- a/usr.bin/top/utils.c +++ b/usr.bin/top/utils.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utils.c,v 1.28 2018/09/22 16:50:35 millert Exp $ */ +/* $OpenBSD: utils.c,v 1.29 2018/09/22 17:10:28 millert Exp $ */ /* * Top users/processes display for Unix @@ -101,22 +101,6 @@ format_uid(uid_t uid, int nouser) return (buffer); } -/* - * digits(val) - return number of decimal digits in val. Only works for - * positive numbers. If val <= 0 then digits(val) == 0. - */ -int -digits(int val) -{ - int cnt = 0; - - while (val > 0) { - cnt++; - val /= 10; - } - return (cnt); -} - /* * string_index(string, array) - find string in array and return index */ diff --git a/usr.bin/top/utils.h b/usr.bin/top/utils.h index 09fd9a3cef0..2495dbf7d9c 100644 --- a/usr.bin/top/utils.h +++ b/usr.bin/top/utils.h @@ -1,4 +1,4 @@ -/* $OpenBSD: utils.h,v 1.10 2018/09/22 16:50:35 millert Exp $ */ +/* $OpenBSD: utils.h,v 1.11 2018/09/22 17:10:28 millert Exp $ */ /* * Top users/processes display for Unix @@ -33,7 +33,6 @@ int atoiwi(char *); char *itoa(int); const char *format_uid(uid_t, int); -int digits(int); int string_index(char *, char **); char **argparse(char *, int *); int percentages(int, int64_t *, int64_t *, int64_t *, int64_t *);