svn commit: trunk/uClibc/libc/inet

vda at uclibc.org vda at uclibc.org
Sun May 25 10:39:14 UTC 2008


Author: vda
Date: 2008-05-25 03:39:13 -0700 (Sun, 25 May 2008)
New Revision: 22075

Log:
Slight size reduction by use of smallints/consts:

- 288016           1924    7176  297116   4889c libuClibc-0.9.29.so
+ 287956           1924    7168  297048   48858 libuClibc-0.9.29.so



Modified:
   trunk/uClibc/libc/inet/gai_strerror.c
   trunk/uClibc/libc/inet/getnetbyad.c
   trunk/uClibc/libc/inet/getnetbynm.c
   trunk/uClibc/libc/inet/getnetent.c
   trunk/uClibc/libc/inet/getproto.c
   trunk/uClibc/libc/inet/getservice.c


Changeset:
Modified: trunk/uClibc/libc/inet/gai_strerror.c
===================================================================
--- trunk/uClibc/libc/inet/gai_strerror.c	2008-05-25 06:08:33 UTC (rev 22074)
+++ trunk/uClibc/libc/inet/gai_strerror.c	2008-05-25 10:39:13 UTC (rev 22075)
@@ -24,7 +24,7 @@
 
 #define N_(x) x
 #define _(x) x
-static struct
+static const struct
   {
     int code;
     const char *msg;

Modified: trunk/uClibc/libc/inet/getnetbyad.c
===================================================================
--- trunk/uClibc/libc/inet/getnetbyad.c	2008-05-25 06:08:33 UTC (rev 22074)
+++ trunk/uClibc/libc/inet/getnetbyad.c	2008-05-25 10:39:13 UTC (rev 22075)
@@ -23,7 +23,7 @@
 libc_hidden_proto(getnetent)
 libc_hidden_proto(endnetent)
 
-extern int _net_stayopen attribute_hidden;
+extern smallint _net_stayopen attribute_hidden;
 
 struct netent *getnetbyaddr (uint32_t net, int type)
 {

Modified: trunk/uClibc/libc/inet/getnetbynm.c
===================================================================
--- trunk/uClibc/libc/inet/getnetbynm.c	2008-05-25 06:08:33 UTC (rev 22074)
+++ trunk/uClibc/libc/inet/getnetbynm.c	2008-05-25 10:39:13 UTC (rev 22075)
@@ -25,7 +25,7 @@
 libc_hidden_proto(getnetent)
 libc_hidden_proto(endnetent)
 
-extern int _net_stayopen attribute_hidden;
+extern smallint _net_stayopen attribute_hidden;
 
 struct netent *
 getnetbyname(const char *name)

Modified: trunk/uClibc/libc/inet/getnetent.c
===================================================================
--- trunk/uClibc/libc/inet/getnetent.c	2008-05-25 06:08:33 UTC (rev 22074)
+++ trunk/uClibc/libc/inet/getnetent.c	2008-05-25 10:39:13 UTC (rev 22075)
@@ -39,7 +39,7 @@
 
 static FILE *netf = NULL;
 
-int _net_stayopen attribute_hidden;
+smallint _net_stayopen attribute_hidden;
 
 libc_hidden_proto(setnetent)
 void setnetent(int f)
@@ -49,7 +49,7 @@
 	netf = fopen(NETDB, "r" );
     else
 	rewind(netf);
-    _net_stayopen |= f;
+    if (f) _net_stayopen = 1;
     __UCLIBC_MUTEX_UNLOCK(mylock);
     return;
 }

Modified: trunk/uClibc/libc/inet/getproto.c
===================================================================
--- trunk/uClibc/libc/inet/getproto.c	2008-05-25 06:08:33 UTC (rev 22074)
+++ trunk/uClibc/libc/inet/getproto.c	2008-05-25 10:39:13 UTC (rev 22075)
@@ -83,7 +83,7 @@
 static FILE *protof = NULL;
 static struct protoent proto;
 static char *static_aliases = NULL;
-static int proto_stayopen;
+static smallint proto_stayopen;
 
 static void __initbuf(void)
 {
@@ -100,7 +100,7 @@
 	protof = fopen(_PATH_PROTOCOLS, "r" );
     else
 	rewind(protof);
-    proto_stayopen |= f;
+    if (f) proto_stayopen = 1;
     __UCLIBC_MUTEX_UNLOCK(mylock);
 }
 libc_hidden_def(setprotoent)

Modified: trunk/uClibc/libc/inet/getservice.c
===================================================================
--- trunk/uClibc/libc/inet/getservice.c	2008-05-25 06:08:33 UTC (rev 22074)
+++ trunk/uClibc/libc/inet/getservice.c	2008-05-25 10:39:13 UTC (rev 22075)
@@ -86,7 +86,7 @@
 static FILE *servf = NULL;
 static struct servent serv;
 static char *servbuf = NULL;
-static int serv_stayopen;
+static smallint serv_stayopen;
 
 static void __initbuf(void)
 {
@@ -103,7 +103,7 @@
 	servf = fopen(_PATH_SERVICES, "r" );
     else
 	rewind(servf);
-    serv_stayopen |= f;
+    if (f) serv_stayopen = 1;
     __UCLIBC_MUTEX_UNLOCK(mylock);
 }
 libc_hidden_def(setservent)




More information about the uClibc-cvs mailing list