[uClibc-cvs] uClibc/libc/inet/rpc auth_none.c, 1.6, 1.7 clnt_perror.c, 1.9, 1.10 clnt_raw.c, 1.7, 1.8 clnt_simple.c, 1.9, 1.10 svc.c, 1.10, 1.11 svc_raw.c, 1.7, 1.8 svc_simple.c, 1.8, 1.9

Erik Andersen andersen at uclibc.org
Wed Feb 18 01:15:37 UTC 2004


Update of /var/cvs/uClibc/libc/inet/rpc
In directory nail:/tmp/cvs-serv2424/libc/inet/rpc

Modified Files:
	auth_none.c clnt_perror.c clnt_raw.c clnt_simple.c svc.c 
	svc_raw.c svc_simple.c 
Log Message:
Alexandre Oliva writes:

While testing the FR-V code with GCC mainline, I ran into some
problems in the RPC code.  It relies on a GCC extension that is no
longer available, namely, the result of a cast is no longer considered
an lvalue.

This patch enables the code to compile.  I haven't been able to test
RPC though, especially in a multi-threaded environment.



Index: clnt_simple.c
===================================================================
RCS file: /var/cvs/uClibc/libc/inet/rpc/clnt_simple.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- clnt_simple.c	6 Aug 2002 14:46:14 -0000	1.9
+++ clnt_simple.c	18 Feb 2004 01:15:34 -0000	1.10
@@ -58,7 +58,7 @@
     char *oldhost;
   };
 #ifdef __UCLIBC_HAS_THREADS__
-#define callrpc_private ((struct callrpc_private_s *)RPC_THREAD_VARIABLE(callrpc_private_s))
+#define callrpc_private (*(struct callrpc_private_s **)&RPC_THREAD_VARIABLE(callrpc_private_s))
 #else
 static struct callrpc_private_s *callrpc_private;
 #endif

Index: clnt_perror.c
===================================================================
RCS file: /var/cvs/uClibc/libc/inet/rpc/clnt_perror.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- clnt_perror.c	6 Aug 2002 14:46:14 -0000	1.9
+++ clnt_perror.c	18 Feb 2004 01:15:34 -0000	1.10
@@ -58,7 +58,7 @@
  * buf variable in a few functions.  Overriding a global variable
  * with a local variable of the same name is a bad idea, anyway.
  */
-#define buf ((char *)RPC_THREAD_VARIABLE(clnt_perr_buf_s))
+#define buf (*(char **)&RPC_THREAD_VARIABLE(clnt_perr_buf_s))
 #else
 static char *buf;
 #endif

Index: svc_raw.c
===================================================================
RCS file: /var/cvs/uClibc/libc/inet/rpc/svc_raw.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- svc_raw.c	6 Aug 2002 14:46:14 -0000	1.7
+++ svc_raw.c	18 Feb 2004 01:15:34 -0000	1.8
@@ -56,7 +56,7 @@
     char verf_body[MAX_AUTH_BYTES];
   };
 #ifdef __UCLIBC_HAS_THREADS__
-#define svcraw_private ((struct svcraw_private_s *)RPC_THREAD_VARIABLE(svcraw_private_s))
+#define svcraw_private (*(struct svcraw_private_s **)&RPC_THREAD_VARIABLE(svcraw_private_s))
 #else
 static struct svcraw_private_s *svcraw_private;
 #endif

Index: svc.c
===================================================================
RCS file: /var/cvs/uClibc/libc/inet/rpc/svc.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- svc.c	6 Aug 2002 14:46:14 -0000	1.10
+++ svc.c	18 Feb 2004 01:15:34 -0000	1.11
@@ -48,7 +48,7 @@
 #include <sys/poll.h>
 
 #ifdef __UCLIBC_HAS_THREADS__
-#define xports ((SVCXPRT **)RPC_THREAD_VARIABLE(svc_xports_s))
+#define xports (*(SVCXPRT ***)&RPC_THREAD_VARIABLE(svc_xports_s))
 #else
 static SVCXPRT **xports;
 #endif
@@ -67,7 +67,7 @@
   void (*sc_dispatch) (struct svc_req *, SVCXPRT *);
 };
 #ifdef __UCLIBC_HAS_THREADS__
-#define svc_head ((struct svc_callout *)RPC_THREAD_VARIABLE(svc_head_s))
+#define svc_head (*(struct svc_callout **)&RPC_THREAD_VARIABLE(svc_head_s))
 #else
 static struct svc_callout *svc_head;
 #endif

Index: clnt_raw.c
===================================================================
RCS file: /var/cvs/uClibc/libc/inet/rpc/clnt_raw.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- clnt_raw.c	6 Aug 2002 14:46:14 -0000	1.7
+++ clnt_raw.c	18 Feb 2004 01:15:34 -0000	1.8
@@ -62,7 +62,7 @@
     u_int mcnt;
   };
 #ifdef __UCLIBC_HAS_THREADS__
-#define clntraw_private ((struct clntraw_private_s *)RPC_THREAD_VARIABLE(clntraw_private_s))
+#define clntraw_private (*(struct clntraw_private_s **)&RPC_THREAD_VARIABLE(clntraw_private_s))
 #else
 static struct clntraw_private_s *clntraw_private;
 #endif

Index: svc_simple.c
===================================================================
RCS file: /var/cvs/uClibc/libc/inet/rpc/svc_simple.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- svc_simple.c	6 Aug 2002 14:46:14 -0000	1.8
+++ svc_simple.c	18 Feb 2004 01:15:34 -0000	1.9
@@ -64,7 +64,7 @@
     struct proglst_ *p_nxt;
   };
 #ifdef __UCLIBC_HAS_THREADS__
-#define proglst ((struct proglst_ *)RPC_THREAD_VARIABLE(svcsimple_proglst_s))
+#define proglst (*(struct proglst_ **)&RPC_THREAD_VARIABLE(svcsimple_proglst_s))
 #else
 static struct proglst_ *proglst;
 #endif
@@ -72,7 +72,7 @@
 
 static void universal (struct svc_req *rqstp, SVCXPRT *transp_s);
 #ifdef __UCLIBC_HAS_THREADS__
-#define transp ((SVCXPRT *)RPC_THREAD_VARIABLE(svcsimple_transp_s))
+#define transp (*(SVCXPRT **)&RPC_THREAD_VARIABLE(svcsimple_transp_s))
 #else
 static SVCXPRT *transp;
 #endif

Index: auth_none.c
===================================================================
RCS file: /var/cvs/uClibc/libc/inet/rpc/auth_none.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- auth_none.c	6 Aug 2002 14:46:14 -0000	1.6
+++ auth_none.c	18 Feb 2004 01:15:34 -0000	1.7
@@ -64,7 +64,7 @@
   u_int mcnt;
 };
 #ifdef __UCLIBC_HAS_THREADS__
-#define authnone_private ((struct authnone_private_s *)RPC_THREAD_VARIABLE(authnone_private_s))
+#define authnone_private (*(struct authnone_private_s **)&RPC_THREAD_VARIABLE(authnone_private_s))
 #else
 static struct authnone_private_s *authnone_private;
 #endif
@@ -105,7 +105,7 @@
 {
   struct authnone_private_s *ap;
 
-  ap = (struct authnone_private_s *) authnone_private;
+  ap = authnone_private;
   if (ap == NULL)
     return FALSE;
   return (*xdrs->x_ops->x_putbytes) (xdrs, ap->marshalled_client, ap->mcnt);




More information about the uClibc-cvs mailing list