diff options
| author | Alejandro Colomar <alx@kernel.org> | 2024-11-16 16:51:31 +0100 |
|---|---|---|
| committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2024-11-25 16:45:59 -0300 |
| commit | 53fcdf5f743aa9b02972eec658e66f96d6a63386 (patch) | |
| tree | e1bd3ed90d89027abe4b8ba6f0dbffd833f08a9b /sunrpc | |
| parent | 83d4b42ded712bbbc22ceeefe886b8315190da5b (diff) | |
| download | glibc-53fcdf5f743aa9b02972eec658e66f96d6a63386.tar.xz glibc-53fcdf5f743aa9b02972eec658e66f96d6a63386.zip | |
Silence most -Wzero-as-null-pointer-constant diagnostics
Replace 0 by NULL and {0} by {}.
Omit a few cases that aren't so trivial to fix.
Link: <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117059>
Link: <https://software.codidact.com/posts/292718/292759#answer-292759>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Diffstat (limited to 'sunrpc')
| -rw-r--r-- | sunrpc/clnt_raw.c | 6 | ||||
| -rw-r--r-- | sunrpc/clnt_simp.c | 4 | ||||
| -rw-r--r-- | sunrpc/key_call.c | 2 | ||||
| -rw-r--r-- | sunrpc/svc_raw.c | 12 | ||||
| -rw-r--r-- | sunrpc/svc_simple.c | 2 | ||||
| -rw-r--r-- | sunrpc/xdr_mem.c | 2 | ||||
| -rw-r--r-- | sunrpc/xdr_sizeof.c | 4 | ||||
| -rw-r--r-- | sunrpc/xdr_stdio.c | 2 |
8 files changed, 17 insertions, 17 deletions
diff --git a/sunrpc/clnt_raw.c b/sunrpc/clnt_raw.c index 5b9bd48247..79c0964e7b 100644 --- a/sunrpc/clnt_raw.c +++ b/sunrpc/clnt_raw.c @@ -90,11 +90,11 @@ clntraw_create (u_long prog, u_long vers) XDR *xdrs; CLIENT *client; - if (clp == 0) + if (clp == NULL) { clp = (struct clntraw_private_s *) calloc (1, sizeof (*clp)); - if (clp == 0) - return (0); + if (clp == NULL) + return NULL; clntraw_private = clp; } xdrs = &clp->xdr_stream; diff --git a/sunrpc/clnt_simp.c b/sunrpc/clnt_simp.c index fab61d2170..ee77af9cbc 100644 --- a/sunrpc/clnt_simp.c +++ b/sunrpc/clnt_simp.c @@ -60,10 +60,10 @@ callrpc (const char *host, u_long prognum, u_long versnum, u_long procnum, enum clnt_stat clnt_stat; struct timeval timeout, tottimeout; - if (crp == 0) + if (crp == NULL) { crp = (struct callrpc_private_s *) calloc (1, sizeof (*crp)); - if (crp == 0) + if (crp == NULL) return 0; callrpc_private = crp; } diff --git a/sunrpc/key_call.c b/sunrpc/key_call.c index b0b29e09a7..c8e414b1df 100644 --- a/sunrpc/key_call.c +++ b/sunrpc/key_call.c @@ -542,7 +542,7 @@ key_call (u_long proc, xdrproc_t xdr_arg, char *arg, else if (proc == KEY_GEN && __key_gendes_LOCAL) { des_block *res; - res = (*__key_gendes_LOCAL) (__geteuid (), 0); + res = (*__key_gendes_LOCAL) (__geteuid (), NULL); *(des_block *) rslt = *res; return 1; } diff --git a/sunrpc/svc_raw.c b/sunrpc/svc_raw.c index f0176311d5..2879ce6f84 100644 --- a/sunrpc/svc_raw.c +++ b/sunrpc/svc_raw.c @@ -72,10 +72,10 @@ svcraw_create (void) { struct svcraw_private_s *srp = svcraw_private; - if (srp == 0) + if (srp == NULL) { srp = (struct svcraw_private_s *) calloc (1, sizeof (*srp)); - if (srp == 0) + if (srp == NULL) return NULL; } srp->server.xp_sock = 0; @@ -99,7 +99,7 @@ svcraw_recv (SVCXPRT *xprt, struct rpc_msg *msg) struct svcraw_private_s *srp = svcraw_private; XDR *xdrs; - if (srp == 0) + if (srp == NULL) return FALSE; xdrs = &srp->xdr_stream; xdrs->x_op = XDR_DECODE; @@ -115,7 +115,7 @@ svcraw_reply (SVCXPRT *xprt, struct rpc_msg *msg) struct svcraw_private_s *srp = svcraw_private; XDR *xdrs; - if (srp == 0) + if (srp == NULL) return FALSE; xdrs = &srp->xdr_stream; xdrs->x_op = XDR_ENCODE; @@ -131,7 +131,7 @@ svcraw_getargs (SVCXPRT *xprt, xdrproc_t xdr_args, caddr_t args_ptr) { struct svcraw_private_s *srp = svcraw_private; - if (srp == 0) + if (srp == NULL) return FALSE; return (*xdr_args) (&srp->xdr_stream, args_ptr); } @@ -142,7 +142,7 @@ svcraw_freeargs (SVCXPRT *xprt, xdrproc_t xdr_args, caddr_t args_ptr) struct svcraw_private_s *srp = svcraw_private; XDR *xdrs; - if (srp == 0) + if (srp == NULL) return FALSE; xdrs = &srp->xdr_stream; xdrs->x_op = XDR_FREE; diff --git a/sunrpc/svc_simple.c b/sunrpc/svc_simple.c index 2f2595c0ff..5a6dd1fce6 100644 --- a/sunrpc/svc_simple.c +++ b/sunrpc/svc_simple.c @@ -74,7 +74,7 @@ __registerrpc (u_long prognum, u_long versnum, u_long procnum, buf = NULL; goto err_out; } - if (transp == 0) + if (transp == NULL) { transp = svcudp_create (RPC_ANYSOCK); if (transp == NULL) diff --git a/sunrpc/xdr_mem.c b/sunrpc/xdr_mem.c index 46a1f6f190..a5aa93f437 100644 --- a/sunrpc/xdr_mem.c +++ b/sunrpc/xdr_mem.c @@ -195,7 +195,7 @@ xdrmem_setpos (XDR *xdrs, u_int pos) static int32_t * xdrmem_inline (XDR *xdrs, u_int len) { - int32_t *buf = 0; + int32_t *buf = NULL; if (xdrs->x_handy >= len) { diff --git a/sunrpc/xdr_sizeof.c b/sunrpc/xdr_sizeof.c index 1592406d64..03c23cd42b 100644 --- a/sunrpc/xdr_sizeof.c +++ b/sunrpc/xdr_sizeof.c @@ -89,7 +89,7 @@ x_inline (XDR *xdrs, u_int len) free (xdrs->x_private); if ((xdrs->x_private = (caddr_t) malloc (len)) == NULL) { - xdrs->x_base = 0; + xdrs->x_base = NULL; return NULL; } xdrs->x_base = (void *) (long) len; @@ -109,7 +109,7 @@ static void x_destroy (XDR *xdrs) { xdrs->x_handy = 0; - xdrs->x_base = 0; + xdrs->x_base = NULL; if (xdrs->x_private) { free (xdrs->x_private); diff --git a/sunrpc/xdr_stdio.c b/sunrpc/xdr_stdio.c index 0c2cbb78de..204ed599ae 100644 --- a/sunrpc/xdr_stdio.c +++ b/sunrpc/xdr_stdio.c @@ -89,7 +89,7 @@ xdrstdio_create (XDR *xdrs, FILE *file, enum xdr_op op) xdrs->x_ops = (struct xdr_ops *) &xdrstdio_ops; xdrs->x_private = (caddr_t) file; xdrs->x_handy = 0; - xdrs->x_base = 0; + xdrs->x_base = NULL; } /* |
