lib/, src/: Rename 'unused' macro as 'MAYBE_UNUSED'

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>
This commit is contained in:
Pablo Saavedra
2024-01-22 10:00:54 +01:00
committed by Iker Pedrosa
parent da84d0ede7
commit 5d5d212764
20 changed files with 43 additions and 43 deletions
+2 -2
View File
@@ -29,14 +29,14 @@ const char *Prog;
static bool cflg = false;
/* local function prototypes */
static void catch_signals (unused int sig);
static void catch_signals (MAYBE_UNUSED int sig);
NORETURN static void usage (int status);
static void process_flags (int argc, char **argv);
/*
* catch_signals - signal catcher
*/
static void catch_signals (unused int sig)
static void catch_signals (MAYBE_UNUSED int sig)
{
_exit (10);
}
+10 -10
View File
@@ -101,14 +101,14 @@ static void update_group (struct group *gr);
static void change_passwd (struct group *gr);
#endif
static void log_gpasswd_failure (const char *suffix);
static void log_gpasswd_failure_system (/*@null@*/unused void *arg);
static void log_gpasswd_failure_group (/*@null@*/unused void *arg);
static void log_gpasswd_failure_system (/*@null@*/MAYBE_UNUSED void *arg);
static void log_gpasswd_failure_group (/*@null@*/MAYBE_UNUSED void *arg);
#ifdef SHADOWGRP
static void log_gpasswd_failure_gshadow (/*@null@*/unused void *arg);
static void log_gpasswd_failure_gshadow (/*@null@*/MAYBE_UNUSED void *arg);
#endif
static void log_gpasswd_success (const char *suffix);
static void log_gpasswd_success_system (/*@null@*/unused void *arg);
static void log_gpasswd_success_group (/*@null@*/unused void *arg);
static void log_gpasswd_success_system (/*@null@*/MAYBE_UNUSED void *arg);
static void log_gpasswd_success_group (/*@null@*/MAYBE_UNUSED void *arg);
/*
* usage - display usage message
@@ -480,12 +480,12 @@ static void log_gpasswd_failure (const char *suffix)
}
}
static void log_gpasswd_failure_system (unused void *arg)
static void log_gpasswd_failure_system (MAYBE_UNUSED void *arg)
{
log_gpasswd_failure ("");
}
static void log_gpasswd_failure_group (unused void *arg)
static void log_gpasswd_failure_group (MAYBE_UNUSED void *arg)
{
char buf[1024];
@@ -494,7 +494,7 @@ static void log_gpasswd_failure_group (unused void *arg)
}
#ifdef SHADOWGRP
static void log_gpasswd_failure_gshadow (unused void *arg)
static void log_gpasswd_failure_gshadow (MAYBE_UNUSED void *arg)
{
char buf[1024];
@@ -601,12 +601,12 @@ static void log_gpasswd_success (const char *suffix)
}
}
static void log_gpasswd_success_system (unused void *arg)
static void log_gpasswd_success_system (MAYBE_UNUSED void *arg)
{
log_gpasswd_success ("");
}
static void log_gpasswd_success_group (unused void *arg)
static void log_gpasswd_success_group (MAYBE_UNUSED void *arg)
{
char buf[1024];
+1 -1
View File
@@ -262,7 +262,7 @@ int main (int argc, char **argv)
return 0;
}
#else /* !SHADOWGRP */
int main (int unused(argc), char **argv)
int main (int MAYBE_UNUSED(argc), char **argv)
{
fprintf (stderr,
"%s: not configured for shadow group support.\n", argv[0]);
+1 -1
View File
@@ -224,7 +224,7 @@ int main (int argc, char **argv)
return 0;
}
#else /* !SHADOWGRP */
int main (int unused(argc), char **argv)
int main (int MAYBE_UNUSED(argc), char **argv)
{
fprintf (stderr,
"%s: not configured for shadow group support.\n", argv[0]);
+2 -2
View File
@@ -397,12 +397,12 @@ static void init_env (void)
#endif /* !USE_PAM */
}
static void exit_handler (unused int sig)
static void exit_handler (MAYBE_UNUSED int sig)
{
_exit (0);
}
static void alarm_handler (unused int sig)
static void alarm_handler (MAYBE_UNUSED int sig)
{
write_full(STDERR_FILENO, tmsg, strlen(tmsg));
signal(SIGALRM, exit_handler);
+2 -2
View File
@@ -111,7 +111,7 @@ static void execve_shell (const char *shellname,
char *args[],
char *const envp[]);
#ifdef USE_PAM
static void kill_child (int unused(s));
static void kill_child (int MAYBE_UNUSED(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 unused(s))
static void kill_child (int MAYBE_UNUSED(s))
{
if (0 != pid_child) {
(void) kill (-pid_child, SIGKILL);
+1 -1
View File
@@ -50,7 +50,7 @@ static void catch_signals (int);
static int pw_entry(const char *name, struct passwd *pwent);
static void catch_signals (unused int sig)
static void catch_signals (MAYBE_UNUSED int sig)
{
_exit (1);
}