|
12 | 12 |
|
13 | 13 | #include <stdio.h>
|
14 | 14 | #include <string.h>
|
| 15 | +#include <stdint.h> |
15 | 16 | #include <stdlib.h>
|
16 | 17 | #include <unistd.h>
|
17 | 18 | #include <assert.h>
|
@@ -60,7 +61,7 @@ static void print_type_name(enum symbol_type type, const char *name);
|
60 | 61 |
|
61 | 62 | /*----------------------------------------------------------------------*/
|
62 | 63 |
|
63 |
| -static const unsigned int crctab32[] = { |
| 64 | +static const uint32_t crctab32[] = { |
64 | 65 | 0x00000000U, 0x77073096U, 0xee0e612cU, 0x990951baU, 0x076dc419U,
|
65 | 66 | 0x706af48fU, 0xe963a535U, 0x9e6495a3U, 0x0edb8832U, 0x79dcb8a4U,
|
66 | 67 | 0xe0d5e91eU, 0x97d2d988U, 0x09b64c2bU, 0x7eb17cbdU, 0xe7b82d07U,
|
@@ -115,19 +116,19 @@ static const unsigned int crctab32[] = {
|
115 | 116 | 0x2d02ef8dU
|
116 | 117 | };
|
117 | 118 |
|
118 |
| -static unsigned long partial_crc32_one(unsigned char c, unsigned long crc) |
| 119 | +static uint32_t partial_crc32_one(uint8_t c, uint32_t crc) |
119 | 120 | {
|
120 | 121 | return crctab32[(crc ^ c) & 0xff] ^ (crc >> 8);
|
121 | 122 | }
|
122 | 123 |
|
123 |
| -static unsigned long partial_crc32(const char *s, unsigned long crc) |
| 124 | +static uint32_t partial_crc32(const char *s, uint32_t crc) |
124 | 125 | {
|
125 | 126 | while (*s)
|
126 | 127 | crc = partial_crc32_one(*s++, crc);
|
127 | 128 | return crc;
|
128 | 129 | }
|
129 | 130 |
|
130 |
| -static unsigned long crc32(const char *s) |
| 131 | +static uint32_t crc32(const char *s) |
131 | 132 | {
|
132 | 133 | return partial_crc32(s, 0xffffffff) ^ 0xffffffff;
|
133 | 134 | }
|
@@ -517,7 +518,7 @@ static void print_list(FILE * f, struct string_list *list)
|
517 | 518 | }
|
518 | 519 | }
|
519 | 520 |
|
520 |
| -static unsigned long expand_and_crc_sym(struct symbol *sym, unsigned long crc) |
| 521 | +static uint32_t expand_and_crc_sym(struct symbol *sym, uint32_t crc) |
521 | 522 | {
|
522 | 523 | struct string_list *list = sym->defn;
|
523 | 524 | struct string_list **e, **b;
|
@@ -624,7 +625,7 @@ static unsigned long expand_and_crc_sym(struct symbol *sym, unsigned long crc)
|
624 | 625 | void export_symbol(const char *name)
|
625 | 626 | {
|
626 | 627 | struct symbol *sym;
|
627 |
| - unsigned long crc; |
| 628 | + uint32_t crc; |
628 | 629 | int has_changed = 0;
|
629 | 630 |
|
630 | 631 | sym = find_symbol(name, SYM_NORMAL, 0);
|
@@ -672,7 +673,7 @@ void export_symbol(const char *name)
|
672 | 673 | if (flag_dump_defs)
|
673 | 674 | fputs(">\n", debugfile);
|
674 | 675 |
|
675 |
| - printf("#SYMVER %s 0x%08lx\n", name, crc); |
| 676 | + printf("#SYMVER %s 0x%08lx\n", name, (unsigned long)crc); |
676 | 677 | }
|
677 | 678 |
|
678 | 679 | /*----------------------------------------------------------------------*/
|
|
0 commit comments