From: Alejandro Colomar Date: Fri, 21 Feb 2025 05:25:15 +0000 (+0100) Subject: lib/, src/ tests/: Unname unused parameters in callbacks X-Git-Tag: 4.19.0-rc1~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9e711e2240c72017dacf088d2931fb26dc6e8fed;p=thirdparty%2Fshadow.git lib/, src/ tests/: Unname unused parameters in callbacks [Serge: preference to keep the names as a comment, but ok] Reviewed-by: Serge Hallyn Signed-off-by: Alejandro Colomar --- diff --git a/lib/cleanup_user.c b/lib/cleanup_user.c index 00554d89c..0af0c67f1 100644 --- a/lib/cleanup_user.c +++ b/lib/cleanup_user.c @@ -9,7 +9,6 @@ #include #include -#include "attr.h" #include "defines.h" #include "pwio.h" #include "shadowio.h" diff --git a/lib/copydir.c b/lib/copydir.c index 69eba5338..9bfc94bb1 100644 --- a/lib/copydir.c +++ b/lib/copydir.c @@ -99,7 +99,8 @@ static int fchown_if_needed (int fdst, const struct stat *statp, * error_acl - format the error messages for the ACL and EQ libraries. */ format_attr(printf, 2, 3) -static void error_acl (MAYBE_UNUSED struct error_context *ctx, const char *fmt, ...) +static void +error_acl(struct error_context *, const char *fmt, ...) { va_list ap; FILE *shadow_logfd = log_get_logfd(); diff --git a/lib/loginprompt.c b/lib/loginprompt.c index 4798d1c61..18b899f5d 100644 --- a/lib/loginprompt.c +++ b/lib/loginprompt.c @@ -26,7 +26,8 @@ #include "string/strtok/stpsep.h" -static void login_exit (MAYBE_UNUSED int sig) +static void +login_exit(int) { _exit (EXIT_FAILURE); } diff --git a/lib/pam_pass_non_interactive.c b/lib/pam_pass_non_interactive.c index 189baad88..411a5f154 100644 --- a/lib/pam_pass_non_interactive.c +++ b/lib/pam_pass_non_interactive.c @@ -27,7 +27,7 @@ static int ni_conv (int num_msg, const struct pam_message **msg, struct pam_response **resp, - MAYBE_UNUSED void *appdata_ptr); + void *); static const struct pam_conv non_interactive_pam_conv = { ni_conv, NULL @@ -38,7 +38,7 @@ static const struct pam_conv non_interactive_pam_conv = { static int ni_conv (int num_msg, const struct pam_message **msg, struct pam_response **resp, - MAYBE_UNUSED void *appdata_ptr) + void *) { struct pam_response *responses; int count; diff --git a/lib/semanage.c b/lib/semanage.c index c9742f0c0..e20fea6ef 100644 --- a/lib/semanage.c +++ b/lib/semanage.c @@ -28,7 +28,7 @@ format_attr(printf, 3, 4) -static void semanage_error_callback (MAYBE_UNUSED void *varg, +static void semanage_error_callback (void *, semanage_handle_t *handle, const char *fmt, ...) { diff --git a/src/expiry.c b/src/expiry.c index 412e54d69..8da89bdf7 100644 --- a/src/expiry.c +++ b/src/expiry.c @@ -29,14 +29,15 @@ static const char Prog[] = "expiry"; static bool cflg = false; /* local function prototypes */ -static void catch_signals (MAYBE_UNUSED int sig); +static void catch_signals(int); NORETURN static void usage (int status); static void process_flags (int argc, char **argv); /* * catch_signals - signal catcher */ -static void catch_signals (MAYBE_UNUSED int sig) +static void +catch_signals(int) { _exit (10); } diff --git a/src/gpasswd.c b/src/gpasswd.c index b95ee064f..98cc53d05 100644 --- a/src/gpasswd.c +++ b/src/gpasswd.c @@ -109,14 +109,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@*/MAYBE_UNUSED void *arg); -static void log_gpasswd_failure_group (/*@null@*/MAYBE_UNUSED void *arg); +static void log_gpasswd_failure_system (/*@null@*/void *); +static void log_gpasswd_failure_group (/*@null@*/void *); #ifdef SHADOWGRP -static void log_gpasswd_failure_gshadow (/*@null@*/MAYBE_UNUSED void *arg); +static void log_gpasswd_failure_gshadow (/*@null@*/void *); #endif static void log_gpasswd_success (const char *suffix); -static void log_gpasswd_success_system (/*@null@*/MAYBE_UNUSED void *arg); -static void log_gpasswd_success_group (/*@null@*/MAYBE_UNUSED void *arg); +static void log_gpasswd_success_system (/*@null@*/void *); +static void log_gpasswd_success_group(/*@null@*/void *); /* * usage - display usage message @@ -467,12 +467,14 @@ static void log_gpasswd_failure (const char *suffix) } } -static void log_gpasswd_failure_system (MAYBE_UNUSED void *arg) +static void +log_gpasswd_failure_system(void *) { log_gpasswd_failure (""); } -static void log_gpasswd_failure_group (MAYBE_UNUSED void *arg) +static void +log_gpasswd_failure_group(void *) { char buf[1024]; @@ -481,7 +483,8 @@ static void log_gpasswd_failure_group (MAYBE_UNUSED void *arg) } #ifdef SHADOWGRP -static void log_gpasswd_failure_gshadow (MAYBE_UNUSED void *arg) +static void +log_gpasswd_failure_gshadow(void *) { char buf[1024]; @@ -578,12 +581,14 @@ static void log_gpasswd_success (const char *suffix) } } -static void log_gpasswd_success_system (MAYBE_UNUSED void *arg) +static void +log_gpasswd_success_system(void *) { log_gpasswd_success (""); } -static void log_gpasswd_success_group (MAYBE_UNUSED void *arg) +static void +log_gpasswd_success_group(void *) { char buf[1024]; diff --git a/src/login.c b/src/login.c index a3ba39e17..6798bb1d0 100644 --- a/src/login.c +++ b/src/login.c @@ -366,12 +366,14 @@ static void init_env (void) #endif /* !USE_PAM */ } -static void exit_handler (MAYBE_UNUSED int sig) +static void +exit_handler(int) { _exit (0); } -static void alarm_handler (MAYBE_UNUSED int sig) +static void +alarm_handler(int) { write_full(STDERR_FILENO, tmsg, strlen(tmsg)); signal(SIGALRM, exit_handler); diff --git a/src/su.c b/src/su.c index 5ba80e649..86f84304b 100644 --- a/src/su.c +++ b/src/su.c @@ -115,7 +115,7 @@ static void execve_shell (const char *shellname, char *args[], char *const envp[]); #ifdef USE_PAM -static void kill_child (MAYBE_UNUSED int s); +static void kill_child(int); static void prepare_pam_close_session (void); #else /* !USE_PAM */ static void die (int); @@ -169,7 +169,8 @@ static bool iswheel (const char *username) return is_on_list (grp->gr_mem, username); } #else /* USE_PAM */ -static void kill_child (MAYBE_UNUSED int s) +static void +kill_child(int) { if (0 != pid_child) { (void) kill (-pid_child, SIGKILL); diff --git a/src/sulogin.c b/src/sulogin.c index 74d2ff376..3089c02d2 100644 --- a/src/sulogin.c +++ b/src/sulogin.c @@ -49,7 +49,8 @@ static void catch_signals (int); static int pw_entry(const char *name, struct passwd *pwent); -static void catch_signals (MAYBE_UNUSED int sig) +static void +catch_signals(int) { _exit (1); } diff --git a/tests/unit/test_logind.c b/tests/unit/test_logind.c index 4f5cf7576..6cfc6d911 100644 --- a/tests/unit/test_logind.c +++ b/tests/unit/test_logind.c @@ -19,13 +19,13 @@ * WRAPPERS **********************/ struct passwd * -__wrap_prefix_getpwnam(uid_t uid) +__wrap_prefix_getpwnam(uid_t) { return (struct passwd*) mock(); } int -__wrap_sd_uid_get_sessions(uid_t uid, int require_active, char ***sessions) +__wrap_sd_uid_get_sessions(uid_t, int, char ***) { return mock(); }