]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
lib/utils: make local functions static
authorStephen Hemminger <stephen@networkplumber.org>
Thu, 15 Nov 2018 22:36:20 +0000 (14:36 -0800)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 19 Nov 2018 19:42:44 +0000 (11:42 -0800)
Some of the print/parsing is only used internally.
Drop unused get_s8/get_s16.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
include/utils.h
lib/utils.c

index bf6dea23df66978da960a427335d99b932b3fc6d..1630dd0b28540c87fb285c51a9197f246301b630 100644 (file)
@@ -157,9 +157,7 @@ int get_u64(__u64 *val, const char *arg, int base);
 int get_u32(__u32 *val, const char *arg, int base);
 int get_s32(__s32 *val, const char *arg, int base);
 int get_u16(__u16 *val, const char *arg, int base);
-int get_s16(__s16 *val, const char *arg, int base);
 int get_u8(__u8 *val, const char *arg, int base);
-int get_s8(__s8 *val, const char *arg, int base);
 int get_be64(__be64 *val, const char *arg, int base);
 int get_be32(__be32 *val, const char *arg, int base);
 int get_be16(__be16 *val, const char *arg, int base);
@@ -172,7 +170,6 @@ __u8 *hexstring_a2n(const char *str, __u8 *buf, int blen, unsigned int *len);
 int addr64_n2a(__u64 addr, char *buff, size_t len);
 
 int af_bit_len(int af);
-int af_byte_len(int af);
 
 const char *format_host_r(int af, int len, const void *addr,
                               char *buf, int buflen);
@@ -326,8 +323,6 @@ void drop_cap(void);
 
 int get_time(unsigned int *time, const char *str);
 int get_time64(__s64 *time, const char *str);
-void print_time(char *buf, int len, __u32 time);
-void print_time64(char *buf, int len, __s64 time);
 char *sprint_time(__u32 time, char *buf);
 char *sprint_time64(__s64 time, char *buf);
 
index 345630d04929dbe82a82fb19721b9ea36695993a..4965a575088079916a2dc6319badfdd6db6f8479 100644 (file)
@@ -45,6 +45,10 @@ int timestamp_short;
 int pretty;
 const char *_SL_ = "\n";
 
+static int af_byte_len(int af);
+static void print_time(char *buf, int len, __u32 time);
+static void print_time64(char *buf, int len, __s64 time);
+
 int read_prop(const char *dev, char *prop, long *value)
 {
        char fname[128], buf[80], *endp, *nl;
@@ -426,43 +430,6 @@ int get_s32(__s32 *val, const char *arg, int base)
        return 0;
 }
 
-int get_s16(__s16 *val, const char *arg, int base)
-{
-       long res;
-       char *ptr;
-
-       if (!arg || !*arg)
-               return -1;
-       res = strtol(arg, &ptr, base);
-       if (!ptr || ptr == arg || *ptr)
-               return -1;
-       if ((res == LONG_MIN || res == LONG_MAX) && errno == ERANGE)
-               return -1;
-       if (res > 0x7FFF || res < -0x8000)
-               return -1;
-
-       *val = res;
-       return 0;
-}
-
-int get_s8(__s8 *val, const char *arg, int base)
-{
-       long res;
-       char *ptr;
-
-       if (!arg || !*arg)
-               return -1;
-       res = strtol(arg, &ptr, base);
-       if (!ptr || ptr == arg || *ptr)
-               return -1;
-       if ((res == LONG_MIN || res == LONG_MAX) && errno == ERANGE)
-               return -1;
-       if (res > 0x7F || res < -0x80)
-               return -1;
-       *val = res;
-       return 0;
-}
-
 int get_be64(__be64 *val, const char *arg, int base)
 {
        __u64 v;
@@ -708,7 +675,7 @@ int af_bit_len(int af)
        return 0;
 }
 
-int af_byte_len(int af)
+static int af_byte_len(int af)
 {
        return af_bit_len(af) / 8;
 }
@@ -1710,8 +1677,7 @@ int get_time(unsigned int *time, const char *str)
        return 0;
 }
 
-
-void print_time(char *buf, int len, __u32 time)
+static void print_time(char *buf, int len, __u32 time)
 {
        double tmp = time;
 
@@ -1764,7 +1730,7 @@ int get_time64(__s64 *time, const char *str)
        return 0;
 }
 
-void print_time64(char *buf, int len, __s64 time)
+static void print_time64(char *buf, int len, __s64 time)
 {
        double nsec = time;