svn commit: trunk/busybox: archival include libbb util-linux
vda at busybox.net
vda at busybox.net
Sat Dec 16 23:48:14 UTC 2006
Author: vda
Date: 2006-12-16 15:48:13 -0800 (Sat, 16 Dec 2006)
New Revision: 16976
Log:
s/extern inline/static ATTRIBUTE_ALWAYS_INLINE/g
xstrtou: disallow leading '+'
Modified:
trunk/busybox/archival/ar.c
trunk/busybox/include/platform.h
trunk/busybox/include/xatonum.h
trunk/busybox/libbb/getopt32.c
trunk/busybox/libbb/xatonum.c
trunk/busybox/libbb/xatonum_template.c
trunk/busybox/util-linux/fdisk.c
trunk/busybox/util-linux/mkfs_minix.c
Changeset:
Modified: trunk/busybox/archival/ar.c
===================================================================
--- trunk/busybox/archival/ar.c 2006-12-16 22:19:47 UTC (rev 16975)
+++ trunk/busybox/archival/ar.c 2006-12-16 23:48:13 UTC (rev 16976)
@@ -87,7 +87,7 @@
}
archive_handle->offset += 7;
- while (get_header_ar(archive_handle) == EXIT_SUCCESS);
+ while (get_header_ar(archive_handle) == EXIT_SUCCESS) /* repeat */;
return EXIT_SUCCESS;
}
Modified: trunk/busybox/include/platform.h
===================================================================
--- trunk/busybox/include/platform.h 2006-12-16 22:19:47 UTC (rev 16975)
+++ trunk/busybox/include/platform.h 2006-12-16 23:48:13 UTC (rev 16976)
@@ -195,7 +195,7 @@
* out of the tree, so stop saying it should be. */
#define fdprintf dprintf
-/* Don't use lchown with glibc older then 2.1.x ... uC-libc lacks it */
+/* Don't use lchown with glibc older than 2.1.x ... uC-libc lacks it */
#if (defined __GLIBC__ && __GLIBC__ <= 2 && __GLIBC_MINOR__ < 1) || \
defined __UC_LIBC__
# define lchown chown
Modified: trunk/busybox/include/xatonum.h
===================================================================
--- trunk/busybox/include/xatonum.h 2006-12-16 22:19:47 UTC (rev 16975)
+++ trunk/busybox/include/xatonum.h 2006-12-16 23:48:13 UTC (rev 16976)
@@ -29,50 +29,50 @@
DECLARE_STR_CONV(long long, ll, ull)
-/* Provides extern inline definitions of functions */
+/* Provides inline definitions of functions */
/* (useful for mapping them to the type of the same width) */
#define DEFINE_EQUIV_STR_CONV(narrow, N, W, UN, UW) \
\
-extern inline \
+static ATTRIBUTE_ALWAYS_INLINE \
unsigned narrow xstrto##UN##_range_sfx(const char *str, int b, unsigned narrow l, unsigned narrow u, const struct suffix_mult *sfx) \
{ return xstrto##UW##_range_sfx(str, b, l, u, sfx); } \
-extern inline \
+static ATTRIBUTE_ALWAYS_INLINE \
unsigned narrow xstrto##UN##_range(const char *str, int b, unsigned narrow l, unsigned narrow u) \
{ return xstrto##UW##_range(str, b, l, u); } \
-extern inline \
+static ATTRIBUTE_ALWAYS_INLINE \
unsigned narrow xstrto##UN##_sfx(const char *str, int b, const struct suffix_mult *sfx) \
{ return xstrto##UW##_sfx(str, b, sfx); } \
-extern inline \
+static ATTRIBUTE_ALWAYS_INLINE \
unsigned narrow xstrto##UN(const char *str, int b) \
{ return xstrto##UW(str, b); } \
-extern inline \
+static ATTRIBUTE_ALWAYS_INLINE \
unsigned narrow xato##UN##_range_sfx(const char *str, unsigned narrow l, unsigned narrow u, const struct suffix_mult *sfx) \
{ return xato##UW##_range_sfx(str, l, u, sfx); } \
-extern inline \
+static ATTRIBUTE_ALWAYS_INLINE \
unsigned narrow xato##UN##_range(const char *str, unsigned narrow l, unsigned narrow u) \
{ return xato##UW##_range(str, l, u); } \
-extern inline \
+static ATTRIBUTE_ALWAYS_INLINE \
unsigned narrow xato##UN##_sfx(const char *str, const struct suffix_mult *sfx) \
{ return xato##UW##_sfx(str, sfx); } \
-extern inline \
+static ATTRIBUTE_ALWAYS_INLINE \
unsigned narrow xato##UN(const char *str) \
{ return xato##UW(str); } \
-extern inline \
+static ATTRIBUTE_ALWAYS_INLINE \
narrow xstrto##N##_range_sfx(const char *str, int b, narrow l, narrow u, const struct suffix_mult *sfx) \
{ return xstrto##W##_range_sfx(str, b, l, u, sfx); } \
-extern inline \
+static ATTRIBUTE_ALWAYS_INLINE \
narrow xstrto##N##_range(const char *str, int b, narrow l, narrow u) \
{ return xstrto##W##_range(str, b, l, u); } \
-extern inline \
+static ATTRIBUTE_ALWAYS_INLINE \
narrow xato##N##_range_sfx(const char *str, narrow l, narrow u, const struct suffix_mult *sfx) \
{ return xato##W##_range_sfx(str, l, u, sfx); } \
-extern inline \
+static ATTRIBUTE_ALWAYS_INLINE \
narrow xato##N##_range(const char *str, narrow l, narrow u) \
{ return xato##W##_range(str, l, u); } \
-extern inline \
+static ATTRIBUTE_ALWAYS_INLINE \
narrow xato##N##_sfx(const char *str, const struct suffix_mult *sfx) \
{ return xato##W##_sfx(str, sfx); } \
-extern inline \
+static ATTRIBUTE_ALWAYS_INLINE \
narrow xato##N(const char *str) \
{ return xato##W(str); } \
@@ -96,7 +96,7 @@
/* Specialized */
int BUG_xatou32_unimplemented(void);
-extern inline uint32_t xatou32(const char *numstr)
+static ATTRIBUTE_ALWAYS_INLINE uint32_t xatou32(const char *numstr)
{
if (UINT_MAX == 0xffffffff)
return xatou(numstr);
@@ -111,11 +111,11 @@
long long bb_strtoll(const char *arg, char **endp, int base);
#if ULONG_MAX == ULLONG_MAX
-extern inline
+static ATTRIBUTE_ALWAYS_INLINE
unsigned long bb_strtoul(const char *arg, char **endp, int base)
{ return bb_strtoull(arg, endp, base); }
-extern inline
-unsigned long bb_strtol(const char *arg, char **endp, int base)
+static ATTRIBUTE_ALWAYS_INLINE
+long bb_strtol(const char *arg, char **endp, int base)
{ return bb_strtoll(arg, endp, base); }
#else
unsigned long bb_strtoul(const char *arg, char **endp, int base);
@@ -123,26 +123,26 @@
#endif
#if UINT_MAX == ULLONG_MAX
-extern inline
-unsigned long bb_strtou(const char *arg, char **endp, int base)
+static ATTRIBUTE_ALWAYS_INLINE
+unsigned bb_strtou(const char *arg, char **endp, int base)
{ return bb_strtoull(arg, endp, base); }
-extern inline
-unsigned long bb_strtoi(const char *arg, char **endp, int base)
+static ATTRIBUTE_ALWAYS_INLINE
+int bb_strtoi(const char *arg, char **endp, int base)
{ return bb_strtoll(arg, endp, base); }
#elif UINT_MAX == ULONG_MAX
-extern inline
-unsigned long bb_strtou(const char *arg, char **endp, int base)
+static ATTRIBUTE_ALWAYS_INLINE
+unsigned bb_strtou(const char *arg, char **endp, int base)
{ return bb_strtoul(arg, endp, base); }
-extern inline
-unsigned long bb_strtoi(const char *arg, char **endp, int base)
+static ATTRIBUTE_ALWAYS_INLINE
+int bb_strtoi(const char *arg, char **endp, int base)
{ return bb_strtol(arg, endp, base); }
#else
-unsigned long bb_strtou(const char *arg, char **endp, int base);
-long bb_strtoi(const char *arg, char **endp, int base);
+unsigned bb_strtou(const char *arg, char **endp, int base);
+int bb_strtoi(const char *arg, char **endp, int base);
#endif
int BUG_bb_strtou32_unimplemented(void);
-extern inline
+static ATTRIBUTE_ALWAYS_INLINE
uint32_t bb_strtou32(const char *arg, char **endp, int base)
{
if (sizeof(uint32_t) == sizeof(unsigned))
Modified: trunk/busybox/libbb/getopt32.c
===================================================================
--- trunk/busybox/libbb/getopt32.c 2006-12-16 22:19:47 UTC (rev 16975)
+++ trunk/busybox/libbb/getopt32.c 2006-12-16 23:48:13 UTC (rev 16976)
@@ -447,7 +447,6 @@
}
va_end (p);
-#if ENABLE_AR || ENABLE_TAR
if (spec_flgs & FIRST_ARGV_IS_OPT) {
if (argv[1] && argv[1][0] != '-' && argv[1][0] != '\0') {
argv[1] = xasprintf("-%s", argv[1]);
@@ -455,7 +454,6 @@
spec_flgs |= FREE_FIRST_ARGV_IS_OPT;
}
}
-#endif
/* Note: just "getopt() <= 0" will not work good for
* "fake" short options, like this one:
* wget $'-\203' "Test: test" http://kernel.org/
Modified: trunk/busybox/libbb/xatonum.c
===================================================================
--- trunk/busybox/libbb/xatonum.c 2006-12-16 22:19:47 UTC (rev 16975)
+++ trunk/busybox/libbb/xatonum.c 2006-12-16 23:48:13 UTC (rev 16976)
@@ -34,7 +34,8 @@
#endif
#if UINT_MAX != ULONG_MAX
-extern inline unsigned bb_strtoui(const char *str, char **end, int b)
+static ATTRIBUTE_ALWAYS_INLINE
+unsigned bb_strtoui(const char *str, char **end, int b)
{
unsigned long v = strtoul(str, end, b);
if (v > UINT_MAX) {
Modified: trunk/busybox/libbb/xatonum_template.c
===================================================================
--- trunk/busybox/libbb/xatonum_template.c 2006-12-16 22:19:47 UTC (rev 16975)
+++ trunk/busybox/libbb/xatonum_template.c 2006-12-16 23:48:13 UTC (rev 16976)
@@ -24,7 +24,7 @@
/* Disallow '-' and any leading whitespace. Speed isn't critical here
* since we're parsing commandline args. So make sure we get the
* actual isspace function rather than a lnumstrer macro implementaion. */
- if ((*numstr == '-') || (isspace)(*numstr))
+ if (*numstr == '-' || *numstr == '+' || (isspace)(*numstr))
goto inval;
/* Since this is a lib function, we're not allowed to reset errno to 0.
@@ -36,7 +36,7 @@
/* Do the initial validity check. Note: The standards do not
* guarantee that errno is set if no digits were found. So we
* must test for this explicitly. */
- if (errno || (numstr == e))
+ if (errno || numstr == e)
goto inval; /* error / no digits / illegal trailing chars */
errno = old_errno; /* Ok. So restore errno. */
@@ -127,7 +127,7 @@
type r;
const char *p = numstr;
- if ((p[0] == '-') && (p[1] != '+')) {
+ if (p[0] == '-') {
++p;
++u; /* two's complement */
}
Modified: trunk/busybox/util-linux/fdisk.c
===================================================================
--- trunk/busybox/util-linux/fdisk.c 2006-12-16 22:19:47 UTC (rev 16975)
+++ trunk/busybox/util-linux/fdisk.c 2006-12-16 23:48:13 UTC (rev 16976)
@@ -252,14 +252,14 @@
ptes[i].changed = 0;
}
-extern inline void
+static ATTRIBUTE_ALWAYS_INLINE void
set_changed(int i)
{
ptes[i].changed = 1;
}
#endif /* CONFIG_FEATURE_FDISK_WRITABLE */
-extern inline struct partition *
+static ATTRIBUTE_ALWAYS_INLINE struct partition *
get_part_table(int i)
{
return ptes[i].part_table;
@@ -281,7 +281,7 @@
}
#if ENABLE_FEATURE_FDISK_WRITABLE
-extern inline void
+static ATTRIBUTE_ALWAYS_INLINE void
write_part_table_flag(char *b)
{
b[510] = 0x55;
Modified: trunk/busybox/util-linux/mkfs_minix.c
===================================================================
--- trunk/busybox/util-linux/mkfs_minix.c 2006-12-16 22:19:47 UTC (rev 16975)
+++ trunk/busybox/util-linux/mkfs_minix.c 2006-12-16 23:48:13 UTC (rev 16976)
@@ -183,7 +183,7 @@
static unsigned short good_blocks_table[MAX_GOOD_BLOCKS];
static unsigned long req_nr_inodes;
-extern inline unsigned div_roundup(unsigned size, unsigned n)
+static ATTRIBUTE_ALWAYS_INLINE unsigned div_roundup(unsigned size, unsigned n)
{
return (size + n-1) / n;
}
More information about the busybox-cvs
mailing list