Fix gcc -Wstrict-prototypes warnings

In C, defining a function with () means "any number of parameters", not
"no parameter".  Use (void) instead where applicable and add unused
parameters when needed.

Acked-by: Steve Lawrence <slawrence@tresys.com>
This commit is contained in:
Nicolas Iooss 2014-09-14 23:41:49 +02:00 committed by Steve Lawrence
parent 188a028f74
commit c4a4a1a7ed
15 changed files with 18 additions and 18 deletions

View File

@ -289,7 +289,7 @@ static int identify_equiv_types(void)
extern char *av_to_string(uint32_t tclass, sepol_access_vector_t av);
int display_bools()
int display_bools(void)
{
uint32_t i;
@ -335,7 +335,7 @@ void display_expr(cond_expr_t * exp)
}
}
int display_cond_expressions()
int display_cond_expressions(void)
{
cond_node_t *cur;

View File

@ -61,7 +61,7 @@ extern int yylex(void);
extern int yywarn(const char *msg);
extern int yyerror(const char *msg);
typedef int (* require_func_t)();
typedef int (* require_func_t)(int pass);
%}

View File

@ -25,7 +25,7 @@
#include <stdint.h>
#include <string.h>
typedef int (* require_func_t)();
typedef int (* require_func_t)(void);
#ifdef ANDROID
#include "policy_parse.h"

View File

@ -807,7 +807,7 @@ static void display_policycaps(policydb_t * p, FILE * fp)
}
}
int menu()
int menu(void)
{
printf("\nSelect a command:\n");
printf("1) display unconditional AVTAB\n");

View File

@ -369,7 +369,7 @@ static void display_filename_trans(policydb_t *p, FILE *fp)
}
}
int menu()
int menu(void)
{
printf("\nSelect a command:\n");
printf("1) display unconditional AVTAB\n");

View File

@ -31,7 +31,7 @@
#include <stdlib.h>
#include <string.h>
extern int semanage_lex(); /* defined in conf-scan.c */
extern int semanage_lex(void); /* defined in conf-scan.c */
int semanage_error(const char *msg);
extern FILE *semanage_in;

View File

@ -307,7 +307,7 @@ static int process_pam_config(FILE * cfg)
* Files specified one per line executable with a corresponding
* pam service name.
*/
static int read_pam_config()
static int read_pam_config(void)
{
const char *config_file_path = PAM_SERVICE_CONFIG;
FILE *cfg = NULL;
@ -966,7 +966,7 @@ static int parse_command_line_arguments(int argc, char **argv, char *ttyn,
/**
* Take care of any signal setup
*/
static int set_signal_handles()
static int set_signal_handles(void)
{
sigset_t empty;

View File

@ -111,7 +111,7 @@ static int write_pid_file(void)
/*
* SIGTERM handler
*/
static void term_handler()
static void term_handler(int s __attribute__ ((unused)))
{
terminate = 1;
/* trigger a failure in the watch */

View File

@ -40,6 +40,6 @@ extern int watch(int fd, const char *watch_file);
extern void watch_list_add(int inotify_fd, const char *path);
extern int watch_list_find(int wd, const char *file);
extern void watch_list_free(int fd);
extern int watch_list_isempty();
extern int watch_list_isempty(void);
#endif

View File

@ -194,7 +194,7 @@ int start() {
return 0;
}
static int local_server() {
static int local_server(void) {
// ! dbus, run as local service
char *ptr=NULL;
if (asprintf(&ptr, "%s/.restorecond", homedir) < 0) {

View File

@ -34,7 +34,7 @@ struct watchList {
};
struct watchList *firstDir = NULL;
int watch_list_isempty() {
int watch_list_isempty(void) {
return firstDir == NULL;
}

View File

@ -230,7 +230,7 @@ int authenticate_via_shadow_passwd(const struct passwd *p_passwd_line)
* return: 0 When success
* -1 When failure
*/
int authenticate_user()
int authenticate_user(void)
{
#define INITLEN 255

View File

@ -62,7 +62,7 @@ static capng_select_t cap_set = CAPNG_SELECT_CAPS;
/**
* This function will drop all capabilities.
*/
static int drop_caps()
static int drop_caps(void)
{
if (capng_have_capabilities(cap_set) == CAPNG_NONE)
return 0;

View File

@ -45,12 +45,12 @@ struct restore_opts {
};
void restore_init(struct restore_opts *opts);
void restore_finish();
void restore_finish(void);
int add_exclude(const char *directory);
int exclude(const char *path);
void remove_exclude(const char *directory);
int process_one_realpath(char *name, int recurse);
int process_glob(char *name, int recurse);
int exclude_non_seclabel_mounts();
int exclude_non_seclabel_mounts(void);
#endif

View File

@ -61,7 +61,7 @@ void usage(const char *const name)
static int nerr = 0;
void inc_err()
void inc_err(void)
{
nerr++;
if (nerr > ABORT_ON_ERRORS - 1 && !r_opts.debug) {