]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: use MAYBE_UNUSED more consistently
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 9 May 2025 22:52:15 +0000 (15:52 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 9 May 2025 22:57:13 +0000 (15:57 -0700)
* src/basenc.c (no_required_padding):
* gl/lib/smack.h (smack_new_label_from_self)
(smack_set_label_for_self):
* src/cksum.c (output_crc):
* src/digest.c (md5_sum_stream, sha1_sum_stream)
(sha224_sum_stream, sha256_sum_stream, sha384_sum_stream)
(sha512_sum_stream, sm3_sum_stream, output_file):
* src/stat.c (print_statfs, print_stat):
* src/sum.c (output_bsd, output_sysv):
* src/timeout.c (chld):
Mark possibly-unused parameters with MAYBE_UNUSED.

gl/lib/smack.h
src/basenc.c
src/cksum.c
src/digest.c
src/stat.c
src/sum.c
src/timeout.c

index 99f7747aa20493f2d4fccfc2c4e071ad22ce37a3..c503d0b79fa71cca4ca392023384e922eb284683 100644 (file)
 # include <sys/smack.h>
 #else
 static inline ssize_t
-smack_new_label_from_self (char **label)
+smack_new_label_from_self (MAYBE_UNUSED char **label)
 {
   return -1;
 }
 
 static inline int
-smack_set_label_for_self (char const *label)
+smack_set_label_for_self (MAYBE_UNUSED char const *label)
 {
   return -1;
 }
index de1070b44ee2d8f9d35b492bf0ca87bb748ffe7f..3f550a71fa708b364cade11302c703d91bf7be2c 100644 (file)
@@ -193,7 +193,7 @@ base64_required_padding (int len)
 
 #if BASE_TYPE == 42
 static int
-no_required_padding (int len)
+no_required_padding (MAYBE_UNUSED int len)
 {
   return 0;
 }
index 3381125bdb0e6554814c486f18a1ea0dd4ba7e9f..8711ffeb93ecfacf3064171a24910615db31e682 100644 (file)
@@ -356,8 +356,9 @@ crc32b_sum_stream (FILE *stream, void *resstream, uintmax_t *reslen)
    If ARGS is true, also print the FILE name.  */
 
 void
-output_crc (char const *file, int binary_file, void const *digest, bool raw,
-            bool tagged, unsigned char delim, bool args, uintmax_t length)
+output_crc (char const *file, MAYBE_UNUSED int binary_file,
+            void const *digest, bool raw, MAYBE_UNUSED bool tagged,
+            unsigned char delim, bool args, uintmax_t length)
 {
   if (raw)
     {
index 1f65c73b48e3f46818ffb315c2f23b9582ff6a6d..302739e9f511e6796678b698414266dfbe8ec534 100644 (file)
@@ -245,32 +245,36 @@ static digest_output_fn sum_output_fns[]=
 
 #if HASH_ALGO_CKSUM
 static int
-md5_sum_stream (FILE *stream, void *resstream, uintmax_t *length)
+md5_sum_stream (FILE *stream, void *resstream, MAYBE_UNUSED uintmax_t *length)
 {
   return md5_stream (stream, resstream);
 }
 static int
-sha1_sum_stream (FILE *stream, void *resstream, uintmax_t *length)
+sha1_sum_stream (FILE *stream, void *resstream, MAYBE_UNUSED uintmax_t *length)
 {
   return sha1_stream (stream, resstream);
 }
 static int
-sha224_sum_stream (FILE *stream, void *resstream, uintmax_t *length)
+sha224_sum_stream (FILE *stream, void *resstream,
+                   MAYBE_UNUSED uintmax_t *length)
 {
   return sha224_stream (stream, resstream);
 }
 static int
-sha256_sum_stream (FILE *stream, void *resstream, uintmax_t *length)
+sha256_sum_stream (FILE *stream, void *resstream,
+                   MAYBE_UNUSED uintmax_t *length)
 {
   return sha256_stream (stream, resstream);
 }
 static int
-sha384_sum_stream (FILE *stream, void *resstream, uintmax_t *length)
+sha384_sum_stream (FILE *stream, void *resstream,
+                   MAYBE_UNUSED uintmax_t *length)
 {
   return sha384_stream (stream, resstream);
 }
 static int
-sha512_sum_stream (FILE *stream, void *resstream, uintmax_t *length)
+sha512_sum_stream (FILE *stream, void *resstream,
+                   MAYBE_UNUSED uintmax_t *length)
 {
   return sha512_stream (stream, resstream);
 }
@@ -280,7 +284,7 @@ blake2b_sum_stream (FILE *stream, void *resstream, uintmax_t *length)
   return blake2b_stream (stream, resstream, *length);
 }
 static int
-sm3_sum_stream (FILE *stream, void *resstream, uintmax_t *length)
+sm3_sum_stream (FILE *stream, void *resstream, MAYBE_UNUSED uintmax_t *length)
 {
   return sm3_stream (stream, resstream);
 }
@@ -1037,8 +1041,8 @@ digest_file (char const *filename, int *binary, unsigned char *bin_result,
 #if !HASH_ALGO_SUM
 static void
 output_file (char const *file, int binary_file, void const *digest,
-             bool raw, bool tagged, unsigned char delim, MAYBE_UNUSED bool args,
-             MAYBE_UNUSED uintmax_t length)
+             MAYBE_UNUSED bool raw, bool tagged, unsigned char delim,
+             MAYBE_UNUSED bool args, MAYBE_UNUSED uintmax_t length)
 {
 # if HASH_ALGO_CKSUM
   if (raw)
index 3ea7da7f562677d395c34976bed5e76d5eacad16..df9e3d440819c7fedb69e6528c5e7b00bfceabba 100644 (file)
@@ -857,7 +857,7 @@ out_file_context (char *pformat, size_t prefix_len, char const *filename)
 NODISCARD
 static bool
 print_statfs (char *pformat, size_t prefix_len, MAYBE_UNUSED char mod, char m,
-              int fd, char const *filename,
+              MAYBE_UNUSED int fd, char const *filename,
               void const *data)
 {
   STRUCT_STATVFS const *statfsbuf = data;
@@ -1501,7 +1501,7 @@ unsigned_file_size (off_t size)
 /* Print stat info.  Return zero upon success, nonzero upon failure.  */
 static bool
 print_stat (char *pformat, size_t prefix_len, char mod, char m,
-            int fd, char const *filename, void const *data)
+            MAYBE_UNUSED int fd, char const *filename, void const *data)
 {
   struct print_args *parg = (struct print_args *) data;
   struct stat *statbuf = parg->st;
index 95af4e3858f3fcc3abb1c2e81c1fcc6df39a5527..08bb88b12e7646c32a4cb1c8e2ce692a3c801775 100644 (file)
--- a/src/sum.c
+++ b/src/sum.c
@@ -184,8 +184,8 @@ cleanup_buffer:
    If ARGS is true, also print the FILE name.  */
 
 void
-output_bsd (char const *file, int binary_file, void const *digest,
-            bool raw, bool tagged, unsigned char delim, bool args,
+output_bsd (char const *file, MAYBE_UNUSED int binary_file, void const *digest,
+            bool raw, MAYBE_UNUSED bool tagged, unsigned char delim, bool args,
             uintmax_t length)
 {
   if (raw)
@@ -209,9 +209,9 @@ output_bsd (char const *file, int binary_file, void const *digest,
    If ARGS is true, also print the FILE name.  */
 
 void
-output_sysv (char const *file, int binary_file, void const *digest,
-             bool raw, bool tagged, unsigned char delim, bool args,
-             uintmax_t length)
+output_sysv (char const *file, MAYBE_UNUSED int binary_file,
+             void const *digest, bool raw, MAYBE_UNUSED bool tagged,
+             unsigned char delim, bool args, uintmax_t length)
 {
   if (raw)
     {
index e869b2533dc74eac648790e2a29208b3a7a6b413..a73dd329703ec531137062e36c2298a1d575040d 100644 (file)
@@ -187,7 +187,7 @@ send_sig (pid_t where, int sig)
 /* Signal handler which is required for sigsuspend() to be interrupted
    whenever SIGCHLD is received.  */
 static void
-chld (int sig)
+chld (MAYBE_UNUSED int sig)
 {
 }