* [gentoo-commits] proj/net-tools:gentoo commit in: lib/, /
@ 2011-11-21 1:38 Mike Frysinger
2011-11-21 1:35 ` [gentoo-commits] proj/net-tools:master " Mike Frysinger
0 siblings, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2011-11-21 1:38 UTC (permalink / raw
To: gentoo-commits
commit: 97b31ceedcfc909b4e8479ad8f7ea4f47fb5336d
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 21 00:20:46 2011 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Nov 21 00:46:38 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/net-tools.git;a=commit;h=97b31cee
clean up const/unsigned pointers with aftype/hwtype structs
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>
---
arp.c | 6 +++---
lib/arcnet.c | 2 +-
lib/ash.c | 6 +++---
lib/ax25.c | 4 ++--
lib/ddp.c | 4 ++--
lib/econet.c | 8 ++++----
lib/ether.c | 2 +-
lib/eui64.c | 2 +-
lib/fddi.c | 2 +-
lib/frame.c | 2 +-
lib/hippi.c | 2 +-
lib/ib.c | 2 +-
lib/inet.c | 4 ++--
lib/inet6.c | 4 ++--
lib/ipx.c | 4 ++--
lib/irda.c | 2 +-
lib/loopback.c | 2 +-
lib/net-support.h | 6 +++---
lib/netrom.c | 4 ++--
lib/rose.c | 6 +++---
lib/strip.c | 4 ++--
lib/tr.c | 2 +-
lib/tunnel.c | 2 +-
lib/unix.c | 8 ++++----
lib/x25.c | 6 +++---
25 files changed, 48 insertions(+), 48 deletions(-)
diff --git a/arp.c b/arp.c
index 924f416..8a376ec 100644
--- a/arp.c
+++ b/arp.c
@@ -434,7 +434,7 @@ static int arp_file(char *name)
/* Print the contents of an ARP request block. */
-static void arp_disp_2(char *name, int type, int arp_flags, char *hwa, char *mask, char *dev)
+static void arp_disp_2(const char *name, int type, int arp_flags, const char *hwa, const char *mask, const char *dev)
{
static int title = 0;
struct hwtype *xhw;
@@ -484,7 +484,7 @@ static void arp_disp_2(char *name, int type, int arp_flags, char *hwa, char *mas
}
/* Print the contents of an ARP request block. */
-static void arp_disp(char *name, char *ip, int type, int arp_flags, char *hwa, char *mask, char *dev)
+static void arp_disp(const char *name, const char *ip, int type, int arp_flags, const char *hwa, const char *mask, const char *dev)
{
struct hwtype *xhw;
@@ -538,7 +538,7 @@ static int arp_show(char *name)
char dev[100];
int type, flags;
FILE *fp;
- char *hostname;
+ const char *hostname;
int num, entries = 0, showed = 0;
host[0] = '\0';
diff --git a/lib/arcnet.c b/lib/arcnet.c
index eb0f46e..35a2b9a 100644
--- a/lib/arcnet.c
+++ b/lib/arcnet.c
@@ -35,7 +35,7 @@ extern struct hwtype arcnet_hwtype;
/* Display an ARCnet address in readable format. */
-static char *pr_arcnet(unsigned char *ptr)
+static const char *pr_arcnet(const char *ptr)
{
static char buff[64];
diff --git a/lib/ash.c b/lib/ash.c
index c64667c..addb6fd 100644
--- a/lib/ash.c
+++ b/lib/ash.c
@@ -31,8 +31,8 @@ static unsigned char hamming[16] =
};
/* Display an Ash address in readable format. */
-static char *
-pr_ash(unsigned char *ptr)
+static const char *
+pr_ash(const char *ptr)
{
static char buff[128];
char *p = buff;
@@ -102,7 +102,7 @@ struct hwtype ash_hwtype =
#if HAVE_AFASH
/* Display an Ash socket address. */
-static char *
+static const char *
pr_sash(struct sockaddr *sap, int numeric)
{
static char buf[64];
diff --git a/lib/ax25.c b/lib/ax25.c
index 11521d2..209e479 100644
--- a/lib/ax25.c
+++ b/lib/ax25.c
@@ -47,7 +47,7 @@ static char AX25_errmsg[128];
extern struct aftype ax25_aftype;
-static char *AX25_print(unsigned char *ptr)
+static const char *AX25_print(const char *ptr)
{
static char buff[8];
int i;
@@ -66,7 +66,7 @@ static char *AX25_print(unsigned char *ptr)
/* Display an AX.25 socket address. */
-static char *
+static const char *
AX25_sprint(struct sockaddr *sap, int numeric)
{
static char buf[64];
diff --git a/lib/ddp.c b/lib/ddp.c
index 9b5e829..0a08fd2 100644
--- a/lib/ddp.c
+++ b/lib/ddp.c
@@ -32,7 +32,7 @@
#include "util.h"
/* Display a ddp domain address. */
-static char *ddp_print(unsigned char *ptr)
+static const char *ddp_print(const char *ptr)
{
static char buff[64];
struct sockaddr_at *sat = (struct sockaddr_at *) (ptr - 2);
@@ -42,7 +42,7 @@ static char *ddp_print(unsigned char *ptr)
/* Display a ddp domain address. */
-static char *ddp_sprint(struct sockaddr *sap, int numeric)
+static const char *ddp_sprint(struct sockaddr *sap, int numeric)
{
static char buf[64];
diff --git a/lib/econet.c b/lib/econet.c
index 1229a28..05f09c9 100644
--- a/lib/econet.c
+++ b/lib/econet.c
@@ -32,8 +32,8 @@
/* Display an Econet address */
-static char *
-ec_print(unsigned char *ptr)
+static const char *
+ec_print(const char *ptr)
{
static char buff[64];
struct ec_addr *ec = (struct ec_addr *) ptr;
@@ -43,7 +43,7 @@ ec_print(unsigned char *ptr)
/* Display an Econet socket address */
-static char *
+static const char *
ec_sprint(struct sockaddr *sap, int numeric)
{
struct sockaddr_ec *sec = (struct sockaddr_ec *) sap;
@@ -51,7 +51,7 @@ ec_sprint(struct sockaddr *sap, int numeric)
if (sap->sa_family != AF_ECONET)
return _("[NONE SET]");
- return ec_print((unsigned char *) &sec->addr);
+ return ec_print((const char *) &sec->addr);
}
static int
diff --git a/lib/ether.c b/lib/ether.c
index 70a6daf..ddd1598 100644
--- a/lib/ether.c
+++ b/lib/ether.c
@@ -35,7 +35,7 @@ extern struct hwtype ether_hwtype;
/* Display an Ethernet address in readable format. */
-static char *pr_ether(unsigned char *ptr)
+static const char *pr_ether(const char *ptr)
{
static char buff[64];
diff --git a/lib/eui64.c b/lib/eui64.c
index 64c3614..6ab7d26 100644
--- a/lib/eui64.c
+++ b/lib/eui64.c
@@ -49,7 +49,7 @@
struct hwtype eui64_hwtype;
/* Display an EUI-64 address in readable format. */
-static char *pr_eui64( unsigned char *ptr )
+static const char *pr_eui64(const char *ptr)
{
static char buff[64];
diff --git a/lib/fddi.c b/lib/fddi.c
index f6bf5ca..75adddd 100644
--- a/lib/fddi.c
+++ b/lib/fddi.c
@@ -46,7 +46,7 @@ extern struct hwtype fddi_hwtype;
/* Display an FDDI address in readable format. */
-static char *pr_fddi(unsigned char *ptr)
+static const char *pr_fddi(const char *ptr)
{
static char buff[64];
diff --git a/lib/frame.c b/lib/frame.c
index 58d1ad4..ad265d6 100644
--- a/lib/frame.c
+++ b/lib/frame.c
@@ -37,7 +37,7 @@
#include "net-support.h"
#include "pathnames.h"
-char *pr_dlci(unsigned char *ptr)
+static const char *pr_dlci(const char *ptr)
{
static char buf[12];
diff --git a/lib/hippi.c b/lib/hippi.c
index 308db00..bd73ea1 100644
--- a/lib/hippi.c
+++ b/lib/hippi.c
@@ -46,7 +46,7 @@ extern struct hwtype hippi_hwtype;
/* Display an HIPPI address in readable format. */
-static char *pr_hippi(unsigned char *ptr)
+static const char *pr_hippi(const char *ptr)
{
static char buff[64];
diff --git a/lib/ib.c b/lib/ib.c
index 72281a1..e05bd3e 100644
--- a/lib/ib.c
+++ b/lib/ib.c
@@ -36,7 +36,7 @@ extern struct hwtype ib_hwtype;
/* Display an InfiniBand address in readable format. */
-static char *pr_ib(unsigned char *ptr)
+static const char *pr_ib(const char *ptr)
{
static char buff[128];
char *pos;
diff --git a/lib/inet.c b/lib/inet.c
index 60e55df..49fcee8 100644
--- a/lib/inet.c
+++ b/lib/inet.c
@@ -229,14 +229,14 @@ static void INET_reserror(char *text)
/* Display an Internet socket address. */
-static char *INET_print(unsigned char *ptr)
+static const char *INET_print(const char *ptr)
{
return (inet_ntoa((*(struct in_addr *) ptr)));
}
/* Display an Internet socket address. */
-static char *INET_sprint(struct sockaddr *sap, int numeric)
+static const char *INET_sprint(struct sockaddr *sap, int numeric)
{
static char buff[128];
diff --git a/lib/inet6.c b/lib/inet6.c
index c8406fd..5f00430 100644
--- a/lib/inet6.c
+++ b/lib/inet6.c
@@ -126,7 +126,7 @@ static void INET6_reserror(char *text)
/* Display an Internet socket address. */
-static char *INET6_print(unsigned char *ptr)
+static const char *INET6_print(const char *ptr)
{
static char name[80];
@@ -137,7 +137,7 @@ static char *INET6_print(unsigned char *ptr)
/* Display an Internet socket address. */
/* dirty! struct sockaddr usually doesn't suffer for inet6 addresses, fst. */
-static char *INET6_sprint(struct sockaddr *sap, int numeric)
+static const char *INET6_sprint(struct sockaddr *sap, int numeric)
{
static char buff[128];
diff --git a/lib/ipx.c b/lib/ipx.c
index 13d2761..1359f5f 100644
--- a/lib/ipx.c
+++ b/lib/ipx.c
@@ -42,7 +42,7 @@
#endif
/* Display a ipx domain address. */
-static char *IPX_print(unsigned char *ptr)
+static const char *IPX_print(const char *ptr)
{
static char buff[64];
struct sockaddr_ipx *sipx = (struct sockaddr_ipx *) (ptr - 2);
@@ -73,7 +73,7 @@ static char *IPX_print(unsigned char *ptr)
/* Display a ipx domain address. */
-static char *IPX_sprint(struct sockaddr *sap, int numeric)
+static const char *IPX_sprint(struct sockaddr *sap, int numeric)
{
static char buf[64];
diff --git a/lib/irda.c b/lib/irda.c
index 598e6f0..a64876b 100644
--- a/lib/irda.c
+++ b/lib/irda.c
@@ -59,7 +59,7 @@
* Print hardware address of interface
*
*/
-static char *irda_print(unsigned char *ptr)
+static const char *irda_print(const char *ptr)
{
static char buff[12];
diff --git a/lib/loopback.c b/lib/loopback.c
index 0f08ac2..1b7e9cc 100644
--- a/lib/loopback.c
+++ b/lib/loopback.c
@@ -32,7 +32,7 @@
#include "util.h"
/* Display an UNSPEC address. */
-static char *pr_unspec(unsigned char *ptr)
+static const char *pr_unspec(const char *ptr)
{
static char buff[64];
char *pos;
diff --git a/lib/net-support.h b/lib/net-support.h
index dae15ac..d7a19d5 100644
--- a/lib/net-support.h
+++ b/lib/net-support.h
@@ -38,8 +38,8 @@ struct aftype {
char *title;
int af;
int alen;
- char *(*print) (unsigned char *);
- char *(*sprint) (struct sockaddr *, int numeric);
+ const char *(*print) (const char *);
+ const char *(*sprint) (struct sockaddr *, int numeric);
int (*input) (int type, char *bufp, struct sockaddr *);
void (*herror) (char *text);
int (*rprint) (int options);
@@ -60,7 +60,7 @@ struct hwtype {
char *title;
int type;
int alen;
- char *(*print) (unsigned char *);
+ const char *(*print) (const char *);
int (*input) (char *, struct sockaddr *);
int (*activate) (int fd);
int suppress_null_addr;
diff --git a/lib/netrom.c b/lib/netrom.c
index 1de9dc3..f3033c7 100644
--- a/lib/netrom.c
+++ b/lib/netrom.c
@@ -52,7 +52,7 @@ static char netrom_errmsg[128];
extern struct aftype netrom_aftype;
-static char *NETROM_print(unsigned char *ptr)
+static const char *NETROM_print(const char *ptr)
{
static char buff[8];
int i;
@@ -71,7 +71,7 @@ static char *NETROM_print(unsigned char *ptr)
/* Display an AX.25 socket address. */
-static char *NETROM_sprint(struct sockaddr *sap, int numeric)
+static const char *NETROM_sprint(struct sockaddr *sap, int numeric)
{
char buf[64];
if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
diff --git a/lib/rose.c b/lib/rose.c
index 381226b..52d025a 100644
--- a/lib/rose.c
+++ b/lib/rose.c
@@ -53,8 +53,8 @@ static char ROSE_errmsg[128];
extern struct aftype rose_aftype;
-static char *
- ROSE_print(unsigned char *ptr)
+static const char *
+ ROSE_print(const char *ptr)
{
static char buff[12];
@@ -64,7 +64,7 @@ static char *
}
/* Display a ROSE socket address. */
-static char *
+static const char *
ROSE_sprint(struct sockaddr *sap, int numeric)
{
if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
diff --git a/lib/strip.c b/lib/strip.c
index fd396ba..ced2325 100644
--- a/lib/strip.c
+++ b/lib/strip.c
@@ -38,8 +38,8 @@
extern struct hwtype strip_hwtype;
-static char *
-pr_strip(unsigned char *ptr)
+static const char *
+pr_strip(const char *ptr)
{
static char buff[64];
if(ptr[1])
diff --git a/lib/tr.c b/lib/tr.c
index c75f256..961cdb1 100644
--- a/lib/tr.c
+++ b/lib/tr.c
@@ -39,7 +39,7 @@ extern struct hwtype tr_hwtype;
extern struct hwtype tr_hwtype1;
#endif
-static char *pr_tr(unsigned char *ptr)
+static const char *pr_tr(const char *ptr)
{
static char buff[64];
diff --git a/lib/tunnel.c b/lib/tunnel.c
index 19606c1..8a160bf 100644
--- a/lib/tunnel.c
+++ b/lib/tunnel.c
@@ -21,7 +21,7 @@
extern struct hwtype ether_hwtype;
-static char *pr_tunnel(unsigned char *ptr)
+static const char *pr_tunnel(const char *ptr)
{
return ("");
}
diff --git a/lib/unix.c b/lib/unix.c
index fb4dcce..936cd48 100644
--- a/lib/unix.c
+++ b/lib/unix.c
@@ -32,7 +32,7 @@
/* Display an UNSPEC address. */
-static char *UNSPEC_print(unsigned char *ptr)
+static const char *UNSPEC_print(const char *ptr)
{
static char buff[64];
char *pos;
@@ -48,7 +48,7 @@ static char *UNSPEC_print(unsigned char *ptr)
/* Display an UNSPEC socket address. */
-static char *UNSPEC_sprint(struct sockaddr *sap, int numeric)
+static const char *UNSPEC_sprint(struct sockaddr *sap, int numeric)
{
static char buf[64];
@@ -61,14 +61,14 @@ static char *UNSPEC_sprint(struct sockaddr *sap, int numeric)
#if HAVE_AFUNIX
/* Display a UNIX domain address. */
-static char *UNIX_print(unsigned char *ptr)
+static const char *UNIX_print(const char *ptr)
{
return (ptr);
}
/* Display a UNIX domain address. */
-static char *UNIX_sprint(struct sockaddr *sap, int numeric)
+static const char *UNIX_sprint(struct sockaddr *sap, int numeric)
{
static char buf[64];
diff --git a/lib/x25.c b/lib/x25.c
index 1ffb569..d795ca9 100644
--- a/lib/x25.c
+++ b/lib/x25.c
@@ -50,8 +50,8 @@ extern struct aftype x25_aftype;
#endif
-static char *
-X25_print(unsigned char *ptr)
+static const char *
+X25_print(const char *ptr)
{
static char buff[X25_ADDR_LEN+1];
@@ -63,7 +63,7 @@ X25_print(unsigned char *ptr)
/* Display an X.25 socket address. */
-static char *
+static const char *
X25_sprint(struct sockaddr *sap, int numeric)
{
if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/net-tools:master commit in: lib/, /
2011-11-21 1:38 [gentoo-commits] proj/net-tools:gentoo commit in: lib/, / Mike Frysinger
@ 2011-11-21 1:35 ` Mike Frysinger
0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2011-11-21 1:35 UTC (permalink / raw
To: gentoo-commits
commit: 97b31ceedcfc909b4e8479ad8f7ea4f47fb5336d
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 21 00:20:46 2011 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Nov 21 00:46:38 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/net-tools.git;a=commit;h=97b31cee
clean up const/unsigned pointers with aftype/hwtype structs
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>
---
arp.c | 6 +++---
lib/arcnet.c | 2 +-
lib/ash.c | 6 +++---
lib/ax25.c | 4 ++--
lib/ddp.c | 4 ++--
lib/econet.c | 8 ++++----
lib/ether.c | 2 +-
lib/eui64.c | 2 +-
lib/fddi.c | 2 +-
lib/frame.c | 2 +-
lib/hippi.c | 2 +-
lib/ib.c | 2 +-
lib/inet.c | 4 ++--
lib/inet6.c | 4 ++--
lib/ipx.c | 4 ++--
lib/irda.c | 2 +-
lib/loopback.c | 2 +-
lib/net-support.h | 6 +++---
lib/netrom.c | 4 ++--
lib/rose.c | 6 +++---
lib/strip.c | 4 ++--
lib/tr.c | 2 +-
lib/tunnel.c | 2 +-
lib/unix.c | 8 ++++----
lib/x25.c | 6 +++---
25 files changed, 48 insertions(+), 48 deletions(-)
diff --git a/arp.c b/arp.c
index 924f416..8a376ec 100644
--- a/arp.c
+++ b/arp.c
@@ -434,7 +434,7 @@ static int arp_file(char *name)
/* Print the contents of an ARP request block. */
-static void arp_disp_2(char *name, int type, int arp_flags, char *hwa, char *mask, char *dev)
+static void arp_disp_2(const char *name, int type, int arp_flags, const char *hwa, const char *mask, const char *dev)
{
static int title = 0;
struct hwtype *xhw;
@@ -484,7 +484,7 @@ static void arp_disp_2(char *name, int type, int arp_flags, char *hwa, char *mas
}
/* Print the contents of an ARP request block. */
-static void arp_disp(char *name, char *ip, int type, int arp_flags, char *hwa, char *mask, char *dev)
+static void arp_disp(const char *name, const char *ip, int type, int arp_flags, const char *hwa, const char *mask, const char *dev)
{
struct hwtype *xhw;
@@ -538,7 +538,7 @@ static int arp_show(char *name)
char dev[100];
int type, flags;
FILE *fp;
- char *hostname;
+ const char *hostname;
int num, entries = 0, showed = 0;
host[0] = '\0';
diff --git a/lib/arcnet.c b/lib/arcnet.c
index eb0f46e..35a2b9a 100644
--- a/lib/arcnet.c
+++ b/lib/arcnet.c
@@ -35,7 +35,7 @@ extern struct hwtype arcnet_hwtype;
/* Display an ARCnet address in readable format. */
-static char *pr_arcnet(unsigned char *ptr)
+static const char *pr_arcnet(const char *ptr)
{
static char buff[64];
diff --git a/lib/ash.c b/lib/ash.c
index c64667c..addb6fd 100644
--- a/lib/ash.c
+++ b/lib/ash.c
@@ -31,8 +31,8 @@ static unsigned char hamming[16] =
};
/* Display an Ash address in readable format. */
-static char *
-pr_ash(unsigned char *ptr)
+static const char *
+pr_ash(const char *ptr)
{
static char buff[128];
char *p = buff;
@@ -102,7 +102,7 @@ struct hwtype ash_hwtype =
#if HAVE_AFASH
/* Display an Ash socket address. */
-static char *
+static const char *
pr_sash(struct sockaddr *sap, int numeric)
{
static char buf[64];
diff --git a/lib/ax25.c b/lib/ax25.c
index 11521d2..209e479 100644
--- a/lib/ax25.c
+++ b/lib/ax25.c
@@ -47,7 +47,7 @@ static char AX25_errmsg[128];
extern struct aftype ax25_aftype;
-static char *AX25_print(unsigned char *ptr)
+static const char *AX25_print(const char *ptr)
{
static char buff[8];
int i;
@@ -66,7 +66,7 @@ static char *AX25_print(unsigned char *ptr)
/* Display an AX.25 socket address. */
-static char *
+static const char *
AX25_sprint(struct sockaddr *sap, int numeric)
{
static char buf[64];
diff --git a/lib/ddp.c b/lib/ddp.c
index 9b5e829..0a08fd2 100644
--- a/lib/ddp.c
+++ b/lib/ddp.c
@@ -32,7 +32,7 @@
#include "util.h"
/* Display a ddp domain address. */
-static char *ddp_print(unsigned char *ptr)
+static const char *ddp_print(const char *ptr)
{
static char buff[64];
struct sockaddr_at *sat = (struct sockaddr_at *) (ptr - 2);
@@ -42,7 +42,7 @@ static char *ddp_print(unsigned char *ptr)
/* Display a ddp domain address. */
-static char *ddp_sprint(struct sockaddr *sap, int numeric)
+static const char *ddp_sprint(struct sockaddr *sap, int numeric)
{
static char buf[64];
diff --git a/lib/econet.c b/lib/econet.c
index 1229a28..05f09c9 100644
--- a/lib/econet.c
+++ b/lib/econet.c
@@ -32,8 +32,8 @@
/* Display an Econet address */
-static char *
-ec_print(unsigned char *ptr)
+static const char *
+ec_print(const char *ptr)
{
static char buff[64];
struct ec_addr *ec = (struct ec_addr *) ptr;
@@ -43,7 +43,7 @@ ec_print(unsigned char *ptr)
/* Display an Econet socket address */
-static char *
+static const char *
ec_sprint(struct sockaddr *sap, int numeric)
{
struct sockaddr_ec *sec = (struct sockaddr_ec *) sap;
@@ -51,7 +51,7 @@ ec_sprint(struct sockaddr *sap, int numeric)
if (sap->sa_family != AF_ECONET)
return _("[NONE SET]");
- return ec_print((unsigned char *) &sec->addr);
+ return ec_print((const char *) &sec->addr);
}
static int
diff --git a/lib/ether.c b/lib/ether.c
index 70a6daf..ddd1598 100644
--- a/lib/ether.c
+++ b/lib/ether.c
@@ -35,7 +35,7 @@ extern struct hwtype ether_hwtype;
/* Display an Ethernet address in readable format. */
-static char *pr_ether(unsigned char *ptr)
+static const char *pr_ether(const char *ptr)
{
static char buff[64];
diff --git a/lib/eui64.c b/lib/eui64.c
index 64c3614..6ab7d26 100644
--- a/lib/eui64.c
+++ b/lib/eui64.c
@@ -49,7 +49,7 @@
struct hwtype eui64_hwtype;
/* Display an EUI-64 address in readable format. */
-static char *pr_eui64( unsigned char *ptr )
+static const char *pr_eui64(const char *ptr)
{
static char buff[64];
diff --git a/lib/fddi.c b/lib/fddi.c
index f6bf5ca..75adddd 100644
--- a/lib/fddi.c
+++ b/lib/fddi.c
@@ -46,7 +46,7 @@ extern struct hwtype fddi_hwtype;
/* Display an FDDI address in readable format. */
-static char *pr_fddi(unsigned char *ptr)
+static const char *pr_fddi(const char *ptr)
{
static char buff[64];
diff --git a/lib/frame.c b/lib/frame.c
index 58d1ad4..ad265d6 100644
--- a/lib/frame.c
+++ b/lib/frame.c
@@ -37,7 +37,7 @@
#include "net-support.h"
#include "pathnames.h"
-char *pr_dlci(unsigned char *ptr)
+static const char *pr_dlci(const char *ptr)
{
static char buf[12];
diff --git a/lib/hippi.c b/lib/hippi.c
index 308db00..bd73ea1 100644
--- a/lib/hippi.c
+++ b/lib/hippi.c
@@ -46,7 +46,7 @@ extern struct hwtype hippi_hwtype;
/* Display an HIPPI address in readable format. */
-static char *pr_hippi(unsigned char *ptr)
+static const char *pr_hippi(const char *ptr)
{
static char buff[64];
diff --git a/lib/ib.c b/lib/ib.c
index 72281a1..e05bd3e 100644
--- a/lib/ib.c
+++ b/lib/ib.c
@@ -36,7 +36,7 @@ extern struct hwtype ib_hwtype;
/* Display an InfiniBand address in readable format. */
-static char *pr_ib(unsigned char *ptr)
+static const char *pr_ib(const char *ptr)
{
static char buff[128];
char *pos;
diff --git a/lib/inet.c b/lib/inet.c
index 60e55df..49fcee8 100644
--- a/lib/inet.c
+++ b/lib/inet.c
@@ -229,14 +229,14 @@ static void INET_reserror(char *text)
/* Display an Internet socket address. */
-static char *INET_print(unsigned char *ptr)
+static const char *INET_print(const char *ptr)
{
return (inet_ntoa((*(struct in_addr *) ptr)));
}
/* Display an Internet socket address. */
-static char *INET_sprint(struct sockaddr *sap, int numeric)
+static const char *INET_sprint(struct sockaddr *sap, int numeric)
{
static char buff[128];
diff --git a/lib/inet6.c b/lib/inet6.c
index c8406fd..5f00430 100644
--- a/lib/inet6.c
+++ b/lib/inet6.c
@@ -126,7 +126,7 @@ static void INET6_reserror(char *text)
/* Display an Internet socket address. */
-static char *INET6_print(unsigned char *ptr)
+static const char *INET6_print(const char *ptr)
{
static char name[80];
@@ -137,7 +137,7 @@ static char *INET6_print(unsigned char *ptr)
/* Display an Internet socket address. */
/* dirty! struct sockaddr usually doesn't suffer for inet6 addresses, fst. */
-static char *INET6_sprint(struct sockaddr *sap, int numeric)
+static const char *INET6_sprint(struct sockaddr *sap, int numeric)
{
static char buff[128];
diff --git a/lib/ipx.c b/lib/ipx.c
index 13d2761..1359f5f 100644
--- a/lib/ipx.c
+++ b/lib/ipx.c
@@ -42,7 +42,7 @@
#endif
/* Display a ipx domain address. */
-static char *IPX_print(unsigned char *ptr)
+static const char *IPX_print(const char *ptr)
{
static char buff[64];
struct sockaddr_ipx *sipx = (struct sockaddr_ipx *) (ptr - 2);
@@ -73,7 +73,7 @@ static char *IPX_print(unsigned char *ptr)
/* Display a ipx domain address. */
-static char *IPX_sprint(struct sockaddr *sap, int numeric)
+static const char *IPX_sprint(struct sockaddr *sap, int numeric)
{
static char buf[64];
diff --git a/lib/irda.c b/lib/irda.c
index 598e6f0..a64876b 100644
--- a/lib/irda.c
+++ b/lib/irda.c
@@ -59,7 +59,7 @@
* Print hardware address of interface
*
*/
-static char *irda_print(unsigned char *ptr)
+static const char *irda_print(const char *ptr)
{
static char buff[12];
diff --git a/lib/loopback.c b/lib/loopback.c
index 0f08ac2..1b7e9cc 100644
--- a/lib/loopback.c
+++ b/lib/loopback.c
@@ -32,7 +32,7 @@
#include "util.h"
/* Display an UNSPEC address. */
-static char *pr_unspec(unsigned char *ptr)
+static const char *pr_unspec(const char *ptr)
{
static char buff[64];
char *pos;
diff --git a/lib/net-support.h b/lib/net-support.h
index dae15ac..d7a19d5 100644
--- a/lib/net-support.h
+++ b/lib/net-support.h
@@ -38,8 +38,8 @@ struct aftype {
char *title;
int af;
int alen;
- char *(*print) (unsigned char *);
- char *(*sprint) (struct sockaddr *, int numeric);
+ const char *(*print) (const char *);
+ const char *(*sprint) (struct sockaddr *, int numeric);
int (*input) (int type, char *bufp, struct sockaddr *);
void (*herror) (char *text);
int (*rprint) (int options);
@@ -60,7 +60,7 @@ struct hwtype {
char *title;
int type;
int alen;
- char *(*print) (unsigned char *);
+ const char *(*print) (const char *);
int (*input) (char *, struct sockaddr *);
int (*activate) (int fd);
int suppress_null_addr;
diff --git a/lib/netrom.c b/lib/netrom.c
index 1de9dc3..f3033c7 100644
--- a/lib/netrom.c
+++ b/lib/netrom.c
@@ -52,7 +52,7 @@ static char netrom_errmsg[128];
extern struct aftype netrom_aftype;
-static char *NETROM_print(unsigned char *ptr)
+static const char *NETROM_print(const char *ptr)
{
static char buff[8];
int i;
@@ -71,7 +71,7 @@ static char *NETROM_print(unsigned char *ptr)
/* Display an AX.25 socket address. */
-static char *NETROM_sprint(struct sockaddr *sap, int numeric)
+static const char *NETROM_sprint(struct sockaddr *sap, int numeric)
{
char buf[64];
if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
diff --git a/lib/rose.c b/lib/rose.c
index 381226b..52d025a 100644
--- a/lib/rose.c
+++ b/lib/rose.c
@@ -53,8 +53,8 @@ static char ROSE_errmsg[128];
extern struct aftype rose_aftype;
-static char *
- ROSE_print(unsigned char *ptr)
+static const char *
+ ROSE_print(const char *ptr)
{
static char buff[12];
@@ -64,7 +64,7 @@ static char *
}
/* Display a ROSE socket address. */
-static char *
+static const char *
ROSE_sprint(struct sockaddr *sap, int numeric)
{
if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
diff --git a/lib/strip.c b/lib/strip.c
index fd396ba..ced2325 100644
--- a/lib/strip.c
+++ b/lib/strip.c
@@ -38,8 +38,8 @@
extern struct hwtype strip_hwtype;
-static char *
-pr_strip(unsigned char *ptr)
+static const char *
+pr_strip(const char *ptr)
{
static char buff[64];
if(ptr[1])
diff --git a/lib/tr.c b/lib/tr.c
index c75f256..961cdb1 100644
--- a/lib/tr.c
+++ b/lib/tr.c
@@ -39,7 +39,7 @@ extern struct hwtype tr_hwtype;
extern struct hwtype tr_hwtype1;
#endif
-static char *pr_tr(unsigned char *ptr)
+static const char *pr_tr(const char *ptr)
{
static char buff[64];
diff --git a/lib/tunnel.c b/lib/tunnel.c
index 19606c1..8a160bf 100644
--- a/lib/tunnel.c
+++ b/lib/tunnel.c
@@ -21,7 +21,7 @@
extern struct hwtype ether_hwtype;
-static char *pr_tunnel(unsigned char *ptr)
+static const char *pr_tunnel(const char *ptr)
{
return ("");
}
diff --git a/lib/unix.c b/lib/unix.c
index fb4dcce..936cd48 100644
--- a/lib/unix.c
+++ b/lib/unix.c
@@ -32,7 +32,7 @@
/* Display an UNSPEC address. */
-static char *UNSPEC_print(unsigned char *ptr)
+static const char *UNSPEC_print(const char *ptr)
{
static char buff[64];
char *pos;
@@ -48,7 +48,7 @@ static char *UNSPEC_print(unsigned char *ptr)
/* Display an UNSPEC socket address. */
-static char *UNSPEC_sprint(struct sockaddr *sap, int numeric)
+static const char *UNSPEC_sprint(struct sockaddr *sap, int numeric)
{
static char buf[64];
@@ -61,14 +61,14 @@ static char *UNSPEC_sprint(struct sockaddr *sap, int numeric)
#if HAVE_AFUNIX
/* Display a UNIX domain address. */
-static char *UNIX_print(unsigned char *ptr)
+static const char *UNIX_print(const char *ptr)
{
return (ptr);
}
/* Display a UNIX domain address. */
-static char *UNIX_sprint(struct sockaddr *sap, int numeric)
+static const char *UNIX_sprint(struct sockaddr *sap, int numeric)
{
static char buf[64];
diff --git a/lib/x25.c b/lib/x25.c
index 1ffb569..d795ca9 100644
--- a/lib/x25.c
+++ b/lib/x25.c
@@ -50,8 +50,8 @@ extern struct aftype x25_aftype;
#endif
-static char *
-X25_print(unsigned char *ptr)
+static const char *
+X25_print(const char *ptr)
{
static char buff[X25_ADDR_LEN+1];
@@ -63,7 +63,7 @@ X25_print(unsigned char *ptr)
/* Display an X.25 socket address. */
-static char *
+static const char *
X25_sprint(struct sockaddr *sap, int numeric)
{
if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/net-tools:master commit in: lib/, /
@ 2011-11-21 1:35 Mike Frysinger
0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2011-11-21 1:35 UTC (permalink / raw
To: gentoo-commits
commit: 4d721ae0a79e17190404b9c6381d7ed9c8d37d8e
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 21 00:44:47 2011 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Mon Nov 21 00:46:38 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/net-tools.git;a=commit;h=4d721ae0
fix up signed/unsigned warnings
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>
---
ipmaddr.c | 2 +-
lib/arcnet.c | 2 +-
lib/ash.c | 2 +-
lib/ax25.c | 2 +-
lib/ether.c | 2 +-
lib/eui64.c | 2 +-
lib/fddi.c | 2 +-
lib/hippi.c | 2 +-
lib/ib.c | 2 +-
lib/netrom.c | 2 +-
lib/tr.c | 2 +-
lib/x25.c | 2 +-
12 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/ipmaddr.c b/ipmaddr.c
index 89cdc08..3927aad 100644
--- a/ipmaddr.c
+++ b/ipmaddr.c
@@ -75,7 +75,7 @@ static void print_lla(FILE *fp, int len, unsigned char *addr)
}
}
-static int parse_lla(char *str, unsigned char *addr)
+static int parse_lla(char *str, char *addr)
{
int len=0;
diff --git a/lib/arcnet.c b/lib/arcnet.c
index 10b59e5..9bc3267 100644
--- a/lib/arcnet.c
+++ b/lib/arcnet.c
@@ -52,7 +52,7 @@ static const char *pr_arcnet(const char *ptr)
/* Input an ARCnet address and convert to binary. */
static int in_arcnet(char *bufp, struct sockaddr *sap)
{
- unsigned char *ptr;
+ char *ptr;
char c, *orig;
int i, val;
diff --git a/lib/ash.c b/lib/ash.c
index addb6fd..49d1111 100644
--- a/lib/ash.c
+++ b/lib/ash.c
@@ -60,7 +60,7 @@ struct hwtype ash_hwtype;
static int
in_ash(char *bufp, struct sockaddr *sap)
{
- unsigned char *ptr;
+ char *ptr;
unsigned int i = 0;
sap->sa_family = ash_hwtype.type;
diff --git a/lib/ax25.c b/lib/ax25.c
index afc035b..24c667d 100644
--- a/lib/ax25.c
+++ b/lib/ax25.c
@@ -84,7 +84,7 @@ static const char *
static int AX25_input(int type, char *bufp, struct sockaddr *sap)
{
- unsigned char *ptr;
+ char *ptr;
char *orig, c;
int i;
diff --git a/lib/ether.c b/lib/ether.c
index 9bf8a55..dee9c73 100644
--- a/lib/ether.c
+++ b/lib/ether.c
@@ -55,7 +55,7 @@ static const char *pr_ether(const char *ptr)
/* Input an Ethernet address and convert to binary. */
static int in_ether(char *bufp, struct sockaddr *sap)
{
- unsigned char *ptr;
+ char *ptr;
char c, *orig;
int i;
unsigned val;
diff --git a/lib/eui64.c b/lib/eui64.c
index 32822a3..ecc61a7 100644
--- a/lib/eui64.c
+++ b/lib/eui64.c
@@ -69,7 +69,7 @@ static const char *pr_eui64(const char *ptr)
/* Start the PPP encapsulation on the file descriptor. */
static int in_eui64( char *bufp, struct sockaddr *sap )
{
- unsigned char *ptr;
+ char *ptr;
char c, *orig;
int i;
unsigned val;
diff --git a/lib/fddi.c b/lib/fddi.c
index 750cc2d..c18696e 100644
--- a/lib/fddi.c
+++ b/lib/fddi.c
@@ -66,7 +66,7 @@ static const char *pr_fddi(const char *ptr)
/* Input an FDDI address and convert to binary. */
static int in_fddi(char *bufp, struct sockaddr *sap)
{
- unsigned char *ptr;
+ char *ptr;
char c, *orig;
int i, val;
diff --git a/lib/hippi.c b/lib/hippi.c
index ae6e31b..43e7a79 100644
--- a/lib/hippi.c
+++ b/lib/hippi.c
@@ -66,7 +66,7 @@ static const char *pr_hippi(const char *ptr)
/* Input an HIPPI address and convert to binary. */
static int in_hippi(char *bufp, struct sockaddr *sap)
{
- unsigned char *ptr;
+ char *ptr;
char c, *orig;
int i, val;
diff --git a/lib/ib.c b/lib/ib.c
index 98f3446..7475293 100644
--- a/lib/ib.c
+++ b/lib/ib.c
@@ -65,7 +65,7 @@ static const char *pr_ib(const char *ptr)
/* Input an Infiniband address and convert to binary. */
static int in_ib(char *bufp, struct sockaddr *sap)
{
- unsigned char *ptr;
+ char *ptr;
char c, *orig;
int i;
unsigned val;
diff --git a/lib/netrom.c b/lib/netrom.c
index 254bd61..fa88d35 100644
--- a/lib/netrom.c
+++ b/lib/netrom.c
@@ -87,7 +87,7 @@ static const char *NETROM_sprint(struct sockaddr *sap, int numeric)
static int NETROM_input(int type, char *bufp, struct sockaddr *sap)
{
- unsigned char *ptr;
+ char *ptr;
char *orig, c;
unsigned int i;
diff --git a/lib/tr.c b/lib/tr.c
index a0413f4..2cfb57d 100644
--- a/lib/tr.c
+++ b/lib/tr.c
@@ -58,7 +58,7 @@ static const char *pr_tr(const char *ptr)
static int in_tr(char *bufp, struct sockaddr *sap)
{
- unsigned char *ptr;
+ char *ptr;
char c, *orig;
int i, val;
diff --git a/lib/x25.c b/lib/x25.c
index d795ca9..5e2ced4 100644
--- a/lib/x25.c
+++ b/lib/x25.c
@@ -78,7 +78,7 @@ X25_sprint(struct sockaddr *sap, int numeric)
static int
X25_input(int type, char *bufp, struct sockaddr *sap)
{
- unsigned char *ptr;
+ char *ptr;
char *p;
unsigned int sigdigits;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] proj/net-tools:master commit in: lib/, /
@ 2011-04-09 13:58 Mike Frysinger
0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2011-04-09 13:58 UTC (permalink / raw
To: gentoo-commits
commit: c65379a00b9361d8b2c95bca0af082e6098d0145
Author: Bernd Eckenfels <net-tools <AT> lina <DOT> inka <DOT> de>
AuthorDate: Sat Jan 1 03:22:31 2011 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Sat Jan 1 03:22:31 2011 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/net-tools.git;a=commit;h=c65379a0
Bug #17812 Fix the handling of some of the HAVE_* flags ifdef vs if. --jpa468
---
ifconfig.c | 8 ++++----
lib/interface.c | 8 +++++---
lib/net-support.h | 2 +-
3 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/ifconfig.c b/ifconfig.c
index ab3f621..952e705 100644
--- a/ifconfig.c
+++ b/ifconfig.c
@@ -3,7 +3,7 @@
* that either displays or sets the characteristics of
* one or more of the system's networking interfaces.
*
- * Version: $Id: ifconfig.c,v 1.58 2008/10/02 23:31:04 ecki Exp $
+ * Version: $Id: ifconfig.c,v 1.59 2011-01-01 03:22:31 ecki Exp $
*
* Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
* and others. Copyright 1993 MicroWalt Corporation
@@ -49,7 +49,7 @@
#include <asm/types.h>
-#ifdef HAVE_HWSLIP
+#if HAVE_HWSLIP
#include <linux/if_slip.h>
#endif
@@ -778,7 +778,7 @@ int main(int argc, char **argv)
continue;
}
#endif
-#ifdef HAVE_AFINET
+#if HAVE_AFINET
{ /* ipv4 address a.b.c.d */
unsigned long ip, nm, bc;
safe_strncpy(host, *spp, (sizeof host));
@@ -871,7 +871,7 @@ int main(int argc, char **argv)
continue;
}
#endif
-#ifdef HAVE_AFINET
+#if HAVE_AFINET
{
/* ipv4 address a.b.c.d */
unsigned long ip, nm, bc;
diff --git a/lib/interface.c b/lib/interface.c
index c9f5923..0e5e454 100644
--- a/lib/interface.c
+++ b/lib/interface.c
@@ -7,7 +7,7 @@
8/2000 Andi Kleen make the list operations a bit more efficient.
People are crazy enough to use thousands of aliases now.
- $Id: interface.c,v 1.34 2010/01/01 06:35:30 vapier Exp $
+ $Id: interface.c,v 1.35 2011-01-01 03:22:31 ecki Exp $
*/
#include "config.h"
@@ -37,7 +37,7 @@
#include <neteconet/ec.h>
#endif
-#ifdef HAVE_HWSLIP
+#if HAVE_HWSLIP
#include <linux/if_slip.h>
#include <net/if_arp.h>
#endif
@@ -437,7 +437,7 @@ int if_fetch(struct interface *ife)
else
ife->mtu = ifr.ifr_mtu;
-#ifdef HAVE_HWSLIP
+#if HAVE_HWSLIP
if (ife->type == ARPHRD_SLIP || ife->type == ARPHRD_CSLIP ||
ife->type == ARPHRD_SLIP6 || ife->type == ARPHRD_CSLIP6 ||
ife->type == ARPHRD_ADAPT) {
@@ -682,8 +682,10 @@ void ife_print_long(struct interface *ptr)
hf = ptr->type;
+#if HAVE_HWSLIP
if (hf == ARPHRD_CSLIP || hf == ARPHRD_CSLIP6)
can_compress = 1;
+#endif
hw = get_hwntype(hf);
if (hw == NULL)
diff --git a/lib/net-support.h b/lib/net-support.h
index c963fe6..2820619 100644
--- a/lib/net-support.h
+++ b/lib/net-support.h
@@ -237,7 +237,7 @@ extern char afname[];
/* this is a 2.0.36 flag from /usr/src/linux/include/linux/route.h */
#define RTF_NOTCACHED 0x0400 /* this route isn't cached */
-#ifdef HAVE_AFECONET
+#if HAVE_AFECONET
#ifndef AF_ECONET
#define AF_ECONET 19 /* Acorn Econet */
#endif
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-11-21 1:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-21 1:38 [gentoo-commits] proj/net-tools:gentoo commit in: lib/, / Mike Frysinger
2011-11-21 1:35 ` [gentoo-commits] proj/net-tools:master " Mike Frysinger
-- strict thread matches above, loose matches on Subject: below --
2011-11-21 1:35 Mike Frysinger
2011-04-09 13:58 Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox