1 |
commit: 97b31ceedcfc909b4e8479ad8f7ea4f47fb5336d |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Nov 21 00:20:46 2011 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Nov 21 00:46:38 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/net-tools.git;a=commit;h=97b31cee |
7 |
|
8 |
clean up const/unsigned pointers with aftype/hwtype structs |
9 |
|
10 |
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org> |
11 |
|
12 |
--- |
13 |
arp.c | 6 +++--- |
14 |
lib/arcnet.c | 2 +- |
15 |
lib/ash.c | 6 +++--- |
16 |
lib/ax25.c | 4 ++-- |
17 |
lib/ddp.c | 4 ++-- |
18 |
lib/econet.c | 8 ++++---- |
19 |
lib/ether.c | 2 +- |
20 |
lib/eui64.c | 2 +- |
21 |
lib/fddi.c | 2 +- |
22 |
lib/frame.c | 2 +- |
23 |
lib/hippi.c | 2 +- |
24 |
lib/ib.c | 2 +- |
25 |
lib/inet.c | 4 ++-- |
26 |
lib/inet6.c | 4 ++-- |
27 |
lib/ipx.c | 4 ++-- |
28 |
lib/irda.c | 2 +- |
29 |
lib/loopback.c | 2 +- |
30 |
lib/net-support.h | 6 +++--- |
31 |
lib/netrom.c | 4 ++-- |
32 |
lib/rose.c | 6 +++--- |
33 |
lib/strip.c | 4 ++-- |
34 |
lib/tr.c | 2 +- |
35 |
lib/tunnel.c | 2 +- |
36 |
lib/unix.c | 8 ++++---- |
37 |
lib/x25.c | 6 +++--- |
38 |
25 files changed, 48 insertions(+), 48 deletions(-) |
39 |
|
40 |
diff --git a/arp.c b/arp.c |
41 |
index 924f416..8a376ec 100644 |
42 |
--- a/arp.c |
43 |
+++ b/arp.c |
44 |
@@ -434,7 +434,7 @@ static int arp_file(char *name) |
45 |
|
46 |
|
47 |
/* Print the contents of an ARP request block. */ |
48 |
-static void arp_disp_2(char *name, int type, int arp_flags, char *hwa, char *mask, char *dev) |
49 |
+static void arp_disp_2(const char *name, int type, int arp_flags, const char *hwa, const char *mask, const char *dev) |
50 |
{ |
51 |
static int title = 0; |
52 |
struct hwtype *xhw; |
53 |
@@ -484,7 +484,7 @@ static void arp_disp_2(char *name, int type, int arp_flags, char *hwa, char *mas |
54 |
} |
55 |
|
56 |
/* Print the contents of an ARP request block. */ |
57 |
-static void arp_disp(char *name, char *ip, int type, int arp_flags, char *hwa, char *mask, char *dev) |
58 |
+static void arp_disp(const char *name, const char *ip, int type, int arp_flags, const char *hwa, const char *mask, const char *dev) |
59 |
{ |
60 |
struct hwtype *xhw; |
61 |
|
62 |
@@ -538,7 +538,7 @@ static int arp_show(char *name) |
63 |
char dev[100]; |
64 |
int type, flags; |
65 |
FILE *fp; |
66 |
- char *hostname; |
67 |
+ const char *hostname; |
68 |
int num, entries = 0, showed = 0; |
69 |
|
70 |
host[0] = '\0'; |
71 |
|
72 |
diff --git a/lib/arcnet.c b/lib/arcnet.c |
73 |
index eb0f46e..35a2b9a 100644 |
74 |
--- a/lib/arcnet.c |
75 |
+++ b/lib/arcnet.c |
76 |
@@ -35,7 +35,7 @@ extern struct hwtype arcnet_hwtype; |
77 |
|
78 |
|
79 |
/* Display an ARCnet address in readable format. */ |
80 |
-static char *pr_arcnet(unsigned char *ptr) |
81 |
+static const char *pr_arcnet(const char *ptr) |
82 |
{ |
83 |
static char buff[64]; |
84 |
|
85 |
|
86 |
diff --git a/lib/ash.c b/lib/ash.c |
87 |
index c64667c..addb6fd 100644 |
88 |
--- a/lib/ash.c |
89 |
+++ b/lib/ash.c |
90 |
@@ -31,8 +31,8 @@ static unsigned char hamming[16] = |
91 |
}; |
92 |
|
93 |
/* Display an Ash address in readable format. */ |
94 |
-static char * |
95 |
-pr_ash(unsigned char *ptr) |
96 |
+static const char * |
97 |
+pr_ash(const char *ptr) |
98 |
{ |
99 |
static char buff[128]; |
100 |
char *p = buff; |
101 |
@@ -102,7 +102,7 @@ struct hwtype ash_hwtype = |
102 |
#if HAVE_AFASH |
103 |
|
104 |
/* Display an Ash socket address. */ |
105 |
-static char * |
106 |
+static const char * |
107 |
pr_sash(struct sockaddr *sap, int numeric) |
108 |
{ |
109 |
static char buf[64]; |
110 |
|
111 |
diff --git a/lib/ax25.c b/lib/ax25.c |
112 |
index 11521d2..209e479 100644 |
113 |
--- a/lib/ax25.c |
114 |
+++ b/lib/ax25.c |
115 |
@@ -47,7 +47,7 @@ static char AX25_errmsg[128]; |
116 |
|
117 |
extern struct aftype ax25_aftype; |
118 |
|
119 |
-static char *AX25_print(unsigned char *ptr) |
120 |
+static const char *AX25_print(const char *ptr) |
121 |
{ |
122 |
static char buff[8]; |
123 |
int i; |
124 |
@@ -66,7 +66,7 @@ static char *AX25_print(unsigned char *ptr) |
125 |
|
126 |
|
127 |
/* Display an AX.25 socket address. */ |
128 |
-static char * |
129 |
+static const char * |
130 |
AX25_sprint(struct sockaddr *sap, int numeric) |
131 |
{ |
132 |
static char buf[64]; |
133 |
|
134 |
diff --git a/lib/ddp.c b/lib/ddp.c |
135 |
index 9b5e829..0a08fd2 100644 |
136 |
--- a/lib/ddp.c |
137 |
+++ b/lib/ddp.c |
138 |
@@ -32,7 +32,7 @@ |
139 |
#include "util.h" |
140 |
|
141 |
/* Display a ddp domain address. */ |
142 |
-static char *ddp_print(unsigned char *ptr) |
143 |
+static const char *ddp_print(const char *ptr) |
144 |
{ |
145 |
static char buff[64]; |
146 |
struct sockaddr_at *sat = (struct sockaddr_at *) (ptr - 2); |
147 |
@@ -42,7 +42,7 @@ static char *ddp_print(unsigned char *ptr) |
148 |
|
149 |
|
150 |
/* Display a ddp domain address. */ |
151 |
-static char *ddp_sprint(struct sockaddr *sap, int numeric) |
152 |
+static const char *ddp_sprint(struct sockaddr *sap, int numeric) |
153 |
{ |
154 |
static char buf[64]; |
155 |
|
156 |
|
157 |
diff --git a/lib/econet.c b/lib/econet.c |
158 |
index 1229a28..05f09c9 100644 |
159 |
--- a/lib/econet.c |
160 |
+++ b/lib/econet.c |
161 |
@@ -32,8 +32,8 @@ |
162 |
|
163 |
|
164 |
/* Display an Econet address */ |
165 |
-static char * |
166 |
-ec_print(unsigned char *ptr) |
167 |
+static const char * |
168 |
+ec_print(const char *ptr) |
169 |
{ |
170 |
static char buff[64]; |
171 |
struct ec_addr *ec = (struct ec_addr *) ptr; |
172 |
@@ -43,7 +43,7 @@ ec_print(unsigned char *ptr) |
173 |
|
174 |
|
175 |
/* Display an Econet socket address */ |
176 |
-static char * |
177 |
+static const char * |
178 |
ec_sprint(struct sockaddr *sap, int numeric) |
179 |
{ |
180 |
struct sockaddr_ec *sec = (struct sockaddr_ec *) sap; |
181 |
@@ -51,7 +51,7 @@ ec_sprint(struct sockaddr *sap, int numeric) |
182 |
if (sap->sa_family != AF_ECONET) |
183 |
return _("[NONE SET]"); |
184 |
|
185 |
- return ec_print((unsigned char *) &sec->addr); |
186 |
+ return ec_print((const char *) &sec->addr); |
187 |
} |
188 |
|
189 |
static int |
190 |
|
191 |
diff --git a/lib/ether.c b/lib/ether.c |
192 |
index 70a6daf..ddd1598 100644 |
193 |
--- a/lib/ether.c |
194 |
+++ b/lib/ether.c |
195 |
@@ -35,7 +35,7 @@ extern struct hwtype ether_hwtype; |
196 |
|
197 |
|
198 |
/* Display an Ethernet address in readable format. */ |
199 |
-static char *pr_ether(unsigned char *ptr) |
200 |
+static const char *pr_ether(const char *ptr) |
201 |
{ |
202 |
static char buff[64]; |
203 |
|
204 |
|
205 |
diff --git a/lib/eui64.c b/lib/eui64.c |
206 |
index 64c3614..6ab7d26 100644 |
207 |
--- a/lib/eui64.c |
208 |
+++ b/lib/eui64.c |
209 |
@@ -49,7 +49,7 @@ |
210 |
struct hwtype eui64_hwtype; |
211 |
|
212 |
/* Display an EUI-64 address in readable format. */ |
213 |
-static char *pr_eui64( unsigned char *ptr ) |
214 |
+static const char *pr_eui64(const char *ptr) |
215 |
{ |
216 |
static char buff[64]; |
217 |
|
218 |
|
219 |
diff --git a/lib/fddi.c b/lib/fddi.c |
220 |
index f6bf5ca..75adddd 100644 |
221 |
--- a/lib/fddi.c |
222 |
+++ b/lib/fddi.c |
223 |
@@ -46,7 +46,7 @@ extern struct hwtype fddi_hwtype; |
224 |
|
225 |
|
226 |
/* Display an FDDI address in readable format. */ |
227 |
-static char *pr_fddi(unsigned char *ptr) |
228 |
+static const char *pr_fddi(const char *ptr) |
229 |
{ |
230 |
static char buff[64]; |
231 |
|
232 |
|
233 |
diff --git a/lib/frame.c b/lib/frame.c |
234 |
index 58d1ad4..ad265d6 100644 |
235 |
--- a/lib/frame.c |
236 |
+++ b/lib/frame.c |
237 |
@@ -37,7 +37,7 @@ |
238 |
#include "net-support.h" |
239 |
#include "pathnames.h" |
240 |
|
241 |
-char *pr_dlci(unsigned char *ptr) |
242 |
+static const char *pr_dlci(const char *ptr) |
243 |
{ |
244 |
static char buf[12]; |
245 |
|
246 |
|
247 |
diff --git a/lib/hippi.c b/lib/hippi.c |
248 |
index 308db00..bd73ea1 100644 |
249 |
--- a/lib/hippi.c |
250 |
+++ b/lib/hippi.c |
251 |
@@ -46,7 +46,7 @@ extern struct hwtype hippi_hwtype; |
252 |
|
253 |
|
254 |
/* Display an HIPPI address in readable format. */ |
255 |
-static char *pr_hippi(unsigned char *ptr) |
256 |
+static const char *pr_hippi(const char *ptr) |
257 |
{ |
258 |
static char buff[64]; |
259 |
|
260 |
|
261 |
diff --git a/lib/ib.c b/lib/ib.c |
262 |
index 72281a1..e05bd3e 100644 |
263 |
--- a/lib/ib.c |
264 |
+++ b/lib/ib.c |
265 |
@@ -36,7 +36,7 @@ extern struct hwtype ib_hwtype; |
266 |
|
267 |
|
268 |
/* Display an InfiniBand address in readable format. */ |
269 |
-static char *pr_ib(unsigned char *ptr) |
270 |
+static const char *pr_ib(const char *ptr) |
271 |
{ |
272 |
static char buff[128]; |
273 |
char *pos; |
274 |
|
275 |
diff --git a/lib/inet.c b/lib/inet.c |
276 |
index 60e55df..49fcee8 100644 |
277 |
--- a/lib/inet.c |
278 |
+++ b/lib/inet.c |
279 |
@@ -229,14 +229,14 @@ static void INET_reserror(char *text) |
280 |
|
281 |
|
282 |
/* Display an Internet socket address. */ |
283 |
-static char *INET_print(unsigned char *ptr) |
284 |
+static const char *INET_print(const char *ptr) |
285 |
{ |
286 |
return (inet_ntoa((*(struct in_addr *) ptr))); |
287 |
} |
288 |
|
289 |
|
290 |
/* Display an Internet socket address. */ |
291 |
-static char *INET_sprint(struct sockaddr *sap, int numeric) |
292 |
+static const char *INET_sprint(struct sockaddr *sap, int numeric) |
293 |
{ |
294 |
static char buff[128]; |
295 |
|
296 |
|
297 |
diff --git a/lib/inet6.c b/lib/inet6.c |
298 |
index c8406fd..5f00430 100644 |
299 |
--- a/lib/inet6.c |
300 |
+++ b/lib/inet6.c |
301 |
@@ -126,7 +126,7 @@ static void INET6_reserror(char *text) |
302 |
|
303 |
|
304 |
/* Display an Internet socket address. */ |
305 |
-static char *INET6_print(unsigned char *ptr) |
306 |
+static const char *INET6_print(const char *ptr) |
307 |
{ |
308 |
static char name[80]; |
309 |
|
310 |
@@ -137,7 +137,7 @@ static char *INET6_print(unsigned char *ptr) |
311 |
|
312 |
/* Display an Internet socket address. */ |
313 |
/* dirty! struct sockaddr usually doesn't suffer for inet6 addresses, fst. */ |
314 |
-static char *INET6_sprint(struct sockaddr *sap, int numeric) |
315 |
+static const char *INET6_sprint(struct sockaddr *sap, int numeric) |
316 |
{ |
317 |
static char buff[128]; |
318 |
|
319 |
|
320 |
diff --git a/lib/ipx.c b/lib/ipx.c |
321 |
index 13d2761..1359f5f 100644 |
322 |
--- a/lib/ipx.c |
323 |
+++ b/lib/ipx.c |
324 |
@@ -42,7 +42,7 @@ |
325 |
#endif |
326 |
|
327 |
/* Display a ipx domain address. */ |
328 |
-static char *IPX_print(unsigned char *ptr) |
329 |
+static const char *IPX_print(const char *ptr) |
330 |
{ |
331 |
static char buff[64]; |
332 |
struct sockaddr_ipx *sipx = (struct sockaddr_ipx *) (ptr - 2); |
333 |
@@ -73,7 +73,7 @@ static char *IPX_print(unsigned char *ptr) |
334 |
|
335 |
|
336 |
/* Display a ipx domain address. */ |
337 |
-static char *IPX_sprint(struct sockaddr *sap, int numeric) |
338 |
+static const char *IPX_sprint(struct sockaddr *sap, int numeric) |
339 |
{ |
340 |
static char buf[64]; |
341 |
|
342 |
|
343 |
diff --git a/lib/irda.c b/lib/irda.c |
344 |
index 598e6f0..a64876b 100644 |
345 |
--- a/lib/irda.c |
346 |
+++ b/lib/irda.c |
347 |
@@ -59,7 +59,7 @@ |
348 |
* Print hardware address of interface |
349 |
* |
350 |
*/ |
351 |
-static char *irda_print(unsigned char *ptr) |
352 |
+static const char *irda_print(const char *ptr) |
353 |
{ |
354 |
static char buff[12]; |
355 |
|
356 |
|
357 |
diff --git a/lib/loopback.c b/lib/loopback.c |
358 |
index 0f08ac2..1b7e9cc 100644 |
359 |
--- a/lib/loopback.c |
360 |
+++ b/lib/loopback.c |
361 |
@@ -32,7 +32,7 @@ |
362 |
#include "util.h" |
363 |
|
364 |
/* Display an UNSPEC address. */ |
365 |
-static char *pr_unspec(unsigned char *ptr) |
366 |
+static const char *pr_unspec(const char *ptr) |
367 |
{ |
368 |
static char buff[64]; |
369 |
char *pos; |
370 |
|
371 |
diff --git a/lib/net-support.h b/lib/net-support.h |
372 |
index dae15ac..d7a19d5 100644 |
373 |
--- a/lib/net-support.h |
374 |
+++ b/lib/net-support.h |
375 |
@@ -38,8 +38,8 @@ struct aftype { |
376 |
char *title; |
377 |
int af; |
378 |
int alen; |
379 |
- char *(*print) (unsigned char *); |
380 |
- char *(*sprint) (struct sockaddr *, int numeric); |
381 |
+ const char *(*print) (const char *); |
382 |
+ const char *(*sprint) (struct sockaddr *, int numeric); |
383 |
int (*input) (int type, char *bufp, struct sockaddr *); |
384 |
void (*herror) (char *text); |
385 |
int (*rprint) (int options); |
386 |
@@ -60,7 +60,7 @@ struct hwtype { |
387 |
char *title; |
388 |
int type; |
389 |
int alen; |
390 |
- char *(*print) (unsigned char *); |
391 |
+ const char *(*print) (const char *); |
392 |
int (*input) (char *, struct sockaddr *); |
393 |
int (*activate) (int fd); |
394 |
int suppress_null_addr; |
395 |
|
396 |
diff --git a/lib/netrom.c b/lib/netrom.c |
397 |
index 1de9dc3..f3033c7 100644 |
398 |
--- a/lib/netrom.c |
399 |
+++ b/lib/netrom.c |
400 |
@@ -52,7 +52,7 @@ static char netrom_errmsg[128]; |
401 |
|
402 |
extern struct aftype netrom_aftype; |
403 |
|
404 |
-static char *NETROM_print(unsigned char *ptr) |
405 |
+static const char *NETROM_print(const char *ptr) |
406 |
{ |
407 |
static char buff[8]; |
408 |
int i; |
409 |
@@ -71,7 +71,7 @@ static char *NETROM_print(unsigned char *ptr) |
410 |
|
411 |
|
412 |
/* Display an AX.25 socket address. */ |
413 |
-static char *NETROM_sprint(struct sockaddr *sap, int numeric) |
414 |
+static const char *NETROM_sprint(struct sockaddr *sap, int numeric) |
415 |
{ |
416 |
char buf[64]; |
417 |
if (sap->sa_family == 0xFFFF || sap->sa_family == 0) |
418 |
|
419 |
diff --git a/lib/rose.c b/lib/rose.c |
420 |
index 381226b..52d025a 100644 |
421 |
--- a/lib/rose.c |
422 |
+++ b/lib/rose.c |
423 |
@@ -53,8 +53,8 @@ static char ROSE_errmsg[128]; |
424 |
|
425 |
extern struct aftype rose_aftype; |
426 |
|
427 |
-static char * |
428 |
- ROSE_print(unsigned char *ptr) |
429 |
+static const char * |
430 |
+ ROSE_print(const char *ptr) |
431 |
{ |
432 |
static char buff[12]; |
433 |
|
434 |
@@ -64,7 +64,7 @@ static char * |
435 |
} |
436 |
|
437 |
/* Display a ROSE socket address. */ |
438 |
-static char * |
439 |
+static const char * |
440 |
ROSE_sprint(struct sockaddr *sap, int numeric) |
441 |
{ |
442 |
if (sap->sa_family == 0xFFFF || sap->sa_family == 0) |
443 |
|
444 |
diff --git a/lib/strip.c b/lib/strip.c |
445 |
index fd396ba..ced2325 100644 |
446 |
--- a/lib/strip.c |
447 |
+++ b/lib/strip.c |
448 |
@@ -38,8 +38,8 @@ |
449 |
|
450 |
extern struct hwtype strip_hwtype; |
451 |
|
452 |
-static char * |
453 |
-pr_strip(unsigned char *ptr) |
454 |
+static const char * |
455 |
+pr_strip(const char *ptr) |
456 |
{ |
457 |
static char buff[64]; |
458 |
if(ptr[1]) |
459 |
|
460 |
diff --git a/lib/tr.c b/lib/tr.c |
461 |
index c75f256..961cdb1 100644 |
462 |
--- a/lib/tr.c |
463 |
+++ b/lib/tr.c |
464 |
@@ -39,7 +39,7 @@ extern struct hwtype tr_hwtype; |
465 |
extern struct hwtype tr_hwtype1; |
466 |
#endif |
467 |
|
468 |
-static char *pr_tr(unsigned char *ptr) |
469 |
+static const char *pr_tr(const char *ptr) |
470 |
{ |
471 |
static char buff[64]; |
472 |
|
473 |
|
474 |
diff --git a/lib/tunnel.c b/lib/tunnel.c |
475 |
index 19606c1..8a160bf 100644 |
476 |
--- a/lib/tunnel.c |
477 |
+++ b/lib/tunnel.c |
478 |
@@ -21,7 +21,7 @@ |
479 |
|
480 |
extern struct hwtype ether_hwtype; |
481 |
|
482 |
-static char *pr_tunnel(unsigned char *ptr) |
483 |
+static const char *pr_tunnel(const char *ptr) |
484 |
{ |
485 |
return (""); |
486 |
} |
487 |
|
488 |
diff --git a/lib/unix.c b/lib/unix.c |
489 |
index fb4dcce..936cd48 100644 |
490 |
--- a/lib/unix.c |
491 |
+++ b/lib/unix.c |
492 |
@@ -32,7 +32,7 @@ |
493 |
|
494 |
|
495 |
/* Display an UNSPEC address. */ |
496 |
-static char *UNSPEC_print(unsigned char *ptr) |
497 |
+static const char *UNSPEC_print(const char *ptr) |
498 |
{ |
499 |
static char buff[64]; |
500 |
char *pos; |
501 |
@@ -48,7 +48,7 @@ static char *UNSPEC_print(unsigned char *ptr) |
502 |
|
503 |
|
504 |
/* Display an UNSPEC socket address. */ |
505 |
-static char *UNSPEC_sprint(struct sockaddr *sap, int numeric) |
506 |
+static const char *UNSPEC_sprint(struct sockaddr *sap, int numeric) |
507 |
{ |
508 |
static char buf[64]; |
509 |
|
510 |
@@ -61,14 +61,14 @@ static char *UNSPEC_sprint(struct sockaddr *sap, int numeric) |
511 |
#if HAVE_AFUNIX |
512 |
|
513 |
/* Display a UNIX domain address. */ |
514 |
-static char *UNIX_print(unsigned char *ptr) |
515 |
+static const char *UNIX_print(const char *ptr) |
516 |
{ |
517 |
return (ptr); |
518 |
} |
519 |
|
520 |
|
521 |
/* Display a UNIX domain address. */ |
522 |
-static char *UNIX_sprint(struct sockaddr *sap, int numeric) |
523 |
+static const char *UNIX_sprint(struct sockaddr *sap, int numeric) |
524 |
{ |
525 |
static char buf[64]; |
526 |
|
527 |
|
528 |
diff --git a/lib/x25.c b/lib/x25.c |
529 |
index 1ffb569..d795ca9 100644 |
530 |
--- a/lib/x25.c |
531 |
+++ b/lib/x25.c |
532 |
@@ -50,8 +50,8 @@ extern struct aftype x25_aftype; |
533 |
#endif |
534 |
|
535 |
|
536 |
-static char * |
537 |
-X25_print(unsigned char *ptr) |
538 |
+static const char * |
539 |
+X25_print(const char *ptr) |
540 |
{ |
541 |
static char buff[X25_ADDR_LEN+1]; |
542 |
|
543 |
@@ -63,7 +63,7 @@ X25_print(unsigned char *ptr) |
544 |
|
545 |
|
546 |
/* Display an X.25 socket address. */ |
547 |
-static char * |
548 |
+static const char * |
549 |
X25_sprint(struct sockaddr *sap, int numeric) |
550 |
{ |
551 |
if (sap->sa_family == 0xFFFF || sap->sa_family == 0) |