diff options
| author | Mike Frysinger <vapier@gentoo.org> | 2006-02-19 22:59:12 +0000 |
|---|---|---|
| committer | Mike Frysinger <vapier@gentoo.org> | 2006-02-19 22:59:12 +0000 |
| commit | 294254ce6bd03047fb2ccf0549387cd1e2c3f0c5 (patch) | |
| tree | 2f1353c65e19834a43d3b78cff26801a971cf2b6 | |
| parent | da2a7d6b20e34472997429bea4dde1a3121b20cc (diff) | |
| download | busybox-w32-294254ce6bd03047fb2ccf0549387cd1e2c3f0c5.tar.gz busybox-w32-294254ce6bd03047fb2ccf0549387cd1e2c3f0c5.tar.bz2 busybox-w32-294254ce6bd03047fb2ccf0549387cd1e2c3f0c5.zip | |
rfelker writes in Bug 740: s/u_char/unsigned char/
| -rw-r--r-- | libbb/dump.c | 24 | ||||
| -rw-r--r-- | networking/traceroute.c | 34 |
2 files changed, 29 insertions, 29 deletions
diff --git a/libbb/dump.c b/libbb/dump.c index 09db24692..c09abf8c4 100644 --- a/libbb/dump.c +++ b/libbb/dump.c | |||
| @@ -352,18 +352,18 @@ static int next(char **argv) | |||
| 352 | /* NOTREACHED */ | 352 | /* NOTREACHED */ |
| 353 | } | 353 | } |
| 354 | 354 | ||
| 355 | static u_char *get(void) | 355 | static unsigned char *get(void) |
| 356 | { | 356 | { |
| 357 | static int ateof = 1; | 357 | static int ateof = 1; |
| 358 | static u_char *curp=NULL, *savp; /*DBU:[dave@cray.com]initialize curp */ | 358 | static unsigned char *curp=NULL, *savp; /*DBU:[dave@cray.com]initialize curp */ |
| 359 | register int n; | 359 | register int n; |
| 360 | int need, nread; | 360 | int need, nread; |
| 361 | u_char *tmpp; | 361 | unsigned char *tmpp; |
| 362 | 362 | ||
| 363 | if (!curp) { | 363 | if (!curp) { |
| 364 | address = (off_t)0; /*DBU:[dave@cray.com] initialize,initialize..*/ | 364 | address = (off_t)0; /*DBU:[dave@cray.com] initialize,initialize..*/ |
| 365 | curp = (u_char *) xmalloc(bb_dump_blocksize); | 365 | curp = (unsigned char *) xmalloc(bb_dump_blocksize); |
| 366 | savp = (u_char *) xmalloc(bb_dump_blocksize); | 366 | savp = (unsigned char *) xmalloc(bb_dump_blocksize); |
| 367 | } else { | 367 | } else { |
| 368 | tmpp = curp; | 368 | tmpp = curp; |
| 369 | curp = savp; | 369 | curp = savp; |
| @@ -378,19 +378,19 @@ static u_char *get(void) | |||
| 378 | */ | 378 | */ |
| 379 | if (!bb_dump_length || (ateof && !next((char **) NULL))) { | 379 | if (!bb_dump_length || (ateof && !next((char **) NULL))) { |
| 380 | if (need == bb_dump_blocksize) { | 380 | if (need == bb_dump_blocksize) { |
| 381 | return ((u_char *) NULL); | 381 | return ((unsigned char *) NULL); |
| 382 | } | 382 | } |
| 383 | if (bb_dump_vflag != ALL && !bcmp(curp, savp, nread)) { | 383 | if (bb_dump_vflag != ALL && !bcmp(curp, savp, nread)) { |
| 384 | if (bb_dump_vflag != DUP) { | 384 | if (bb_dump_vflag != DUP) { |
| 385 | printf("*\n"); | 385 | printf("*\n"); |
| 386 | } | 386 | } |
| 387 | return ((u_char *) NULL); | 387 | return ((unsigned char *) NULL); |
| 388 | } | 388 | } |
| 389 | memset((char *) curp + nread, 0, need); | 389 | memset((char *) curp + nread, 0, need); |
| 390 | eaddress = address + nread; | 390 | eaddress = address + nread; |
| 391 | return (curp); | 391 | return (curp); |
| 392 | } | 392 | } |
| 393 | n = fread((char *) curp + nread, sizeof(u_char), | 393 | n = fread((char *) curp + nread, sizeof(unsigned char), |
| 394 | bb_dump_length == -1 ? need : MIN(bb_dump_length, need), stdin); | 394 | bb_dump_length == -1 ? need : MIN(bb_dump_length, need), stdin); |
| 395 | if (!n) { | 395 | if (!n) { |
| 396 | if (ferror(stdin)) { | 396 | if (ferror(stdin)) { |
| @@ -451,7 +451,7 @@ static const char conv_str[] = | |||
| 451 | "\0"; | 451 | "\0"; |
| 452 | 452 | ||
| 453 | 453 | ||
| 454 | static void conv_c(PR * pr, u_char * p) | 454 | static void conv_c(PR * pr, unsigned char * p) |
| 455 | { | 455 | { |
| 456 | const char *str = conv_str; | 456 | const char *str = conv_str; |
| 457 | char buf[10]; | 457 | char buf[10]; |
| @@ -476,7 +476,7 @@ static void conv_c(PR * pr, u_char * p) | |||
| 476 | } | 476 | } |
| 477 | } | 477 | } |
| 478 | 478 | ||
| 479 | static void conv_u(PR * pr, u_char * p) | 479 | static void conv_u(PR * pr, unsigned char * p) |
| 480 | { | 480 | { |
| 481 | static const char list[] = | 481 | static const char list[] = |
| 482 | "nul\0soh\0stx\0etx\0eot\0enq\0ack\0bel\0" | 482 | "nul\0soh\0stx\0etx\0eot\0enq\0ack\0bel\0" |
| @@ -507,10 +507,10 @@ static void display(void) | |||
| 507 | register FU *fu; | 507 | register FU *fu; |
| 508 | register PR *pr; | 508 | register PR *pr; |
| 509 | register int cnt; | 509 | register int cnt; |
| 510 | register u_char *bp; | 510 | register unsigned char *bp; |
| 511 | 511 | ||
| 512 | off_t saveaddress; | 512 | off_t saveaddress; |
| 513 | u_char savech = 0, *savebp; | 513 | unsigned char savech = 0, *savebp; |
| 514 | 514 | ||
| 515 | while ((bp = get()) != NULL) { | 515 | while ((bp = get()) != NULL) { |
| 516 | for (fs = bb_dump_fshead, savebp = bp, saveaddress = address; fs; | 516 | for (fs = bb_dump_fshead, savebp = bp, saveaddress = address; fs; |
diff --git a/networking/traceroute.c b/networking/traceroute.c index a9292a284..e6011cc47 100644 --- a/networking/traceroute.c +++ b/networking/traceroute.c | |||
| @@ -243,8 +243,8 @@ | |||
| 243 | * Overlay for ip header used by other protocols (tcp, udp). | 243 | * Overlay for ip header used by other protocols (tcp, udp). |
| 244 | */ | 244 | */ |
| 245 | struct ipovly { | 245 | struct ipovly { |
| 246 | u_char ih_x1[9]; /* (unused) */ | 246 | unsigned char ih_x1[9]; /* (unused) */ |
| 247 | u_char ih_pr; /* protocol */ | 247 | unsigned char ih_pr; /* protocol */ |
| 248 | short ih_len; /* protocol length */ | 248 | short ih_len; /* protocol length */ |
| 249 | struct in_addr ih_src; /* source internet address */ | 249 | struct in_addr ih_src; /* source internet address */ |
| 250 | struct in_addr ih_dst; /* destination internet address */ | 250 | struct in_addr ih_dst; /* destination internet address */ |
| @@ -279,8 +279,8 @@ struct hostinfo { | |||
| 279 | 279 | ||
| 280 | /* Data section of the probe packet */ | 280 | /* Data section of the probe packet */ |
| 281 | struct outdata { | 281 | struct outdata { |
| 282 | u_char seq; /* sequence number of this packet */ | 282 | unsigned char seq; /* sequence number of this packet */ |
| 283 | u_char ttl; /* ttl packet left with */ | 283 | unsigned char ttl; /* ttl packet left with */ |
| 284 | struct timeval tv ATTRIBUTE_PACKED; /* time packet left */ | 284 | struct timeval tv ATTRIBUTE_PACKED; /* time packet left */ |
| 285 | }; | 285 | }; |
| 286 | 286 | ||
| @@ -293,7 +293,7 @@ struct IFADDRLIST { | |||
| 293 | static const char route[] = "/proc/net/route"; | 293 | static const char route[] = "/proc/net/route"; |
| 294 | 294 | ||
| 295 | /* last inbound (icmp) packet */ | 295 | /* last inbound (icmp) packet */ |
| 296 | static u_char packet[512] ATTRIBUTE_ALIGNED(32); | 296 | static unsigned char packet[512] ATTRIBUTE_ALIGNED(32); |
| 297 | 297 | ||
| 298 | static struct ip *outip; /* last output (udp) packet */ | 298 | static struct ip *outip; /* last output (udp) packet */ |
| 299 | static struct udphdr *outudp; /* last output (udp) packet */ | 299 | static struct udphdr *outudp; /* last output (udp) packet */ |
| @@ -596,7 +596,7 @@ in_cksum(u_short *addr, int len) | |||
| 596 | 596 | ||
| 597 | /* mop up an odd byte, if necessary */ | 597 | /* mop up an odd byte, if necessary */ |
| 598 | if (nleft == 1) | 598 | if (nleft == 1) |
| 599 | sum += *(u_char *)w; | 599 | sum += *(unsigned char *)w; |
| 600 | 600 | ||
| 601 | /* | 601 | /* |
| 602 | * add back carry outs from top 16 bits to low 16 bits | 602 | * add back carry outs from top 16 bits to low 16 bits |
| @@ -689,7 +689,7 @@ send_probe(int seq, int ttl, struct timeval *tp) | |||
| 689 | if (packlen & 1) { | 689 | if (packlen & 1) { |
| 690 | if ((i % 8) == 0) | 690 | if ((i % 8) == 0) |
| 691 | printf("\n\t"); | 691 | printf("\n\t"); |
| 692 | printf(" %02x", *(u_char *)sp); | 692 | printf(" %02x", *(unsigned char *)sp); |
| 693 | } | 693 | } |
| 694 | printf("]\n"); | 694 | printf("]\n"); |
| 695 | } | 695 | } |
| @@ -728,7 +728,7 @@ deltaT(struct timeval *t1p, struct timeval *t2p) | |||
| 728 | * Convert an ICMP "type" field to a printable string. | 728 | * Convert an ICMP "type" field to a printable string. |
| 729 | */ | 729 | */ |
| 730 | static inline const char * | 730 | static inline const char * |
| 731 | pr_type(u_char t) | 731 | pr_type(unsigned char t) |
| 732 | { | 732 | { |
| 733 | static const char * const ttab[] = { | 733 | static const char * const ttab[] = { |
| 734 | "Echo Reply", "ICMP 1", "ICMP 2", "Dest Unreachable", | 734 | "Echo Reply", "ICMP 1", "ICMP 2", "Dest Unreachable", |
| @@ -746,10 +746,10 @@ pr_type(u_char t) | |||
| 746 | #endif | 746 | #endif |
| 747 | 747 | ||
| 748 | static int | 748 | static int |
| 749 | packet_ok(u_char *buf, int cc, struct sockaddr_in *from, int seq) | 749 | packet_ok(unsigned char *buf, int cc, struct sockaddr_in *from, int seq) |
| 750 | { | 750 | { |
| 751 | struct icmp *icp; | 751 | struct icmp *icp; |
| 752 | u_char type, code; | 752 | unsigned char type, code; |
| 753 | int hlen; | 753 | int hlen; |
| 754 | struct ip *ip; | 754 | struct ip *ip; |
| 755 | 755 | ||
| @@ -790,7 +790,7 @@ packet_ok(u_char *buf, int cc, struct sockaddr_in *from, int seq) | |||
| 790 | icp->icmp_seq == htons(seq)) | 790 | icp->icmp_seq == htons(seq)) |
| 791 | return -2; | 791 | return -2; |
| 792 | 792 | ||
| 793 | hicmp = (struct icmp *)((u_char *)hip + hlen); | 793 | hicmp = (struct icmp *)((unsigned char *)hip + hlen); |
| 794 | /* XXX 8 is a magic number */ | 794 | /* XXX 8 is a magic number */ |
| 795 | if (hlen + 8 <= cc && | 795 | if (hlen + 8 <= cc && |
| 796 | hip->ip_p == IPPROTO_ICMP && | 796 | hip->ip_p == IPPROTO_ICMP && |
| @@ -800,7 +800,7 @@ packet_ok(u_char *buf, int cc, struct sockaddr_in *from, int seq) | |||
| 800 | } else | 800 | } else |
| 801 | #endif | 801 | #endif |
| 802 | { | 802 | { |
| 803 | up = (struct udphdr *)((u_char *)hip + hlen); | 803 | up = (struct udphdr *)((unsigned char *)hip + hlen); |
| 804 | /* XXX 8 is a magic number */ | 804 | /* XXX 8 is a magic number */ |
| 805 | if (hlen + 12 <= cc && | 805 | if (hlen + 12 <= cc && |
| 806 | hip->ip_p == IPPROTO_UDP && | 806 | hip->ip_p == IPPROTO_UDP && |
| @@ -850,7 +850,7 @@ inetname(struct sockaddr_in *from) | |||
| 850 | } | 850 | } |
| 851 | 851 | ||
| 852 | static inline void | 852 | static inline void |
| 853 | print(u_char *buf, int cc, struct sockaddr_in *from) | 853 | print(unsigned char *buf, int cc, struct sockaddr_in *from) |
| 854 | { | 854 | { |
| 855 | struct ip *ip; | 855 | struct ip *ip; |
| 856 | int hlen; | 856 | int hlen; |
| @@ -928,7 +928,7 @@ traceroute_main(int argc, char *argv[]) | |||
| 928 | { | 928 | { |
| 929 | int code, n; | 929 | int code, n; |
| 930 | char *cp; | 930 | char *cp; |
| 931 | u_char *outp; | 931 | unsigned char *outp; |
| 932 | u_int32_t *ap; | 932 | u_int32_t *ap; |
| 933 | struct sockaddr_in *from = (struct sockaddr_in *)&wherefrom; | 933 | struct sockaddr_in *from = (struct sockaddr_in *)&wherefrom; |
| 934 | struct sockaddr_in *to = (struct sockaddr_in *)&whereto; | 934 | struct sockaddr_in *to = (struct sockaddr_in *)&whereto; |
| @@ -1112,7 +1112,7 @@ traceroute_main(int argc, char *argv[]) | |||
| 1112 | #ifdef CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE | 1112 | #ifdef CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE |
| 1113 | #if defined(IP_OPTIONS) | 1113 | #if defined(IP_OPTIONS) |
| 1114 | if (lsrr > 0) { | 1114 | if (lsrr > 0) { |
| 1115 | u_char optlist[MAX_IPOPTLEN]; | 1115 | unsigned char optlist[MAX_IPOPTLEN]; |
| 1116 | 1116 | ||
| 1117 | cp = "ip"; | 1117 | cp = "ip"; |
| 1118 | if ((pe = getprotobyname(cp)) == NULL) | 1118 | if ((pe = getprotobyname(cp)) == NULL) |
| @@ -1179,10 +1179,10 @@ traceroute_main(int argc, char *argv[]) | |||
| 1179 | outip->ip_tos = tos; | 1179 | outip->ip_tos = tos; |
| 1180 | outip->ip_len = htons(packlen); | 1180 | outip->ip_len = htons(packlen); |
| 1181 | outip->ip_off = htons(off); | 1181 | outip->ip_off = htons(off); |
| 1182 | outp = (u_char *)(outip + 1); | 1182 | outp = (unsigned char *)(outip + 1); |
| 1183 | outip->ip_dst = to->sin_addr; | 1183 | outip->ip_dst = to->sin_addr; |
| 1184 | 1184 | ||
| 1185 | outip->ip_hl = (outp - (u_char *)outip) >> 2; | 1185 | outip->ip_hl = (outp - (unsigned char *)outip) >> 2; |
| 1186 | ident = (getpid() & 0xffff) | 0x8000; | 1186 | ident = (getpid() & 0xffff) | 0x8000; |
| 1187 | #ifdef CONFIG_FEATURE_TRACEROUTE_USE_ICMP | 1187 | #ifdef CONFIG_FEATURE_TRACEROUTE_USE_ICMP |
| 1188 | if (useicmp) { | 1188 | if (useicmp) { |
