diff options
author | "Vladimir N. Oleynik" <dzo@simtreas.ru> | 2005-10-20 09:48:28 +0000 |
---|---|---|
committer | "Vladimir N. Oleynik" <dzo@simtreas.ru> | 2005-10-20 09:48:28 +0000 |
commit | 0fa9deda1706b19e5f42ed392483a582880aaca3 (patch) | |
tree | df9e0fa516715ff8d41a77aabf4ba3a899286e30 | |
parent | 5cf9a03b3f7b9feb08f4aa4fc36f036b2f00614d (diff) | |
download | busybox-w32-0fa9deda1706b19e5f42ed392483a582880aaca3.tar.gz busybox-w32-0fa9deda1706b19e5f42ed392483a582880aaca3.tar.bz2 busybox-w32-0fa9deda1706b19e5f42ed392483a582880aaca3.zip |
more const
-rw-r--r-- | libbb/interface.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/libbb/interface.c b/libbb/interface.c index 7b7d9def0..ce7d67da7 100644 --- a/libbb/interface.c +++ b/libbb/interface.c | |||
@@ -510,7 +510,7 @@ static struct aftype unspec_aftype = { | |||
510 | NULL, | 510 | NULL, |
511 | }; | 511 | }; |
512 | 512 | ||
513 | static struct aftype *aftypes[] = { | 513 | static struct aftype * const aftypes[] = { |
514 | #if HAVE_AFUNIX | 514 | #if HAVE_AFUNIX |
515 | &unix_aftype, | 515 | &unix_aftype, |
516 | #endif | 516 | #endif |
@@ -672,7 +672,7 @@ static void aftrans_def(char *tool, char *argv0, char *dflt) | |||
672 | /* Check our protocol family table for this family. */ | 672 | /* Check our protocol family table for this family. */ |
673 | static struct aftype *get_aftype(const char *name) | 673 | static struct aftype *get_aftype(const char *name) |
674 | { | 674 | { |
675 | struct aftype **afp; | 675 | struct aftype * const *afp; |
676 | 676 | ||
677 | #ifdef KEEP_UNUSED | 677 | #ifdef KEEP_UNUSED |
678 | if (!sVafinit) | 678 | if (!sVafinit) |
@@ -694,7 +694,7 @@ static struct aftype *get_aftype(const char *name) | |||
694 | /* Check our protocol family table for this family. */ | 694 | /* Check our protocol family table for this family. */ |
695 | static struct aftype *get_afntype(int af) | 695 | static struct aftype *get_afntype(int af) |
696 | { | 696 | { |
697 | struct aftype **afp; | 697 | struct aftype * const *afp; |
698 | 698 | ||
699 | #ifdef KEEP_UNUSED | 699 | #ifdef KEEP_UNUSED |
700 | if (!sVafinit) | 700 | if (!sVafinit) |
@@ -713,7 +713,7 @@ static struct aftype *get_afntype(int af) | |||
713 | /* Check our protocol family table for this family and return its socket */ | 713 | /* Check our protocol family table for this family and return its socket */ |
714 | static int get_socket_for_af(int af) | 714 | static int get_socket_for_af(int af) |
715 | { | 715 | { |
716 | struct aftype **afp; | 716 | struct aftype * const *afp; |
717 | 717 | ||
718 | #ifdef KEEP_UNUSED | 718 | #ifdef KEEP_UNUSED |
719 | if (!sVafinit) | 719 | if (!sVafinit) |
@@ -735,7 +735,7 @@ static void print_aflist(int type) | |||
735 | { | 735 | { |
736 | int count = 0; | 736 | int count = 0; |
737 | char *txt; | 737 | char *txt; |
738 | struct aftype **afp; | 738 | struct aftype * const *afp; |
739 | 739 | ||
740 | #ifdef KEEP_UNUSED | 740 | #ifdef KEEP_UNUSED |
741 | if (!sVafinit) | 741 | if (!sVafinit) |
@@ -840,7 +840,7 @@ static int skfd = -1; /* generic raw socket desc. */ | |||
840 | 840 | ||
841 | static int sockets_open(int family) | 841 | static int sockets_open(int family) |
842 | { | 842 | { |
843 | struct aftype **aft; | 843 | struct aftype * const *aft; |
844 | int sfd = -1; | 844 | int sfd = -1; |
845 | static int force = -1; | 845 | static int force = -1; |
846 | 846 | ||
@@ -889,7 +889,7 @@ static int sockets_open(int family) | |||
889 | #ifdef CONFIG_FEATURE_CLEAN_UP | 889 | #ifdef CONFIG_FEATURE_CLEAN_UP |
890 | static void sockets_close(void) | 890 | static void sockets_close(void) |
891 | { | 891 | { |
892 | struct aftype **aft; | 892 | struct aftype * const *aft; |
893 | for (aft = aftypes; *aft != NULL; aft++) { | 893 | for (aft = aftypes; *aft != NULL; aft++) { |
894 | struct aftype *af = *aft; | 894 | struct aftype *af = *aft; |
895 | if( af->fd != -1 ) { | 895 | if( af->fd != -1 ) { |
@@ -1046,13 +1046,13 @@ static char *get_name(char *name, char *p) | |||
1046 | 1046 | ||
1047 | /* Lie about the size of the int pointed to for %n. */ | 1047 | /* Lie about the size of the int pointed to for %n. */ |
1048 | #if INT_MAX == LONG_MAX | 1048 | #if INT_MAX == LONG_MAX |
1049 | static const char *ss_fmt[] = { | 1049 | static const char * const ss_fmt[] = { |
1050 | "%n%Lu%u%u%u%u%n%n%n%Lu%u%u%u%u%u", | 1050 | "%n%Lu%u%u%u%u%n%n%n%Lu%u%u%u%u%u", |
1051 | "%Lu%Lu%u%u%u%u%n%n%Lu%Lu%u%u%u%u%u", | 1051 | "%Lu%Lu%u%u%u%u%n%n%Lu%Lu%u%u%u%u%u", |
1052 | "%Lu%Lu%u%u%u%u%u%u%Lu%Lu%u%u%u%u%u%u" | 1052 | "%Lu%Lu%u%u%u%u%u%u%Lu%Lu%u%u%u%u%u%u" |
1053 | }; | 1053 | }; |
1054 | #else | 1054 | #else |
1055 | static const char *ss_fmt[] = { | 1055 | static const char * const ss_fmt[] = { |
1056 | "%n%Lu%lu%lu%lu%lu%n%n%n%Lu%lu%lu%lu%lu%lu", | 1056 | "%n%Lu%lu%lu%lu%lu%n%n%n%Lu%lu%lu%lu%lu%lu", |
1057 | "%Lu%Lu%lu%lu%lu%lu%n%n%Lu%Lu%lu%lu%lu%lu%lu", | 1057 | "%Lu%Lu%lu%lu%lu%lu%n%n%Lu%Lu%lu%lu%lu%lu%lu", |
1058 | "%Lu%Lu%lu%lu%lu%lu%lu%lu%Lu%Lu%lu%lu%lu%lu%lu%lu" | 1058 | "%Lu%Lu%lu%lu%lu%lu%lu%lu%Lu%Lu%lu%lu%lu%lu%lu%lu" |
@@ -1350,7 +1350,7 @@ static int do_if_fetch(struct interface *ife) | |||
1350 | } else { | 1350 | } else { |
1351 | errmsg = strerror(errno); | 1351 | errmsg = strerror(errno); |
1352 | } | 1352 | } |
1353 | bb_error_msg(_("%s: error fetching interface information: %s\n"), | 1353 | bb_error_msg(_("%s: error fetching interface information: %s"), |
1354 | ife->name, errmsg); | 1354 | ife->name, errmsg); |
1355 | return -1; | 1355 | return -1; |
1356 | } | 1356 | } |
@@ -1369,12 +1369,12 @@ struct hwtype { | |||
1369 | int suppress_null_addr; | 1369 | int suppress_null_addr; |
1370 | }; | 1370 | }; |
1371 | 1371 | ||
1372 | static struct hwtype unspec_hwtype = { | 1372 | static const struct hwtype unspec_hwtype = { |
1373 | "unspec", "UNSPEC", -1, 0, | 1373 | "unspec", "UNSPEC", -1, 0, |
1374 | UNSPEC_print, NULL, NULL | 1374 | UNSPEC_print, NULL, NULL |
1375 | }; | 1375 | }; |
1376 | 1376 | ||
1377 | static struct hwtype loop_hwtype = { | 1377 | static const struct hwtype loop_hwtype = { |
1378 | "loop", "Local Loopback", ARPHRD_LOOPBACK, 0, | 1378 | "loop", "Local Loopback", ARPHRD_LOOPBACK, 0, |
1379 | NULL, NULL, NULL | 1379 | NULL, NULL, NULL |
1380 | }; | 1380 | }; |
@@ -1478,7 +1478,7 @@ static int in_ether(char *bufp, struct sockaddr *sap) | |||
1478 | #endif /* KEEP_UNUSED */ | 1478 | #endif /* KEEP_UNUSED */ |
1479 | 1479 | ||
1480 | 1480 | ||
1481 | static struct hwtype ether_hwtype = { | 1481 | static const struct hwtype ether_hwtype = { |
1482 | "ether", "Ethernet", ARPHRD_ETHER, ETH_ALEN, | 1482 | "ether", "Ethernet", ARPHRD_ETHER, ETH_ALEN, |
1483 | pr_ether, NULL /* UNUSED in_ether */ , NULL | 1483 | pr_ether, NULL /* UNUSED in_ether */ , NULL |
1484 | }; | 1484 | }; |
@@ -1500,7 +1500,7 @@ static int do_ppp(int fd) | |||
1500 | } | 1500 | } |
1501 | #endif /* KEEP_UNUSED */ | 1501 | #endif /* KEEP_UNUSED */ |
1502 | 1502 | ||
1503 | static struct hwtype ppp_hwtype = { | 1503 | static const struct hwtype ppp_hwtype = { |
1504 | "ppp", "Point-Point Protocol", ARPHRD_PPP, 0, | 1504 | "ppp", "Point-Point Protocol", ARPHRD_PPP, 0, |
1505 | NULL, NULL, NULL /* UNUSED do_ppp */ , 0 | 1505 | NULL, NULL, NULL /* UNUSED do_ppp */ , 0 |
1506 | }; | 1506 | }; |
@@ -1508,7 +1508,7 @@ static struct hwtype ppp_hwtype = { | |||
1508 | 1508 | ||
1509 | #endif /* HAVE_PPP */ | 1509 | #endif /* HAVE_PPP */ |
1510 | 1510 | ||
1511 | static struct hwtype *hwtypes[] = { | 1511 | static const struct hwtype * const hwtypes[] = { |
1512 | 1512 | ||
1513 | &loop_hwtype, | 1513 | &loop_hwtype, |
1514 | 1514 | ||
@@ -1685,9 +1685,9 @@ static const char * const if_port_text[] = { | |||
1685 | #endif | 1685 | #endif |
1686 | 1686 | ||
1687 | /* Check our hardware type table for this type. */ | 1687 | /* Check our hardware type table for this type. */ |
1688 | static struct hwtype *get_hwntype(int type) | 1688 | static const struct hwtype *get_hwntype(int type) |
1689 | { | 1689 | { |
1690 | struct hwtype **hwp; | 1690 | const struct hwtype * const *hwp; |
1691 | 1691 | ||
1692 | #ifdef KEEP_UNUSED | 1692 | #ifdef KEEP_UNUSED |
1693 | if (!sVhwinit) | 1693 | if (!sVhwinit) |
@@ -1704,7 +1704,7 @@ static struct hwtype *get_hwntype(int type) | |||
1704 | } | 1704 | } |
1705 | 1705 | ||
1706 | /* return 1 if address is all zeros */ | 1706 | /* return 1 if address is all zeros */ |
1707 | static int hw_null_address(struct hwtype *hw, void *ap) | 1707 | static int hw_null_address(const struct hwtype *hw, void *ap) |
1708 | { | 1708 | { |
1709 | unsigned int i; | 1709 | unsigned int i; |
1710 | unsigned char *address = (unsigned char *) ap; | 1710 | unsigned char *address = (unsigned char *) ap; |
@@ -1794,7 +1794,7 @@ static const unsigned short ife_print_flags_mask[] = { | |||
1794 | static void ife_print(struct interface *ptr) | 1794 | static void ife_print(struct interface *ptr) |
1795 | { | 1795 | { |
1796 | struct aftype *ap; | 1796 | struct aftype *ap; |
1797 | struct hwtype *hw; | 1797 | const struct hwtype *hw; |
1798 | int hf; | 1798 | int hf; |
1799 | int can_compress = 0; | 1799 | int can_compress = 0; |
1800 | 1800 | ||