diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-09-27 04:16:22 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-09-27 04:16:22 +0000 |
commit | f87b3e30a7e26aec499912accd2598e2e5aa24d6 (patch) | |
tree | 42a27734575c8b880c80a06b4e59e0432926bd18 /editors/awk.c | |
parent | 67451849def5ec162e230411c542b9d0e2608371 (diff) | |
download | busybox-w32-f87b3e30a7e26aec499912accd2598e2e5aa24d6.tar.gz busybox-w32-f87b3e30a7e26aec499912accd2598e2e5aa24d6.tar.bz2 busybox-w32-f87b3e30a7e26aec499912accd2598e2e5aa24d6.zip |
as pointed out in Bug 17, use uint32_t instead of unsigned long since the code expects the size of the info variables to be 32bits and sizeof(long) on 64bit hosts is not 32bits
Diffstat (limited to 'editors/awk.c')
-rw-r--r-- | editors/awk.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/editors/awk.c b/editors/awk.c index 6ef4c0f9d..087be44a5 100644 --- a/editors/awk.c +++ b/editors/awk.c | |||
@@ -108,7 +108,7 @@ typedef struct xhash_s { | |||
108 | 108 | ||
109 | /* Tree node */ | 109 | /* Tree node */ |
110 | typedef struct node_s { | 110 | typedef struct node_s { |
111 | unsigned long info; | 111 | uint32_t info; |
112 | unsigned short lineno; | 112 | unsigned short lineno; |
113 | union { | 113 | union { |
114 | struct node_s *n; | 114 | struct node_s *n; |
@@ -324,7 +324,7 @@ static char * const tokenlist = | |||
324 | "\3END" "\0" | 324 | "\3END" "\0" |
325 | ; | 325 | ; |
326 | 326 | ||
327 | static unsigned long tokeninfo[] = { | 327 | static uint32_t tokeninfo[] = { |
328 | 328 | ||
329 | 0, | 329 | 0, |
330 | 0, | 330 | 0, |
@@ -430,8 +430,8 @@ static int icase = FALSE; | |||
430 | static int exiting = FALSE; | 430 | static int exiting = FALSE; |
431 | 431 | ||
432 | static struct { | 432 | static struct { |
433 | unsigned long tclass; | 433 | uint32_t tclass; |
434 | unsigned long info; | 434 | uint32_t info; |
435 | char *string; | 435 | char *string; |
436 | double number; | 436 | double number; |
437 | short lineno; | 437 | short lineno; |
@@ -440,7 +440,7 @@ static struct { | |||
440 | 440 | ||
441 | /* function prototypes */ | 441 | /* function prototypes */ |
442 | static void handle_special(var *); | 442 | static void handle_special(var *); |
443 | static node *parse_expr(unsigned long); | 443 | static node *parse_expr(uint32_t); |
444 | static void chain_group(void); | 444 | static void chain_group(void); |
445 | static var *evaluate(node *, var *); | 445 | static var *evaluate(node *, var *); |
446 | static rstream *next_input_file(void); | 446 | static rstream *next_input_file(void); |
@@ -848,15 +848,15 @@ static void nvfree(var *v) | |||
848 | /* Parse next token pointed by global pos, place results into global t. | 848 | /* Parse next token pointed by global pos, place results into global t. |
849 | * If token isn't expected, give away. Return token class | 849 | * If token isn't expected, give away. Return token class |
850 | */ | 850 | */ |
851 | static unsigned long next_token(unsigned long expected) | 851 | static uint32_t next_token(uint32_t expected) |
852 | { | 852 | { |
853 | char *p, *pp, *s; | 853 | char *p, *pp, *s; |
854 | char *tl; | 854 | char *tl; |
855 | unsigned long tc, *ti; | 855 | uint32_t tc, *ti; |
856 | int l; | 856 | int l; |
857 | static int concat_inserted = FALSE; | 857 | static int concat_inserted = FALSE; |
858 | static unsigned long save_tclass, save_info; | 858 | static uint32_t save_tclass, save_info; |
859 | static unsigned long ltclass = TC_OPTERM; | 859 | static uint32_t ltclass = TC_OPTERM; |
860 | 860 | ||
861 | if (t.rollback) { | 861 | if (t.rollback) { |
862 | 862 | ||
@@ -999,7 +999,7 @@ static unsigned long next_token(unsigned long expected) | |||
999 | 999 | ||
1000 | static void rollback_token(void) { t.rollback = TRUE; } | 1000 | static void rollback_token(void) { t.rollback = TRUE; } |
1001 | 1001 | ||
1002 | static node *new_node(unsigned long info) | 1002 | static node *new_node(uint32_t info) |
1003 | { | 1003 | { |
1004 | register node *n; | 1004 | register node *n; |
1005 | 1005 | ||
@@ -1028,12 +1028,12 @@ static node *condition(void) | |||
1028 | 1028 | ||
1029 | /* parse expression terminated by given argument, return ptr | 1029 | /* parse expression terminated by given argument, return ptr |
1030 | * to built subtree. Terminator is eaten by parse_expr */ | 1030 | * to built subtree. Terminator is eaten by parse_expr */ |
1031 | static node *parse_expr(unsigned long iexp) | 1031 | static node *parse_expr(uint32_t iexp) |
1032 | { | 1032 | { |
1033 | node sn; | 1033 | node sn; |
1034 | node *cn = &sn; | 1034 | node *cn = &sn; |
1035 | node *vn, *glptr; | 1035 | node *vn, *glptr; |
1036 | unsigned long tc, xtc; | 1036 | uint32_t tc, xtc; |
1037 | var *v; | 1037 | var *v; |
1038 | 1038 | ||
1039 | sn.info = PRIMASK; | 1039 | sn.info = PRIMASK; |
@@ -1144,7 +1144,7 @@ static node *parse_expr(unsigned long iexp) | |||
1144 | } | 1144 | } |
1145 | 1145 | ||
1146 | /* add node to chain. Return ptr to alloc'd node */ | 1146 | /* add node to chain. Return ptr to alloc'd node */ |
1147 | static node *chain_node(unsigned long info) | 1147 | static node *chain_node(uint32_t info) |
1148 | { | 1148 | { |
1149 | register node *n; | 1149 | register node *n; |
1150 | 1150 | ||
@@ -1164,7 +1164,7 @@ static node *chain_node(unsigned long info) | |||
1164 | return n; | 1164 | return n; |
1165 | } | 1165 | } |
1166 | 1166 | ||
1167 | static void chain_expr(unsigned long info) | 1167 | static void chain_expr(uint32_t info) |
1168 | { | 1168 | { |
1169 | node *n; | 1169 | node *n; |
1170 | 1170 | ||
@@ -1200,7 +1200,7 @@ static node *chain_loop(node *nn) | |||
1200 | /* parse group and attach it to chain */ | 1200 | /* parse group and attach it to chain */ |
1201 | static void chain_group(void) | 1201 | static void chain_group(void) |
1202 | { | 1202 | { |
1203 | unsigned long c; | 1203 | uint32_t c; |
1204 | node *n, *n2, *n3; | 1204 | node *n, *n2, *n3; |
1205 | 1205 | ||
1206 | do { | 1206 | do { |
@@ -1302,7 +1302,7 @@ static void chain_group(void) | |||
1302 | 1302 | ||
1303 | static void parse_program(char *p) | 1303 | static void parse_program(char *p) |
1304 | { | 1304 | { |
1305 | unsigned long tclass; | 1305 | uint32_t tclass; |
1306 | node *cn; | 1306 | node *cn; |
1307 | func *f; | 1307 | func *f; |
1308 | var *v; | 1308 | var *v; |
@@ -1378,7 +1378,7 @@ static node *mk_splitter(char *s, tsplitter *spl) | |||
1378 | if (bb_strlen(s) > 1) { | 1378 | if (bb_strlen(s) > 1) { |
1379 | mk_re_node(s, n, re); | 1379 | mk_re_node(s, n, re); |
1380 | } else { | 1380 | } else { |
1381 | n->info = (unsigned long) *s; | 1381 | n->info = (uint32_t) *s; |
1382 | } | 1382 | } |
1383 | 1383 | ||
1384 | return n; | 1384 | return n; |
@@ -1881,7 +1881,7 @@ static var *exec_builtin(node *op, var *res) | |||
1881 | regex_t sreg, *re; | 1881 | regex_t sreg, *re; |
1882 | static tsplitter tspl; | 1882 | static tsplitter tspl; |
1883 | node *spl; | 1883 | node *spl; |
1884 | unsigned long isr, info; | 1884 | uint32_t isr, info; |
1885 | int nargs; | 1885 | int nargs; |
1886 | time_t tt; | 1886 | time_t tt; |
1887 | char *s, *s1; | 1887 | char *s, *s1; |
@@ -2044,7 +2044,7 @@ static var *evaluate(node *op, var *res) | |||
2044 | double d; | 2044 | double d; |
2045 | int i; | 2045 | int i; |
2046 | } L, R; | 2046 | } L, R; |
2047 | unsigned long opinfo; | 2047 | uint32_t opinfo; |
2048 | short opn; | 2048 | short opn; |
2049 | union { | 2049 | union { |
2050 | char *s; | 2050 | char *s; |
@@ -2052,7 +2052,7 @@ static var *evaluate(node *op, var *res) | |||
2052 | FILE *F; | 2052 | FILE *F; |
2053 | var *v; | 2053 | var *v; |
2054 | regex_t *re; | 2054 | regex_t *re; |
2055 | unsigned long info; | 2055 | uint32_t info; |
2056 | } X; | 2056 | } X; |
2057 | 2057 | ||
2058 | if (! op) | 2058 | if (! op) |