svn commit: trunk/uClibc: include/rpc libc/inet/rpc

vda at uclibc.org vda at uclibc.org
Mon Dec 1 10:02:45 UTC 2008


Author: vda
Date: 2008-12-01 02:02:44 -0800 (Mon, 01 Dec 2008)
New Revision: 24203

Log:
rpc: constify data, localize unnecessarily static data

 text+data text+rodata    rwdata       bss filename
-     2308        2284        24        24 libc/inet/rpc/clnt_unix.o
+     2308        2308         0         0 libc/inet/rpc/clnt_unix.o



Modified:
   trunk/uClibc/include/rpc/clnt.h
   trunk/uClibc/libc/inet/rpc/clnt_unix.c


Changeset:
Modified: trunk/uClibc/include/rpc/clnt.h
===================================================================
--- trunk/uClibc/include/rpc/clnt.h	2008-12-01 09:43:37 UTC (rev 24202)
+++ trunk/uClibc/include/rpc/clnt.h	2008-12-01 10:02:44 UTC (rev 24203)
@@ -132,6 +132,10 @@
 typedef struct CLIENT CLIENT;
 struct CLIENT {
   AUTH	*cl_auth;		 /* authenticator */
+  /* not sure whether non-const-ness is a part of the spec... if it is,
+   * enclose "const" in #ifdef UCLIBC_INTERNAL / #endif
+   * to make it effective only for libc compile */
+  const
   struct clnt_ops {
     enum clnt_stat (*cl_call) (CLIENT *, u_long, xdrproc_t, caddr_t, xdrproc_t,
 			       caddr_t, struct timeval);

Modified: trunk/uClibc/libc/inet/rpc/clnt_unix.c
===================================================================
--- trunk/uClibc/libc/inet/rpc/clnt_unix.c	2008-12-01 09:43:37 UTC (rev 24202)
+++ trunk/uClibc/libc/inet/rpc/clnt_unix.c	2008-12-01 10:02:44 UTC (rev 24203)
@@ -116,7 +116,7 @@
 static bool_t clntunix_control (CLIENT *, int, char *);
 static void clntunix_destroy (CLIENT *);
 
-static struct clnt_ops unix_ops =
+static const struct clnt_ops unix_ops =
 {
   clntunix_call,
   clntunix_abort,
@@ -474,7 +474,7 @@
   struct iovec iov;
   struct msghdr msg;
 #ifdef SCM_CREDENTIALS
-  static char cm[CMSG_SPACE(sizeof (struct ucred))];
+  /*static -why??*/ char cm[CMSG_SPACE(sizeof (struct ucred))];
 #endif
   int len;
 




More information about the uClibc-cvs mailing list