]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/, src/: Make the use of MAYBE_UNUSED macro consistent
authorPablo Saavedra <psaavedra@igalia.com>
Tue, 23 Jan 2024 07:33:37 +0000 (08:33 +0100)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Tue, 30 Jan 2024 15:19:56 +0000 (16:19 +0100)
There is an inconsistent use of the MAYBE_UNUSED macro. Sometimes the
`int unused(x)` form is used form and others the `unused int x`. We'd
like to use the second form always.

Related-To: https://github.com/shadow-maint/shadow/issues/918
Suggested-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Pablo Saavedra <psaavedra@igalia.com>
lib/logind.c
src/grpconv.c
src/grpunconv.c
src/su.c

index 88f433148bac9651d14d1bdfa7ff0a4ad35ae6df..ba7278ff0b7ae045b5b687e99162c685a0cc1b10 100644 (file)
@@ -36,7 +36,7 @@ done:
     return ret;
 }
 
-unsigned long active_sessions_count(const char *name, unsigned long MAYBE_UNUSED(limit))
+unsigned long active_sessions_count(const char *name, MAYBE_UNUSED unsigned long limit)
 {
     struct passwd *pw;
     unsigned long count = 0;
index 2bed145e000319f8c11093ff76e268e70fc5f0d9..47bd2dbf3f1ac9a8462a5f9ccd8fb9b78de3d361 100644 (file)
@@ -262,7 +262,7 @@ int main (int argc, char **argv)
        return 0;
 }
 #else                          /* !SHADOWGRP */
-int main (int MAYBE_UNUSED(argc), char **argv)
+int main (MAYBE_UNUSED int argc, char **argv)
 {
        fprintf (stderr,
                 "%s: not configured for shadow group support.\n", argv[0]);
index 7932088966a79419359035a3e9e86e66e2c9b72d..4981dbb81930986f39ed5a9ebea3817da1821b35 100644 (file)
@@ -224,7 +224,7 @@ int main (int argc, char **argv)
        return 0;
 }
 #else                          /* !SHADOWGRP */
-int main (int MAYBE_UNUSED(argc), char **argv)
+int main (MAYBE_UNUSED int argc, char **argv)
 {
        fprintf (stderr,
                 "%s: not configured for shadow group support.\n", argv[0]);
index 9639c78bf9de9c153321a5521504f0c0488eea1f..58dad9fb775c5847297835f5b9870d0be6b9c8d4 100644 (file)
--- a/src/su.c
+++ b/src/su.c
@@ -111,7 +111,7 @@ static void execve_shell (const char *shellname,
                           char *args[],
                           char *const envp[]);
 #ifdef USE_PAM
-static void kill_child (int MAYBE_UNUSED(s));
+static void kill_child (MAYBE_UNUSED int s);
 static void prepare_pam_close_session (void);
 #else                          /* !USE_PAM */
 static void die (int);
@@ -165,7 +165,7 @@ static bool iswheel (const char *username)
        return is_on_list (grp->gr_mem, username);
 }
 #else                          /* USE_PAM */
-static void kill_child (int MAYBE_UNUSED(s))
+static void kill_child (MAYBE_UNUSED int s)
 {
        if (0 != pid_child) {
                (void) kill (-pid_child, SIGKILL);