diff options
| author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-12 20:54:54 +0000 |
|---|---|---|
| committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-12 20:54:54 +0000 |
| commit | 3ad5d0cbbe3c6debc8d3431fadf973eff04b27bf (patch) | |
| tree | ea3c3db1efdd618bf819f97d73f93f276f309137 | |
| parent | fdcbc4e7095c225a8586dcb96a7a99c2d1007aeb (diff) | |
| download | busybox-w32-3ad5d0cbbe3c6debc8d3431fadf973eff04b27bf.tar.gz busybox-w32-3ad5d0cbbe3c6debc8d3431fadf973eff04b27bf.tar.bz2 busybox-w32-3ad5d0cbbe3c6debc8d3431fadf973eff04b27bf.zip | |
diff: shrink code (-85 bytes):
function old new delta
fiddle_sum 8 - -8
diffreg 2717 2690 -27
prepare 334 284 -50
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 0/2 up/down: 0/-85) Total: -85 bytes
s/ATTRIBUTE_ALWAYS_INLINE/ALWAYS_INLINE/g
| -rw-r--r-- | archival/libunarchive/decompress_unlzma.c | 10 | ||||
| -rw-r--r-- | editors/awk.c | 2 | ||||
| -rw-r--r-- | editors/diff.c | 54 | ||||
| -rw-r--r-- | include/libbb.h | 6 | ||||
| -rw-r--r-- | include/platform.h | 6 | ||||
| -rw-r--r-- | include/xatonum.h | 44 | ||||
| -rw-r--r-- | libbb/xatonum.c | 2 | ||||
| -rw-r--r-- | networking/zcip.c | 2 | ||||
| -rw-r--r-- | util-linux/fdisk.c | 6 | ||||
| -rw-r--r-- | util-linux/fsck_minix.c | 2 | ||||
| -rw-r--r-- | util-linux/mkfs_minix.c | 2 |
11 files changed, 69 insertions, 67 deletions
diff --git a/archival/libunarchive/decompress_unlzma.c b/archival/libunarchive/decompress_unlzma.c index 907e44e94..2800a7ecd 100644 --- a/archival/libunarchive/decompress_unlzma.c +++ b/archival/libunarchive/decompress_unlzma.c | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | #include "unarchive.h" | 13 | #include "unarchive.h" |
| 14 | 14 | ||
| 15 | #ifdef CONFIG_FEATURE_LZMA_FAST | 15 | #ifdef CONFIG_FEATURE_LZMA_FAST |
| 16 | # define speed_inline ATTRIBUTE_ALWAYS_INLINE | 16 | # define speed_inline ALWAYS_INLINE |
| 17 | #else | 17 | #else |
| 18 | # define speed_inline | 18 | # define speed_inline |
| 19 | #endif | 19 | #endif |
| @@ -78,7 +78,7 @@ static rc_t* rc_init(int fd) /*, int buffer_size) */ | |||
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | /* Called once */ | 80 | /* Called once */ |
| 81 | static ATTRIBUTE_ALWAYS_INLINE void rc_free(rc_t * rc) | 81 | static ALWAYS_INLINE void rc_free(rc_t * rc) |
| 82 | { | 82 | { |
| 83 | if (ENABLE_FEATURE_CLEAN_UP) | 83 | if (ENABLE_FEATURE_CLEAN_UP) |
| 84 | free(rc); | 84 | free(rc); |
| @@ -92,7 +92,7 @@ static void rc_do_normalize(rc_t * rc) | |||
| 92 | rc->range <<= 8; | 92 | rc->range <<= 8; |
| 93 | rc->code = (rc->code << 8) | *rc->ptr++; | 93 | rc->code = (rc->code << 8) | *rc->ptr++; |
| 94 | } | 94 | } |
| 95 | static ATTRIBUTE_ALWAYS_INLINE void rc_normalize(rc_t * rc) | 95 | static ALWAYS_INLINE void rc_normalize(rc_t * rc) |
| 96 | { | 96 | { |
| 97 | if (rc->range < (1 << RC_TOP_BITS)) { | 97 | if (rc->range < (1 << RC_TOP_BITS)) { |
| 98 | rc_do_normalize(rc); | 98 | rc_do_normalize(rc); |
| @@ -109,7 +109,7 @@ static speed_inline uint32_t rc_is_bit_0_helper(rc_t * rc, uint16_t * p) | |||
| 109 | rc->bound = *p * (rc->range >> RC_MODEL_TOTAL_BITS); | 109 | rc->bound = *p * (rc->range >> RC_MODEL_TOTAL_BITS); |
| 110 | return rc->bound; | 110 | return rc->bound; |
| 111 | } | 111 | } |
| 112 | static ATTRIBUTE_ALWAYS_INLINE int rc_is_bit_0(rc_t * rc, uint16_t * p) | 112 | static ALWAYS_INLINE int rc_is_bit_0(rc_t * rc, uint16_t * p) |
| 113 | { | 113 | { |
| 114 | uint32_t t = rc_is_bit_0_helper(rc, p); | 114 | uint32_t t = rc_is_bit_0_helper(rc, p); |
| 115 | return rc->code < t; | 115 | return rc->code < t; |
| @@ -143,7 +143,7 @@ static int rc_get_bit(rc_t * rc, uint16_t * p, int *symbol) | |||
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | /* Called once */ | 145 | /* Called once */ |
| 146 | static ATTRIBUTE_ALWAYS_INLINE int rc_direct_bit(rc_t * rc) | 146 | static ALWAYS_INLINE int rc_direct_bit(rc_t * rc) |
| 147 | { | 147 | { |
| 148 | rc_normalize(rc); | 148 | rc_normalize(rc); |
| 149 | rc->range >>= 1; | 149 | rc->range >>= 1; |
diff --git a/editors/awk.c b/editors/awk.c index 9d306bf5f..90ba64348 100644 --- a/editors/awk.c +++ b/editors/awk.c | |||
| @@ -677,7 +677,7 @@ static char nextchar(char **s) | |||
| 677 | return c; | 677 | return c; |
| 678 | } | 678 | } |
| 679 | 679 | ||
| 680 | static int ATTRIBUTE_ALWAYS_INLINE isalnum_(int c) | 680 | static int ALWAYS_INLINE isalnum_(int c) |
| 681 | { | 681 | { |
| 682 | return (isalnum(c) || c == '_'); | 682 | return (isalnum(c) || c == '_'); |
| 683 | } | 683 | } |
diff --git a/editors/diff.c b/editors/diff.c index 830c15ea6..ef39623ef 100644 --- a/editors/diff.c +++ b/editors/diff.c | |||
| @@ -65,6 +65,8 @@ | |||
| 65 | #define FLAG_U (1<<12) | 65 | #define FLAG_U (1<<12) |
| 66 | #define FLAG_w (1<<13) | 66 | #define FLAG_w (1<<13) |
| 67 | 67 | ||
| 68 | #define g_read_buf bb_common_bufsiz1 | ||
| 69 | |||
| 68 | struct cand { | 70 | struct cand { |
| 69 | int x; | 71 | int x; |
| 70 | int y; | 72 | int y; |
| @@ -208,14 +210,14 @@ static void print_status(int val, char *path1, char *path2, char *entry) | |||
| 208 | free(_path2); | 210 | free(_path2); |
| 209 | } | 211 | } |
| 210 | } | 212 | } |
| 211 | static void fiddle_sum(int *sum, int t) | 213 | static ALWAYS_INLINE int fiddle_sum(int sum, int t) |
| 212 | { | 214 | { |
| 213 | *sum = (int)(*sum * 127 + t); | 215 | return sum * 127 + t; |
| 214 | } | 216 | } |
| 215 | /* | 217 | /* |
| 216 | * Hash function taken from Robert Sedgewick, Algorithms in C, 3d ed., p 578. | 218 | * Hash function taken from Robert Sedgewick, Algorithms in C, 3d ed., p 578. |
| 217 | */ | 219 | */ |
| 218 | static int readhash(FILE * f) | 220 | static int readhash(FILE *fp) |
| 219 | { | 221 | { |
| 220 | int i, t, space; | 222 | int i, t, space; |
| 221 | int sum; | 223 | int sum; |
| @@ -223,17 +225,17 @@ static int readhash(FILE * f) | |||
| 223 | sum = 1; | 225 | sum = 1; |
| 224 | space = 0; | 226 | space = 0; |
| 225 | if (!(option_mask32 & (FLAG_b | FLAG_w))) { | 227 | if (!(option_mask32 & (FLAG_b | FLAG_w))) { |
| 226 | for (i = 0; (t = getc(f)) != '\n'; i++) { | 228 | for (i = 0; (t = getc(fp)) != '\n'; i++) { |
| 227 | if (t == EOF) { | 229 | if (t == EOF) { |
| 228 | if (i == 0) | 230 | if (i == 0) |
| 229 | return 0; | 231 | return 0; |
| 230 | break; | 232 | break; |
| 231 | } | 233 | } |
| 232 | fiddle_sum(&sum, t); | 234 | sum = fiddle_sum(sum, t); |
| 233 | } | 235 | } |
| 234 | } else { | 236 | } else { |
| 235 | for (i = 0;;) { | 237 | for (i = 0;;) { |
| 236 | switch (t = getc(f)) { | 238 | switch (t = getc(fp)) { |
| 237 | case '\t': | 239 | case '\t': |
| 238 | case '\r': | 240 | case '\r': |
| 239 | case '\v': | 241 | case '\v': |
| @@ -246,7 +248,7 @@ static int readhash(FILE * f) | |||
| 246 | i++; | 248 | i++; |
| 247 | space = 0; | 249 | space = 0; |
| 248 | } | 250 | } |
| 249 | fiddle_sum(&sum, t); | 251 | sum = fiddle_sum(sum, t); |
| 250 | i++; | 252 | i++; |
| 251 | continue; | 253 | continue; |
| 252 | case EOF: | 254 | case EOF: |
| @@ -271,7 +273,7 @@ static int readhash(FILE * f) | |||
| 271 | * Check to see if the given files differ. | 273 | * Check to see if the given files differ. |
| 272 | * Returns 0 if they are the same, 1 if different, and -1 on error. | 274 | * Returns 0 if they are the same, 1 if different, and -1 on error. |
| 273 | */ | 275 | */ |
| 274 | static int files_differ(FILE * f1, FILE * f2, int flags) | 276 | static int files_differ(FILE *f1, FILE *f2, int flags) |
| 275 | { | 277 | { |
| 276 | size_t i, j; | 278 | size_t i, j; |
| 277 | 279 | ||
| @@ -281,37 +283,37 @@ static int files_differ(FILE * f1, FILE * f2, int flags) | |||
| 281 | return 1; | 283 | return 1; |
| 282 | } | 284 | } |
| 283 | while (1) { | 285 | while (1) { |
| 284 | i = fread(bb_common_bufsiz1, 1, BUFSIZ/2, f1); | 286 | i = fread(g_read_buf, 1, COMMON_BUFSIZE/2, f1); |
| 285 | j = fread(bb_common_bufsiz1 + BUFSIZ/2, 1, BUFSIZ/2, f2); | 287 | j = fread(g_read_buf + COMMON_BUFSIZE/2, 1, COMMON_BUFSIZE/2, f2); |
| 286 | if (i != j) | 288 | if (i != j) |
| 287 | return 1; | 289 | return 1; |
| 288 | if (i == 0) | 290 | if (i == 0) |
| 289 | return (ferror(f1) || ferror(f2)); | 291 | return (ferror(f1) || ferror(f2)); |
| 290 | if (memcmp(bb_common_bufsiz1, | 292 | if (memcmp(g_read_buf, |
| 291 | bb_common_bufsiz1 + BUFSIZ/2, i) != 0) | 293 | g_read_buf + COMMON_BUFSIZE/2, i) != 0) |
| 292 | return 1; | 294 | return 1; |
| 293 | } | 295 | } |
| 294 | } | 296 | } |
| 295 | 297 | ||
| 296 | 298 | ||
| 297 | static void prepare(int i, FILE * fd, off_t filesize) | 299 | static void prepare(int i, FILE *fp /*, off_t filesize*/) |
| 298 | { | 300 | { |
| 299 | struct line *p; | 301 | struct line *p; |
| 300 | int h; | 302 | int h; |
| 301 | size_t j, sz; | 303 | size_t j, sz; |
| 302 | 304 | ||
| 303 | rewind(fd); | 305 | rewind(fp); |
| 304 | 306 | ||
| 305 | sz = (filesize <= FSIZE_MAX ? filesize : FSIZE_MAX) / 25; | 307 | /*sz = (filesize <= FSIZE_MAX ? filesize : FSIZE_MAX) / 25;*/ |
| 306 | if (sz < 100) | 308 | /*if (sz < 100)*/ |
| 307 | sz = 100; | 309 | sz = 100; |
| 308 | 310 | ||
| 309 | p = xmalloc((sz + 3) * sizeof(struct line)); | 311 | p = xmalloc((sz + 3) * sizeof(p[0])); |
| 310 | j = 0; | 312 | j = 0; |
| 311 | while ((h = readhash(fd))) { | 313 | while ((h = readhash(fp))) { |
| 312 | if (j == sz) { | 314 | if (j == sz) { |
| 313 | sz = sz * 3 / 2; | 315 | sz = sz * 3 / 2; |
| 314 | p = xrealloc(p, (sz + 3) * sizeof(struct line)); | 316 | p = xrealloc(p, (sz + 3) * sizeof(p[0])); |
| 315 | } | 317 | } |
| 316 | p[++j].value = h; | 318 | p[++j].value = h; |
| 317 | } | 319 | } |
| @@ -694,10 +696,10 @@ static int asciifile(FILE * f) | |||
| 694 | 696 | ||
| 695 | #if ENABLE_FEATURE_DIFF_BINARY | 697 | #if ENABLE_FEATURE_DIFF_BINARY |
| 696 | rewind(f); | 698 | rewind(f); |
| 697 | cnt = fread(bb_common_bufsiz1, 1, BUFSIZ, f); | 699 | cnt = fread(g_read_buf, 1, COMMON_BUFSIZE, f); |
| 698 | for (i = 0; i < cnt; i++) { | 700 | for (i = 0; i < cnt; i++) { |
| 699 | if (!isprint(bb_common_bufsiz1[i]) | 701 | if (!isprint(g_read_buf[i]) |
| 700 | && !isspace(bb_common_bufsiz1[i])) { | 702 | && !isspace(g_read_buf[i])) { |
| 701 | return 0; | 703 | return 0; |
| 702 | } | 704 | } |
| 703 | } | 705 | } |
| @@ -937,7 +939,7 @@ static void output(char *file1, FILE * f1, char *file2, FILE * f2) | |||
| 937 | * 3*(number of k-candidates installed), typically about | 939 | * 3*(number of k-candidates installed), typically about |
| 938 | * 6n words for files of length n. | 940 | * 6n words for files of length n. |
| 939 | */ | 941 | */ |
| 940 | static unsigned diffreg(char * ofile1, char * ofile2, int flags) | 942 | static unsigned diffreg(char *ofile1, char *ofile2, int flags) |
| 941 | { | 943 | { |
| 942 | char *file1 = ofile1; | 944 | char *file1 = ofile1; |
| 943 | char *file2 = ofile2; | 945 | char *file2 = ofile2; |
| @@ -987,8 +989,8 @@ static unsigned diffreg(char * ofile1, char * ofile2, int flags) | |||
| 987 | goto closem; | 989 | goto closem; |
| 988 | } | 990 | } |
| 989 | 991 | ||
| 990 | prepare(0, f1, stb1.st_size); | 992 | prepare(0, f1 /*, stb1.st_size*/); |
| 991 | prepare(1, f2, stb2.st_size); | 993 | prepare(1, f2 /*, stb2.st_size*/); |
| 992 | prune(); | 994 | prune(); |
| 993 | sort(sfile[0], slen[0]); | 995 | sort(sfile[0], slen[0]); |
| 994 | sort(sfile[1], slen[1]); | 996 | sort(sfile[1], slen[1]); |
diff --git a/include/libbb.h b/include/libbb.h index d42ce5f39..c4743cf0f 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
| @@ -379,9 +379,9 @@ extern char *safe_strncpy(char *dst, const char *src, size_t size); | |||
| 379 | extern char *xasprintf(const char *format, ...) __attribute__ ((format (printf, 1, 2))); | 379 | extern char *xasprintf(const char *format, ...) __attribute__ ((format (printf, 1, 2))); |
| 380 | // gcc-4.1.1 still isn't good enough at optimizing it | 380 | // gcc-4.1.1 still isn't good enough at optimizing it |
| 381 | // (+200 bytes compared to macro) | 381 | // (+200 bytes compared to macro) |
| 382 | //static ATTRIBUTE_ALWAYS_INLINE | 382 | //static ALWAYS_INLINE |
| 383 | //int LONE_DASH(const char *s) { return s[0] == '-' && !s[1]; } | 383 | //int LONE_DASH(const char *s) { return s[0] == '-' && !s[1]; } |
| 384 | //static ATTRIBUTE_ALWAYS_INLINE | 384 | //static ALWAYS_INLINE |
| 385 | //int NOT_LONE_DASH(const char *s) { return s[0] != '-' || s[1]; } | 385 | //int NOT_LONE_DASH(const char *s) { return s[0] != '-' || s[1]; } |
| 386 | #define LONE_DASH(s) ((s)[0] == '-' && !(s)[1]) | 386 | #define LONE_DASH(s) ((s)[0] == '-' && !(s)[1]) |
| 387 | #define NOT_LONE_DASH(s) ((s)[0] != '-' || (s)[1]) | 387 | #define NOT_LONE_DASH(s) ((s)[0] != '-' || (s)[1]) |
| @@ -611,7 +611,7 @@ int write_pidfile(const char *path); | |||
| 611 | #define remove_pidfile(f) ((void)unlink(f)) | 611 | #define remove_pidfile(f) ((void)unlink(f)) |
| 612 | #else | 612 | #else |
| 613 | /* Why? #defining it to 1 gives "warning: statement with no effect"... */ | 613 | /* Why? #defining it to 1 gives "warning: statement with no effect"... */ |
| 614 | static ATTRIBUTE_ALWAYS_INLINE int write_pidfile(const char *path) { return 1; } | 614 | static ALWAYS_INLINE int write_pidfile(const char *path) { return 1; } |
| 615 | #define remove_pidfile(f) ((void)0) | 615 | #define remove_pidfile(f) ((void)0) |
| 616 | #endif | 616 | #endif |
| 617 | 617 | ||
diff --git a/include/platform.h b/include/platform.h index c2013b39d..9c93efb53 100644 --- a/include/platform.h +++ b/include/platform.h | |||
| @@ -53,14 +53,14 @@ | |||
| 53 | # define ATTRIBUTE_PACKED __attribute__ ((__packed__)) | 53 | # define ATTRIBUTE_PACKED __attribute__ ((__packed__)) |
| 54 | # define ATTRIBUTE_ALIGNED(m) __attribute__ ((__aligned__(m))) | 54 | # define ATTRIBUTE_ALIGNED(m) __attribute__ ((__aligned__(m))) |
| 55 | # if __GNUC_PREREQ (3,0) | 55 | # if __GNUC_PREREQ (3,0) |
| 56 | # define ATTRIBUTE_ALWAYS_INLINE __attribute__ ((always_inline)) inline | 56 | # define ALWAYS_INLINE __attribute__ ((always_inline)) inline |
| 57 | # if !ENABLE_WERROR | 57 | # if !ENABLE_WERROR |
| 58 | # define ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__)) | 58 | # define ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__)) |
| 59 | # else | 59 | # else |
| 60 | # define ATTRIBUTE_DEPRECATED /* n/a */ | 60 | # define ATTRIBUTE_DEPRECATED /* n/a */ |
| 61 | # endif | 61 | # endif |
| 62 | # else | 62 | # else |
| 63 | # define ATTRIBUTE_ALWAYS_INLINE inline | 63 | # define ALWAYS_INLINE inline |
| 64 | # define ATTRIBUTE_DEPRECATED /* n/a */ | 64 | # define ATTRIBUTE_DEPRECATED /* n/a */ |
| 65 | # endif | 65 | # endif |
| 66 | 66 | ||
| @@ -238,7 +238,7 @@ typedef unsigned smalluint; | |||
| 238 | #endif | 238 | #endif |
| 239 | 239 | ||
| 240 | #if defined(__dietlibc__) | 240 | #if defined(__dietlibc__) |
| 241 | static ATTRIBUTE_ALWAYS_INLINE char* strchrnul(const char *s, char c) | 241 | static ALWAYS_INLINE char* strchrnul(const char *s, char c) |
| 242 | { | 242 | { |
| 243 | while (*s && *s != c) ++s; | 243 | while (*s && *s != c) ++s; |
| 244 | return (char*)s; | 244 | return (char*)s; |
diff --git a/include/xatonum.h b/include/xatonum.h index cf088a49e..e613fce6b 100644 --- a/include/xatonum.h +++ b/include/xatonum.h | |||
| @@ -33,46 +33,46 @@ DECLARE_STR_CONV(long long, ll, ull) | |||
| 33 | /* (useful for mapping them to the type of the same width) */ | 33 | /* (useful for mapping them to the type of the same width) */ |
| 34 | #define DEFINE_EQUIV_STR_CONV(narrow, N, W, UN, UW) \ | 34 | #define DEFINE_EQUIV_STR_CONV(narrow, N, W, UN, UW) \ |
| 35 | \ | 35 | \ |
| 36 | static ATTRIBUTE_ALWAYS_INLINE \ | 36 | static ALWAYS_INLINE \ |
| 37 | unsigned narrow xstrto##UN##_range_sfx(const char *str, int b, unsigned narrow l, unsigned narrow u, const struct suffix_mult *sfx) \ | 37 | unsigned narrow xstrto##UN##_range_sfx(const char *str, int b, unsigned narrow l, unsigned narrow u, const struct suffix_mult *sfx) \ |
| 38 | { return xstrto##UW##_range_sfx(str, b, l, u, sfx); } \ | 38 | { return xstrto##UW##_range_sfx(str, b, l, u, sfx); } \ |
| 39 | static ATTRIBUTE_ALWAYS_INLINE \ | 39 | static ALWAYS_INLINE \ |
| 40 | unsigned narrow xstrto##UN##_range(const char *str, int b, unsigned narrow l, unsigned narrow u) \ | 40 | unsigned narrow xstrto##UN##_range(const char *str, int b, unsigned narrow l, unsigned narrow u) \ |
| 41 | { return xstrto##UW##_range(str, b, l, u); } \ | 41 | { return xstrto##UW##_range(str, b, l, u); } \ |
| 42 | static ATTRIBUTE_ALWAYS_INLINE \ | 42 | static ALWAYS_INLINE \ |
| 43 | unsigned narrow xstrto##UN##_sfx(const char *str, int b, const struct suffix_mult *sfx) \ | 43 | unsigned narrow xstrto##UN##_sfx(const char *str, int b, const struct suffix_mult *sfx) \ |
| 44 | { return xstrto##UW##_sfx(str, b, sfx); } \ | 44 | { return xstrto##UW##_sfx(str, b, sfx); } \ |
| 45 | static ATTRIBUTE_ALWAYS_INLINE \ | 45 | static ALWAYS_INLINE \ |
| 46 | unsigned narrow xstrto##UN(const char *str, int b) \ | 46 | unsigned narrow xstrto##UN(const char *str, int b) \ |
| 47 | { return xstrto##UW(str, b); } \ | 47 | { return xstrto##UW(str, b); } \ |
| 48 | static ATTRIBUTE_ALWAYS_INLINE \ | 48 | static ALWAYS_INLINE \ |
| 49 | unsigned narrow xato##UN##_range_sfx(const char *str, unsigned narrow l, unsigned narrow u, const struct suffix_mult *sfx) \ | 49 | unsigned narrow xato##UN##_range_sfx(const char *str, unsigned narrow l, unsigned narrow u, const struct suffix_mult *sfx) \ |
| 50 | { return xato##UW##_range_sfx(str, l, u, sfx); } \ | 50 | { return xato##UW##_range_sfx(str, l, u, sfx); } \ |
| 51 | static ATTRIBUTE_ALWAYS_INLINE \ | 51 | static ALWAYS_INLINE \ |
| 52 | unsigned narrow xato##UN##_range(const char *str, unsigned narrow l, unsigned narrow u) \ | 52 | unsigned narrow xato##UN##_range(const char *str, unsigned narrow l, unsigned narrow u) \ |
| 53 | { return xato##UW##_range(str, l, u); } \ | 53 | { return xato##UW##_range(str, l, u); } \ |
| 54 | static ATTRIBUTE_ALWAYS_INLINE \ | 54 | static ALWAYS_INLINE \ |
| 55 | unsigned narrow xato##UN##_sfx(const char *str, const struct suffix_mult *sfx) \ | 55 | unsigned narrow xato##UN##_sfx(const char *str, const struct suffix_mult *sfx) \ |
| 56 | { return xato##UW##_sfx(str, sfx); } \ | 56 | { return xato##UW##_sfx(str, sfx); } \ |
| 57 | static ATTRIBUTE_ALWAYS_INLINE \ | 57 | static ALWAYS_INLINE \ |
| 58 | unsigned narrow xato##UN(const char *str) \ | 58 | unsigned narrow xato##UN(const char *str) \ |
| 59 | { return xato##UW(str); } \ | 59 | { return xato##UW(str); } \ |
| 60 | static ATTRIBUTE_ALWAYS_INLINE \ | 60 | static ALWAYS_INLINE \ |
| 61 | narrow xstrto##N##_range_sfx(const char *str, int b, narrow l, narrow u, const struct suffix_mult *sfx) \ | 61 | narrow xstrto##N##_range_sfx(const char *str, int b, narrow l, narrow u, const struct suffix_mult *sfx) \ |
| 62 | { return xstrto##W##_range_sfx(str, b, l, u, sfx); } \ | 62 | { return xstrto##W##_range_sfx(str, b, l, u, sfx); } \ |
| 63 | static ATTRIBUTE_ALWAYS_INLINE \ | 63 | static ALWAYS_INLINE \ |
| 64 | narrow xstrto##N##_range(const char *str, int b, narrow l, narrow u) \ | 64 | narrow xstrto##N##_range(const char *str, int b, narrow l, narrow u) \ |
| 65 | { return xstrto##W##_range(str, b, l, u); } \ | 65 | { return xstrto##W##_range(str, b, l, u); } \ |
| 66 | static ATTRIBUTE_ALWAYS_INLINE \ | 66 | static ALWAYS_INLINE \ |
| 67 | narrow xato##N##_range_sfx(const char *str, narrow l, narrow u, const struct suffix_mult *sfx) \ | 67 | narrow xato##N##_range_sfx(const char *str, narrow l, narrow u, const struct suffix_mult *sfx) \ |
| 68 | { return xato##W##_range_sfx(str, l, u, sfx); } \ | 68 | { return xato##W##_range_sfx(str, l, u, sfx); } \ |
| 69 | static ATTRIBUTE_ALWAYS_INLINE \ | 69 | static ALWAYS_INLINE \ |
| 70 | narrow xato##N##_range(const char *str, narrow l, narrow u) \ | 70 | narrow xato##N##_range(const char *str, narrow l, narrow u) \ |
| 71 | { return xato##W##_range(str, l, u); } \ | 71 | { return xato##W##_range(str, l, u); } \ |
| 72 | static ATTRIBUTE_ALWAYS_INLINE \ | 72 | static ALWAYS_INLINE \ |
| 73 | narrow xato##N##_sfx(const char *str, const struct suffix_mult *sfx) \ | 73 | narrow xato##N##_sfx(const char *str, const struct suffix_mult *sfx) \ |
| 74 | { return xato##W##_sfx(str, sfx); } \ | 74 | { return xato##W##_sfx(str, sfx); } \ |
| 75 | static ATTRIBUTE_ALWAYS_INLINE \ | 75 | static ALWAYS_INLINE \ |
| 76 | narrow xato##N(const char *str) \ | 76 | narrow xato##N(const char *str) \ |
| 77 | { return xato##W(str); } \ | 77 | { return xato##W(str); } \ |
| 78 | 78 | ||
| @@ -96,7 +96,7 @@ DECLARE_STR_CONV(int, i, u) | |||
| 96 | /* Specialized */ | 96 | /* Specialized */ |
| 97 | 97 | ||
| 98 | int BUG_xatou32_unimplemented(void); | 98 | int BUG_xatou32_unimplemented(void); |
| 99 | static ATTRIBUTE_ALWAYS_INLINE uint32_t xatou32(const char *numstr) | 99 | static ALWAYS_INLINE uint32_t xatou32(const char *numstr) |
| 100 | { | 100 | { |
| 101 | if (UINT_MAX == 0xffffffff) | 101 | if (UINT_MAX == 0xffffffff) |
| 102 | return xatou(numstr); | 102 | return xatou(numstr); |
| @@ -111,10 +111,10 @@ unsigned long long bb_strtoull(const char *arg, char **endp, int base); | |||
| 111 | long long bb_strtoll(const char *arg, char **endp, int base); | 111 | long long bb_strtoll(const char *arg, char **endp, int base); |
| 112 | 112 | ||
| 113 | #if ULONG_MAX == ULLONG_MAX | 113 | #if ULONG_MAX == ULLONG_MAX |
| 114 | static ATTRIBUTE_ALWAYS_INLINE | 114 | static ALWAYS_INLINE |
| 115 | unsigned long bb_strtoul(const char *arg, char **endp, int base) | 115 | unsigned long bb_strtoul(const char *arg, char **endp, int base) |
| 116 | { return bb_strtoull(arg, endp, base); } | 116 | { return bb_strtoull(arg, endp, base); } |
| 117 | static ATTRIBUTE_ALWAYS_INLINE | 117 | static ALWAYS_INLINE |
| 118 | long bb_strtol(const char *arg, char **endp, int base) | 118 | long bb_strtol(const char *arg, char **endp, int base) |
| 119 | { return bb_strtoll(arg, endp, base); } | 119 | { return bb_strtoll(arg, endp, base); } |
| 120 | #else | 120 | #else |
| @@ -123,17 +123,17 @@ long bb_strtol(const char *arg, char **endp, int base); | |||
| 123 | #endif | 123 | #endif |
| 124 | 124 | ||
| 125 | #if UINT_MAX == ULLONG_MAX | 125 | #if UINT_MAX == ULLONG_MAX |
| 126 | static ATTRIBUTE_ALWAYS_INLINE | 126 | static ALWAYS_INLINE |
| 127 | unsigned bb_strtou(const char *arg, char **endp, int base) | 127 | unsigned bb_strtou(const char *arg, char **endp, int base) |
| 128 | { return bb_strtoull(arg, endp, base); } | 128 | { return bb_strtoull(arg, endp, base); } |
| 129 | static ATTRIBUTE_ALWAYS_INLINE | 129 | static ALWAYS_INLINE |
| 130 | int bb_strtoi(const char *arg, char **endp, int base) | 130 | int bb_strtoi(const char *arg, char **endp, int base) |
| 131 | { return bb_strtoll(arg, endp, base); } | 131 | { return bb_strtoll(arg, endp, base); } |
| 132 | #elif UINT_MAX == ULONG_MAX | 132 | #elif UINT_MAX == ULONG_MAX |
| 133 | static ATTRIBUTE_ALWAYS_INLINE | 133 | static ALWAYS_INLINE |
| 134 | unsigned bb_strtou(const char *arg, char **endp, int base) | 134 | unsigned bb_strtou(const char *arg, char **endp, int base) |
| 135 | { return bb_strtoul(arg, endp, base); } | 135 | { return bb_strtoul(arg, endp, base); } |
| 136 | static ATTRIBUTE_ALWAYS_INLINE | 136 | static ALWAYS_INLINE |
| 137 | int bb_strtoi(const char *arg, char **endp, int base) | 137 | int bb_strtoi(const char *arg, char **endp, int base) |
| 138 | { return bb_strtol(arg, endp, base); } | 138 | { return bb_strtol(arg, endp, base); } |
| 139 | #else | 139 | #else |
| @@ -142,7 +142,7 @@ int bb_strtoi(const char *arg, char **endp, int base); | |||
| 142 | #endif | 142 | #endif |
| 143 | 143 | ||
| 144 | int BUG_bb_strtou32_unimplemented(void); | 144 | int BUG_bb_strtou32_unimplemented(void); |
| 145 | static ATTRIBUTE_ALWAYS_INLINE | 145 | static ALWAYS_INLINE |
| 146 | uint32_t bb_strtou32(const char *arg, char **endp, int base) | 146 | uint32_t bb_strtou32(const char *arg, char **endp, int base) |
| 147 | { | 147 | { |
| 148 | if (sizeof(uint32_t) == sizeof(unsigned)) | 148 | if (sizeof(uint32_t) == sizeof(unsigned)) |
diff --git a/libbb/xatonum.c b/libbb/xatonum.c index dec3c2dc4..a410ae9bc 100644 --- a/libbb/xatonum.c +++ b/libbb/xatonum.c | |||
| @@ -34,7 +34,7 @@ | |||
| 34 | #endif | 34 | #endif |
| 35 | 35 | ||
| 36 | #if UINT_MAX != ULONG_MAX | 36 | #if UINT_MAX != ULONG_MAX |
| 37 | static ATTRIBUTE_ALWAYS_INLINE | 37 | static ALWAYS_INLINE |
| 38 | unsigned bb_strtoui(const char *str, char **end, int b) | 38 | unsigned bb_strtoui(const char *str, char **end, int b) |
| 39 | { | 39 | { |
| 40 | unsigned long v = strtoul(str, end, b); | 40 | unsigned long v = strtoul(str, end, b); |
diff --git a/networking/zcip.c b/networking/zcip.c index 3b67a032e..eb0a7ba41 100644 --- a/networking/zcip.c +++ b/networking/zcip.c | |||
| @@ -149,7 +149,7 @@ static int run(char *argv[3], const char *intf, struct in_addr *ip) | |||
| 149 | /** | 149 | /** |
| 150 | * Return milliseconds of random delay, up to "secs" seconds. | 150 | * Return milliseconds of random delay, up to "secs" seconds. |
| 151 | */ | 151 | */ |
| 152 | static unsigned ATTRIBUTE_ALWAYS_INLINE ms_rdelay(unsigned secs) | 152 | static unsigned ALWAYS_INLINE ms_rdelay(unsigned secs) |
| 153 | { | 153 | { |
| 154 | return lrand48() % (secs * 1000); | 154 | return lrand48() % (secs * 1000); |
| 155 | } | 155 | } |
diff --git a/util-linux/fdisk.c b/util-linux/fdisk.c index ed5abe956..4ecbadf78 100644 --- a/util-linux/fdisk.c +++ b/util-linux/fdisk.c | |||
| @@ -402,14 +402,14 @@ set_all_unchanged(void) | |||
| 402 | ptes[i].changed = 0; | 402 | ptes[i].changed = 0; |
| 403 | } | 403 | } |
| 404 | 404 | ||
| 405 | static ATTRIBUTE_ALWAYS_INLINE void | 405 | static ALWAYS_INLINE void |
| 406 | set_changed(int i) | 406 | set_changed(int i) |
| 407 | { | 407 | { |
| 408 | ptes[i].changed = 1; | 408 | ptes[i].changed = 1; |
| 409 | } | 409 | } |
| 410 | #endif /* FEATURE_FDISK_WRITABLE */ | 410 | #endif /* FEATURE_FDISK_WRITABLE */ |
| 411 | 411 | ||
| 412 | static ATTRIBUTE_ALWAYS_INLINE struct partition * | 412 | static ALWAYS_INLINE struct partition * |
| 413 | get_part_table(int i) | 413 | get_part_table(int i) |
| 414 | { | 414 | { |
| 415 | return ptes[i].part_table; | 415 | return ptes[i].part_table; |
| @@ -430,7 +430,7 @@ valid_part_table_flag(const char *mbuffer) | |||
| 430 | } | 430 | } |
| 431 | 431 | ||
| 432 | #if ENABLE_FEATURE_FDISK_WRITABLE | 432 | #if ENABLE_FEATURE_FDISK_WRITABLE |
| 433 | static ATTRIBUTE_ALWAYS_INLINE void | 433 | static ALWAYS_INLINE void |
| 434 | write_part_table_flag(char *b) | 434 | write_part_table_flag(char *b) |
| 435 | { | 435 | { |
| 436 | b[510] = 0x55; | 436 | b[510] = 0x55; |
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c index d35a25a9d..955d66f23 100644 --- a/util-linux/fsck_minix.c +++ b/util-linux/fsck_minix.c | |||
| @@ -159,7 +159,7 @@ static struct { | |||
| 159 | #define MAGIC (Super.s_magic) | 159 | #define MAGIC (Super.s_magic) |
| 160 | 160 | ||
| 161 | /* gcc likes this more (code is smaller) than macro variant */ | 161 | /* gcc likes this more (code is smaller) than macro variant */ |
| 162 | static ATTRIBUTE_ALWAYS_INLINE unsigned div_roundup(unsigned size, unsigned n) | 162 | static ALWAYS_INLINE unsigned div_roundup(unsigned size, unsigned n) |
| 163 | { | 163 | { |
| 164 | return (size + n-1) / n; | 164 | return (size + n-1) / n; |
| 165 | } | 165 | } |
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c index 9707ba3bd..ffdb2141e 100644 --- a/util-linux/mkfs_minix.c +++ b/util-linux/mkfs_minix.c | |||
| @@ -121,7 +121,7 @@ struct globals { | |||
| 121 | 121 | ||
| 122 | #define G (*ptr_to_globals) | 122 | #define G (*ptr_to_globals) |
| 123 | 123 | ||
| 124 | static ATTRIBUTE_ALWAYS_INLINE unsigned div_roundup(unsigned size, unsigned n) | 124 | static ALWAYS_INLINE unsigned div_roundup(unsigned size, unsigned n) |
| 125 | { | 125 | { |
| 126 | return (size + n-1) / n; | 126 | return (size + n-1) / n; |
| 127 | } | 127 | } |
