From: Piotr Dymacz Date: Wed, 31 Aug 2016 23:06:41 +0000 (+0200) Subject: Save more space with unused string functions, minor cleanups X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a057ff949930ea72825711e609c607de35615d09;p=oweals%2Fu-boot_mod.git Save more space with unused string functions, minor cleanups --- diff --git a/u-boot/lib_generic/Makefile b/u-boot/lib_generic/Makefile index 4fe3648..61f4916 100644 --- a/u-boot/lib_generic/Makefile +++ b/u-boot/lib_generic/Makefile @@ -23,19 +23,24 @@ include $(TOPDIR)/config.mk -LIB = libgeneric.a - -OBJS = crc32.o ctype.o display_options.o ldiv.o string.o vsprintf.o LzmaWrapper.o LzmaDecode.o +LIB = libgeneric.a +OBJS = crc32.o \ + ctype.o \ + display_options.o \ + string.o \ + LzmaDecode.o \ + LzmaWrapper.o \ + vsprintf.o CFLAGS += -DCONFIG_LZMA=1 -$(LIB): .depend $(OBJS) +$(LIB): .depend $(OBJS) $(AR) crv $@ $(OBJS) ######################################################################### -.depend: Makefile $(OBJS:.o=.c) - $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@ +.depend: Makefile $(OBJS:.o=.c) + $(CC) -M $(CFLAGS) $(OBJS:.o=.c) > $@ sinclude .depend diff --git a/u-boot/lib_generic/string.c b/u-boot/lib_generic/string.c index 0e99d1b..07a8884 100644 --- a/u-boot/lib_generic/string.c +++ b/u-boot/lib_generic/string.c @@ -20,6 +20,16 @@ #include #include +#define __HAVE_ARCH_STRNICMP +#define __HAVE_ARCH_STRRCHR +#define __HAVE_ARCH_STRSPN +#define __HAVE_ARCH_STRPBRK +#define __HAVE_ARCH_STRTOK +#define __HAVE_ARCH_STRSEP +#define __HAVE_ARCH_STRSWAB +#define __HAVE_ARCH_BCOPY +#define __HAVE_ARCH_MEMSCAN +#define __HAVE_ARCH_MEMCHR #ifndef __HAVE_ARCH_STRNICMP /** @@ -54,8 +64,6 @@ int strnicmp(const char *s1, const char *s2, size_t len) } #endif -char * ___strtok; - #ifndef __HAVE_ARCH_STRCPY /** * strcpy - Copy a %NUL terminated string @@ -308,6 +316,7 @@ char * strpbrk(const char * cs,const char * ct) #endif #ifndef __HAVE_ARCH_STRTOK +char * ___strtok; /** * strtok - Split a string into tokens * @s: The string to be searched diff --git a/u-boot/lib_generic/vsprintf.c b/u-boot/lib_generic/vsprintf.c index e6e0638..0a7e9ef 100644 --- a/u-boot/lib_generic/vsprintf.c +++ b/u-boot/lib_generic/vsprintf.c @@ -16,9 +16,6 @@ #include #include -/*cmd_boot.c*/ -extern int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]); - unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base){ unsigned long result = 0,value;