svn commit: trunk/uClibc: extra/locale include ldso/libdl libc/ine etc...

vda at uclibc.org vda at uclibc.org
Tue May 20 20:28:36 UTC 2008


Author: vda
Date: 2008-05-20 13:28:35 -0700 (Tue, 20 May 2008)
New Revision: 22026

Log:
Introduce and use small[u]int type. Changes in size:

-     79              0      28     107      6b libc/inet/rpc/create_xid.o
+     76              0      25     101      65 libc/inet/rpc/create_xid.o
-    126              0       4     130      82 libc/misc/assert/__assert.o
+    123              0       1     124      7c libc/misc/assert/__assert.o
-    648              4      24     676     2a4 libc/misc/internals/__uClibc_main.o
+    645              4      21     670     29e libc/misc/internals/__uClibc_main.o
-    230              0       4     234      ea libc/stdlib/abort.o
+    216              0       1     217      d9 libc/stdlib/abort.o
-    129              0       4     133      85 libc/termios/tcgetsid.o
+    126              0       1     127      7f libc/termios/tcgetsid.o



Modified:
   trunk/uClibc/extra/locale/gen_collate.c
   trunk/uClibc/extra/locale/gen_wctype.c
   trunk/uClibc/include/unistd.h
   trunk/uClibc/ldso/libdl/libdl.c
   trunk/uClibc/libc/inet/rpc/create_xid.c
   trunk/uClibc/libc/misc/assert/__assert.c
   trunk/uClibc/libc/misc/fnmatch/fnmatch.c
   trunk/uClibc/libc/misc/internals/__uClibc_main.c
   trunk/uClibc/libc/misc/regex/regex_old.c
   trunk/uClibc/libc/misc/time/time.c
   trunk/uClibc/libc/stdlib/abort.c
   trunk/uClibc/libc/stdlib/getpt.c
   trunk/uClibc/libc/stdlib/malloc/heap_debug.c
   trunk/uClibc/libc/stdlib/malloc/malloc.c
   trunk/uClibc/libc/sysdeps/linux/i386/bits/wordsize.h
   trunk/uClibc/libc/sysdeps/linux/nios/crtend.c
   trunk/uClibc/libc/termios/tcgetsid.c


Changeset:
Modified: trunk/uClibc/extra/locale/gen_collate.c
===================================================================
--- trunk/uClibc/extra/locale/gen_collate.c	2008-05-20 20:14:59 UTC (rev 22025)
+++ trunk/uClibc/extra/locale/gen_collate.c	2008-05-20 20:28:35 UTC (rev 22026)
@@ -3482,7 +3482,7 @@
 
 size_t newopt(tbl_item *ut, size_t usize, int shift, table_data *tbl)
 {
-	static int recurse = 0;
+	static smallint recurse;
 	tbl_item *ti[RANGE];	/* table index */
 	size_t numblocks;
 	size_t blocksize;

Modified: trunk/uClibc/extra/locale/gen_wctype.c
===================================================================
--- trunk/uClibc/extra/locale/gen_wctype.c	2008-05-20 20:14:59 UTC (rev 22025)
+++ trunk/uClibc/extra/locale/gen_wctype.c	2008-05-20 20:28:35 UTC (rev 22026)
@@ -767,7 +767,7 @@
 
 size_t newopt(unsigned char *ut, size_t usize, int shift, table_data *tbl)
 {
-	static int recurse = 0;
+	static smallint recurse;
 	unsigned char *ti[RANGE+1];	/* table index */
 	size_t numblocks;
 	size_t blocksize;

Modified: trunk/uClibc/include/unistd.h
===================================================================
--- trunk/uClibc/include/unistd.h	2008-05-20 20:14:59 UTC (rev 22025)
+++ trunk/uClibc/include/unistd.h	2008-05-20 20:28:35 UTC (rev 22026)
@@ -1107,4 +1107,14 @@
 
 __END_DECLS
 
+
+#ifdef UCLIBC_INTERNAL
+#ifndef smallint /* if arch didn't override it in bits/wordsize.h */
+typedef int smallint;
+typedef unsigned smalluint;
+#define smallint smallint
+#endif
+#endif
+
+
 #endif /* unistd.h  */

Modified: trunk/uClibc/ldso/libdl/libdl.c
===================================================================
--- trunk/uClibc/ldso/libdl/libdl.c	2008-05-20 20:14:59 UTC (rev 22025)
+++ trunk/uClibc/ldso/libdl/libdl.c	2008-05-20 20:28:35 UTC (rev 22026)
@@ -164,7 +164,7 @@
 	struct init_fini_list *tmp, *runp, *runp2, *dep_list;
 	unsigned int nlist, i;
 	struct elf_resolve **init_fini_list;
-	static int _dl_init = 0;
+	static smallint _dl_init;
 
 	/* A bit of sanity checking... */
 	if (!(flag & (RTLD_LAZY|RTLD_NOW))) {

Modified: trunk/uClibc/libc/inet/rpc/create_xid.c
===================================================================
--- trunk/uClibc/libc/inet/rpc/create_xid.c	2008-05-20 20:14:59 UTC (rev 22025)
+++ trunk/uClibc/libc/inet/rpc/create_xid.c	2008-05-20 20:28:35 UTC (rev 22026)
@@ -35,7 +35,7 @@
 __UCLIBC_MUTEX_STATIC(mylock, PTHREAD_MUTEX_INITIALIZER);
 
 
-static int is_initialized;
+static smallint is_initialized;
 static struct drand48_data __rpc_lrand48_data;
 
 u_long _create_xid (void) attribute_hidden;

Modified: trunk/uClibc/libc/misc/assert/__assert.c
===================================================================
--- trunk/uClibc/libc/misc/assert/__assert.c	2008-05-20 20:14:59 UTC (rev 22025)
+++ trunk/uClibc/libc/misc/assert/__assert.c	2008-05-20 20:28:35 UTC (rev 22026)
@@ -44,7 +44,7 @@
 
 #define ASSERT_SHOW_PROGNAME 1
 
-static int in_assert;			/* bss inits to 0. */
+static smallint in_assert;			/* bss inits to 0. */
 
 void attribute_noreturn __assert(const char *assertion, const char * filename,
 			  int linenumber, register const char * function)

Modified: trunk/uClibc/libc/misc/fnmatch/fnmatch.c
===================================================================
--- trunk/uClibc/libc/misc/fnmatch/fnmatch.c	2008-05-20 20:14:59 UTC (rev 22025)
+++ trunk/uClibc/libc/misc/fnmatch/fnmatch.c	2008-05-20 20:28:35 UTC (rev 22026)
@@ -211,7 +211,7 @@
 # endif
 
 /* Global variable.  */
-static int posixly_correct;
+static smallint posixly_correct;
 
 /* This function doesn't exist on most systems.  */
 

Modified: trunk/uClibc/libc/misc/internals/__uClibc_main.c
===================================================================
--- trunk/uClibc/libc/misc/internals/__uClibc_main.c	2008-05-20 20:14:59 UTC (rev 22025)
+++ trunk/uClibc/libc/misc/internals/__uClibc_main.c	2008-05-20 20:28:35 UTC (rev 22026)
@@ -22,7 +22,6 @@
 #include <link.h>
 #include <bits/uClibc_page.h>
 #include <paths.h>
-#include <unistd.h>
 #include <asm/errno.h>
 #include <fcntl.h>
 #include <sys/stat.h>
@@ -183,7 +182,7 @@
 libc_hidden_proto(__uClibc_init)
 void __uClibc_init(void)
 {
-    static int been_there_done_that = 0;
+    static smallint been_there_done_that;
 
     if (been_there_done_that)
 	return;

Modified: trunk/uClibc/libc/misc/regex/regex_old.c
===================================================================
--- trunk/uClibc/libc/misc/regex/regex_old.c	2008-05-20 20:14:59 UTC (rev 22025)
+++ trunk/uClibc/libc/misc/regex/regex_old.c	2008-05-20 20:28:35 UTC (rev 22026)
@@ -798,7 +798,7 @@
 /* It is useful to test things that ``must'' be true when debugging.  */
 #   include <assert.h>
 
-static int debug;
+static smallint debug;
 
 #   define DEBUG_STATEMENT(e) e
 #   define DEBUG_PRINT1(x) if (debug) printf (x)

Modified: trunk/uClibc/libc/misc/time/time.c
===================================================================
--- trunk/uClibc/libc/misc/time/time.c	2008-05-20 20:14:59 UTC (rev 22025)
+++ trunk/uClibc/libc/misc/time/time.c	2008-05-20 20:28:35 UTC (rev 22026)
@@ -1825,7 +1825,7 @@
 #ifdef __UCLIBC_HAS_TZ_FILE__
 
 #ifndef __UCLIBC_HAS_TZ_FILE_READ_MANY__
-static int TZ_file_read;		/* Let BSS initialization set this to 0. */
+static smallint TZ_file_read;		/* Let BSS initialization set this to 0. */
 #endif /* __UCLIBC_HAS_TZ_FILE_READ_MANY__ */
 
 static char *read_TZ_file(char *buf)
@@ -1853,7 +1853,7 @@
 			p[-1] = 0;
 			p = buf;
 #ifndef __UCLIBC_HAS_TZ_FILE_READ_MANY__
-			++TZ_file_read;
+			TZ_file_read = 1;
 #endif /* __UCLIBC_HAS_TZ_FILE_READ_MANY__ */
 		} else {
 ERROR:
@@ -1901,7 +1901,7 @@
 
 	if (e != NULL) {
 		TZ_file_read = 0;		/* Reset if the TZ env var is set. */
-	} else if (TZ_file_read > 0) {
+	} else if (TZ_file_read) {
 		goto FAST_DONE;
 	}
 #endif /* defined(__UCLIBC_HAS_TZ_FILE__) && !defined(__UCLIBC_HAS_TZ_FILE_READ_MANY__) */

Modified: trunk/uClibc/libc/stdlib/abort.c
===================================================================
--- trunk/uClibc/libc/stdlib/abort.c	2008-05-20 20:14:59 UTC (rev 22025)
+++ trunk/uClibc/libc/stdlib/abort.c	2008-05-20 20:28:35 UTC (rev 22026)
@@ -46,7 +46,7 @@
 #ifdef __UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT__
 extern void weak_function _stdio_term(void) attribute_hidden;
 #endif
-static int been_there_done_that = 0;
+static smallint been_there_done_that = 0;
 
 /* Be prepared in case multiple threads try to abort() */
 #include <bits/uClibc_mutex.h>

Modified: trunk/uClibc/libc/stdlib/getpt.c
===================================================================
--- trunk/uClibc/libc/stdlib/getpt.c	2008-05-20 20:14:59 UTC (rev 22025)
+++ trunk/uClibc/libc/stdlib/getpt.c	2008-05-20 20:28:35 UTC (rev 22026)
@@ -50,7 +50,7 @@
 getpt (void)
 {
 #if !defined __UNIX98PTY_ONLY__
-  static int have_no_dev_ptmx;
+  static smallint have_no_dev_ptmx;
 #endif
   int fd;
 
@@ -65,7 +65,7 @@
 	  return fd;
 #else
 	  struct statfs fsbuf;
-	  static int devpts_mounted;
+	  static smallint devpts_mounted;
 
 	  /* Check that the /dev/pts filesystem is mounted
 	     or if /dev is a devfs filesystem (this implies /dev/pts).  */

Modified: trunk/uClibc/libc/stdlib/malloc/heap_debug.c
===================================================================
--- trunk/uClibc/libc/stdlib/malloc/heap_debug.c	2008-05-20 20:14:59 UTC (rev 22025)
+++ trunk/uClibc/libc/stdlib/malloc/heap_debug.c	2008-05-20 20:28:35 UTC (rev 22026)
@@ -49,7 +49,7 @@
 void
 __heap_dump (struct heap *heap, const char *str)
 {
-  static int recursed = 0;
+  static smallint recursed;
 
   if (! recursed)
     {

Modified: trunk/uClibc/libc/stdlib/malloc/malloc.c
===================================================================
--- trunk/uClibc/libc/stdlib/malloc/malloc.c	2008-05-20 20:14:59 UTC (rev 22025)
+++ trunk/uClibc/libc/stdlib/malloc/malloc.c	2008-05-20 20:28:35 UTC (rev 22026)
@@ -184,7 +184,7 @@
 {
   void *mem;
 #ifdef MALLOC_DEBUGGING
-  static int debugging_initialized = 0;
+  static smallint debugging_initialized;
   if (! debugging_initialized)
     {
       debugging_initialized = 1;

Modified: trunk/uClibc/libc/sysdeps/linux/i386/bits/wordsize.h
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/i386/bits/wordsize.h	2008-05-20 20:14:59 UTC (rev 22025)
+++ trunk/uClibc/libc/sysdeps/linux/i386/bits/wordsize.h	2008-05-20 20:28:35 UTC (rev 22026)
@@ -17,3 +17,11 @@
    02111-1307 USA.  */
 
 #define __WORDSIZE	32
+
+#ifdef UCLIBC_INTERNAL
+#ifndef smallint
+typedef signed char smallint;
+typedef unsigned char smalluint;
+#define smallint smallint
+#endif
+#endif

Modified: trunk/uClibc/libc/sysdeps/linux/nios/crtend.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/nios/crtend.c	2008-05-20 20:14:59 UTC (rev 22025)
+++ trunk/uClibc/libc/sysdeps/linux/nios/crtend.c	2008-05-20 20:28:35 UTC (rev 22026)
@@ -25,7 +25,7 @@
 void
 dummy_init(void)
 {
-	static int initialized = 0;
+	static smallint initialized;
 	static void (*volatile call__ctors)(void) = __do_global_ctors_aux;
 	/*
 	 * Call global constructors.

Modified: trunk/uClibc/libc/termios/tcgetsid.c
===================================================================
--- trunk/uClibc/libc/termios/tcgetsid.c	2008-05-20 20:14:59 UTC (rev 22025)
+++ trunk/uClibc/libc/termios/tcgetsid.c	2008-05-20 20:28:35 UTC (rev 22026)
@@ -33,7 +33,7 @@
   pid_t pgrp;
   pid_t sid;
 #ifdef TIOCGSID
-  static int tiocgsid_does_not_work;
+  static smallint tiocgsid_does_not_work;
 
   if (! tiocgsid_does_not_work)
     {




More information about the uClibc-cvs mailing list