From 377c7157a8802c289c5560f1a2ecd1030d571e7d Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 18 Feb 2004 01:15:34 +0000 Subject: 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. --- libc/inet/rpc/auth_none.c | 4 ++-- libc/inet/rpc/clnt_perror.c | 2 +- libc/inet/rpc/clnt_raw.c | 2 +- libc/inet/rpc/clnt_simple.c | 2 +- libc/inet/rpc/svc.c | 4 ++-- libc/inet/rpc/svc_raw.c | 2 +- libc/inet/rpc/svc_simple.c | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) (limited to 'libc/inet') diff --git a/libc/inet/rpc/auth_none.c b/libc/inet/rpc/auth_none.c index b4a341445..b2683a651 100644 --- a/libc/inet/rpc/auth_none.c +++ b/libc/inet/rpc/auth_none.c @@ -64,7 +64,7 @@ struct authnone_private_s { 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 @@ authnone_marshal (AUTH *client, XDR *xdrs) { 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); diff --git a/libc/inet/rpc/clnt_perror.c b/libc/inet/rpc/clnt_perror.c index 975075c42..c4b8ee5f6 100644 --- a/libc/inet/rpc/clnt_perror.c +++ b/libc/inet/rpc/clnt_perror.c @@ -58,7 +58,7 @@ static char *auth_errmsg (enum auth_stat stat) internal_function; * 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 diff --git a/libc/inet/rpc/clnt_raw.c b/libc/inet/rpc/clnt_raw.c index 603423668..a1062109f 100644 --- a/libc/inet/rpc/clnt_raw.c +++ b/libc/inet/rpc/clnt_raw.c @@ -62,7 +62,7 @@ struct clntraw_private_s 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 diff --git a/libc/inet/rpc/clnt_simple.c b/libc/inet/rpc/clnt_simple.c index 425288293..b0af24a98 100644 --- a/libc/inet/rpc/clnt_simple.c +++ b/libc/inet/rpc/clnt_simple.c @@ -58,7 +58,7 @@ struct callrpc_private_s 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 diff --git a/libc/inet/rpc/svc.c b/libc/inet/rpc/svc.c index af4c6979f..6e1d8dc3d 100644 --- a/libc/inet/rpc/svc.c +++ b/libc/inet/rpc/svc.c @@ -48,7 +48,7 @@ #include #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 @@ struct svc_callout { 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 diff --git a/libc/inet/rpc/svc_raw.c b/libc/inet/rpc/svc_raw.c index 059f9c5ec..05bf3109c 100644 --- a/libc/inet/rpc/svc_raw.c +++ b/libc/inet/rpc/svc_raw.c @@ -56,7 +56,7 @@ struct svcraw_private_s 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 diff --git a/libc/inet/rpc/svc_simple.c b/libc/inet/rpc/svc_simple.c index b2cc6ee5d..81dead7a1 100644 --- a/libc/inet/rpc/svc_simple.c +++ b/libc/inet/rpc/svc_simple.c @@ -64,7 +64,7 @@ struct proglst_ 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 struct proglst_ *proglst; 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 -- cgit v1.2.3