Use strict prototypes

Function declarations with no argument declare functions taking an
arbitrary number of arguments. Use the special type void to declare
functions taking no argument.
This commit is contained in:
Christian Göttsche 2022-01-03 12:43:01 +01:00
parent f84b8530c5
commit 45bba0e190
3 changed files with 16 additions and 16 deletions

View File

@ -29,7 +29,7 @@ bool nss_is_initialized() {
return atomic_load(&nss_init_completed); return atomic_load(&nss_init_completed);
} }
static void nss_exit() { static void nss_exit(void) {
if (nss_is_initialized() && subid_nss) { if (nss_is_initialized() && subid_nss) {
dlclose(subid_nss->handle); dlclose(subid_nss->handle);
free(subid_nss); free(subid_nss);

View File

@ -164,7 +164,7 @@ extern int getrange (char *range,
unsigned long *max, bool *has_max); unsigned long *max, bool *has_max);
/* gettime.c */ /* gettime.c */
extern time_t gettime (); extern time_t gettime (void);
/* get_uid.c */ /* get_uid.c */
extern int get_uid (const char *uidstr, uid_t *uid); extern int get_uid (const char *uidstr, uid_t *uid);
@ -243,7 +243,7 @@ extern /*@null@*//*@only@*/struct passwd *get_my_pwent (void);
/* nss.c */ /* nss.c */
#include <libsubid/subid.h> #include <libsubid/subid.h>
extern void nss_init(char *nsswitch_path); extern void nss_init(char *nsswitch_path);
extern bool nss_is_initialized(); extern bool nss_is_initialized(void);
struct subid_nss_ops { struct subid_nss_ops {
/* /*
@ -293,7 +293,7 @@ struct subid_nss_ops {
void *handle; void *handle;
}; };
extern struct subid_nss_ops *get_subid_nss_handle(); extern struct subid_nss_ops *get_subid_nss_handle(void);
/* pam_pass_non_interactive.c */ /* pam_pass_non_interactive.c */
@ -324,12 +324,12 @@ extern struct passwd *prefix_getpwuid(uid_t uid);
extern struct passwd *prefix_getpwnam(const char* name); extern struct passwd *prefix_getpwnam(const char* name);
extern struct spwd *prefix_getspnam(const char* name); extern struct spwd *prefix_getspnam(const char* name);
extern struct group *prefix_getgr_nam_gid(const char *grname); extern struct group *prefix_getgr_nam_gid(const char *grname);
extern void prefix_setpwent(); extern void prefix_setpwent(void);
extern struct passwd* prefix_getpwent(); extern struct passwd* prefix_getpwent(void);
extern void prefix_endpwent(); extern void prefix_endpwent(void);
extern void prefix_setgrent(); extern void prefix_setgrent(void);
extern struct group* prefix_getgrent(); extern struct group* prefix_getgrent(void);
extern void prefix_endgrent(); extern void prefix_endgrent(void);
/* pwd2spwd.c */ /* pwd2spwd.c */
#ifndef USE_PAM #ifndef USE_PAM

View File

@ -248,7 +248,7 @@ extern struct spwd *prefix_getspnam(const char* name)
} }
} }
extern void prefix_setpwent() extern void prefix_setpwent(void)
{ {
if (!passwd_db_file) { if (!passwd_db_file) {
setpwent(); setpwent();
@ -261,7 +261,7 @@ extern void prefix_setpwent()
if (!fp_pwent) if (!fp_pwent)
return; return;
} }
extern struct passwd* prefix_getpwent() extern struct passwd* prefix_getpwent(void)
{ {
if (!passwd_db_file) { if (!passwd_db_file) {
return getpwent(); return getpwent();
@ -271,7 +271,7 @@ extern struct passwd* prefix_getpwent()
} }
return fgetpwent(fp_pwent); return fgetpwent(fp_pwent);
} }
extern void prefix_endpwent() extern void prefix_endpwent(void)
{ {
if (!passwd_db_file) { if (!passwd_db_file) {
endpwent(); endpwent();
@ -282,7 +282,7 @@ extern void prefix_endpwent()
fp_pwent = NULL; fp_pwent = NULL;
} }
extern void prefix_setgrent() extern void prefix_setgrent(void)
{ {
if (!group_db_file) { if (!group_db_file) {
setgrent(); setgrent();
@ -295,14 +295,14 @@ extern void prefix_setgrent()
if (!fp_grent) if (!fp_grent)
return; return;
} }
extern struct group* prefix_getgrent() extern struct group* prefix_getgrent(void)
{ {
if (!group_db_file) { if (!group_db_file) {
return getgrent(); return getgrent();
} }
return fgetgrent(fp_grent); return fgetgrent(fp_grent);
} }
extern void prefix_endgrent() extern void prefix_endgrent(void)
{ {
if (!group_db_file) { if (!group_db_file) {
endgrent(); endgrent();