diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-08-12 14:14:45 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-08-12 14:14:45 +0200 |
| commit | 7783248eaac715b813f0635b06cc140ea99bb4d9 (patch) | |
| tree | b7c3acbdf7e45afdb31a721a693f0a8a65f80730 /include | |
| parent | 7bfbbd434a6f435b0287cd25406927c630b03f68 (diff) | |
| download | busybox-w32-7783248eaac715b813f0635b06cc140ea99bb4d9.tar.gz busybox-w32-7783248eaac715b813f0635b06cc140ea99bb4d9.tar.bz2 busybox-w32-7783248eaac715b813f0635b06cc140ea99bb4d9.zip | |
*: s/xatoi_u/xatoi_positive/g - I got bored of mistyping xatoi_u as xatou_i
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/libbb.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/libbb.h b/include/libbb.h index 118d777bc..03fc5d44b 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
| @@ -190,7 +190,7 @@ typedef unsigned long long uoff_t; | |||
| 190 | /* While sizeof(off_t) == sizeof(int), off_t is typedef'ed to long anyway. | 190 | /* While sizeof(off_t) == sizeof(int), off_t is typedef'ed to long anyway. |
| 191 | * gcc will throw warnings on printf("%d", off_t). Crap... */ | 191 | * gcc will throw warnings on printf("%d", off_t). Crap... */ |
| 192 | typedef unsigned long uoff_t; | 192 | typedef unsigned long uoff_t; |
| 193 | # define XATOOFF(a) xatoi_u(a) | 193 | # define XATOOFF(a) xatoi_positive(a) |
| 194 | # define BB_STRTOOFF bb_strtou | 194 | # define BB_STRTOOFF bb_strtou |
| 195 | # define STRTOOFF strtol | 195 | # define STRTOOFF strtol |
| 196 | # define OFF_FMT "l" | 196 | # define OFF_FMT "l" |
| @@ -765,11 +765,16 @@ struct suffix_mult { | |||
| 765 | }; | 765 | }; |
| 766 | #include "xatonum.h" | 766 | #include "xatonum.h" |
| 767 | /* Specialized: */ | 767 | /* Specialized: */ |
| 768 | |||
| 768 | /* Using xatoi() instead of naive atoi() is not always convenient - | 769 | /* Using xatoi() instead of naive atoi() is not always convenient - |
| 769 | * in many places people want *non-negative* values, but store them | 770 | * in many places people want *non-negative* values, but store them |
| 770 | * in signed int. Therefore we need this one: | 771 | * in signed int. Therefore we need this one: |
| 771 | * dies if input is not in [0, INT_MAX] range. Also will reject '-0' etc */ | 772 | * dies if input is not in [0, INT_MAX] range. Also will reject '-0' etc. |
| 772 | int xatoi_u(const char *numstr) FAST_FUNC; | 773 | * It should really be named xatoi_nonnegative (since it allows 0), |
| 774 | * but that would be too long. | ||
| 775 | */ | ||
| 776 | int xatoi_positive(const char *numstr) FAST_FUNC; | ||
| 777 | |||
| 773 | /* Useful for reading port numbers */ | 778 | /* Useful for reading port numbers */ |
| 774 | uint16_t xatou16(const char *numstr) FAST_FUNC; | 779 | uint16_t xatou16(const char *numstr) FAST_FUNC; |
| 775 | 780 | ||
