This patch looks good to me. acked.
>From 7168be8d0b945bcdd49ba291a923dbeaada0a383 Mon Sep 17 00:00:00 2001 From: root <root@(none).(none)> Date: Fri, 24 Jun 2011 16:43:10 -0400 Subject: [PATCH 13/93] libsemanage: drop the -no-unused-parameter build flag Annote the couple of places they are needed and drop the flag Signed-off-by: Eric Paris <eparis@xxxxxxxxxx> --- libsemanage/src/Makefile | 2 +- libsemanage/src/database.c | 22 +++++++++++----------- libsemanage/src/direct_api.c | 2 +- libsemanage/src/genhomedircon.c | 5 ++--- libsemanage/src/semanage_store.c | 2 +- libsemanage/src/semanage_store.h | 2 +- 6 files changed, 17 insertions(+), 18 deletions(-) diff --git a/libsemanage/src/Makefile b/libsemanage/src/Makefile index f3e5973..869c05c 100644 --- a/libsemanage/src/Makefile +++ b/libsemanage/src/Makefile @@ -46,7 +46,7 @@ SRCS= $(filter-out $(SWIGGEN),$(wildcard *.c)) OBJS= $(patsubst %.c,%.o,$(SRCS)) conf-scan.o conf-parse.o LOBJS= $(patsubst %.c,%.lo,$(SRCS)) conf-scan.lo conf-parse.lo -CFLAGS ?= -Werror -Wall -W -Wundef -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wno-unused-parameter +CFLAGS ?= -Werror -Wall -W -Wundef -Wshadow -Wmissing-noreturn -Wmissing-format-attribute override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE diff --git a/libsemanage/src/database.c b/libsemanage/src/database.c index faa3840..fc4f717 100644 --- a/libsemanage/src/database.c +++ b/libsemanage/src/database.c @@ -46,7 +46,7 @@ static int enter_ro(semanage_handle_t * handle, dbase_config_t * dconfig) return STATUS_ERR; } -static inline int exit_ro(semanage_handle_t * handle, dbase_config_t * dconfig) +static inline int exit_ro(semanage_handle_t * handle) { int commit_num = handle->funcs->get_serial(handle); @@ -129,11 +129,11 @@ int dbase_query(semanage_handle_t * handle, return STATUS_ERR; if (dconfig->dtable->query(handle, dconfig->dbase, key, response) < 0) { - exit_ro(handle, dconfig); + exit_ro(handle); return STATUS_ERR; } - return exit_ro(handle, dconfig); + return exit_ro(handle); } int dbase_exists(semanage_handle_t * handle, @@ -145,11 +145,11 @@ int dbase_exists(semanage_handle_t * handle, return STATUS_ERR; if (dconfig->dtable->exists(handle, dconfig->dbase, key, response) < 0) { - exit_ro(handle, dconfig); + exit_ro(handle); return STATUS_ERR; } - return exit_ro(handle, dconfig); + return exit_ro(handle); } int dbase_count(semanage_handle_t * handle, @@ -160,11 +160,11 @@ int dbase_count(semanage_handle_t * handle, return STATUS_ERR; if (dconfig->dtable->count(handle, dconfig->dbase, response) < 0) { - exit_ro(handle, dconfig); + exit_ro(handle); return STATUS_ERR; } - return exit_ro(handle, dconfig); + return exit_ro(handle); } int dbase_iterate(semanage_handle_t * handle, @@ -177,11 +177,11 @@ int dbase_iterate(semanage_handle_t * handle, return STATUS_ERR; if (dconfig->dtable->iterate(handle, dconfig->dbase, fn, fn_arg) < 0) { - exit_ro(handle, dconfig); + exit_ro(handle); return STATUS_ERR; } - return exit_ro(handle, dconfig); + return exit_ro(handle); } int dbase_list(semanage_handle_t * handle, @@ -193,9 +193,9 @@ int dbase_list(semanage_handle_t * handle, return STATUS_ERR; if (dconfig->dtable->list(handle, dconfig->dbase, records, count) < 0) { - exit_ro(handle, dconfig); + exit_ro(handle); return STATUS_ERR; } - return exit_ro(handle, dconfig); + return exit_ro(handle); } diff --git a/libsemanage/src/direct_api.c b/libsemanage/src/direct_api.c index bceb6a7..5f82328 100644 --- a/libsemanage/src/direct_api.c +++ b/libsemanage/src/direct_api.c @@ -1545,7 +1545,7 @@ int semanage_direct_access_check(semanage_handle_t * sh) if (semanage_check_init(polpath)) return -1; - return semanage_store_access_check(sh); + return semanage_store_access_check(); } int semanage_direct_mls_enabled(semanage_handle_t * sh) diff --git a/libsemanage/src/genhomedircon.c b/libsemanage/src/genhomedircon.c index 4e0a10a..847d87e 100644 --- a/libsemanage/src/genhomedircon.c +++ b/libsemanage/src/genhomedircon.c @@ -367,11 +367,10 @@ static semanage_list_t *get_home_dirs(genhomedircon_settings_t * s) } /** - * @param s settings structure, stores various paths etc. Must never be NULL * @param out the FILE to put all the output in. * @return 0 on success */ -static int write_file_context_header(genhomedircon_settings_t * s, FILE * out) +static int write_file_context_header(FILE * out) { if (fprintf(out, COMMENT_FILE_CONTEXT_HEADER) < 0) { return STATUS_ERR; @@ -907,7 +906,7 @@ static int write_context_file(genhomedircon_settings_t * s, FILE * out) if (!homedir_context_tpl && !homeroot_context_tpl && !user_context_tpl) goto done; - if (write_file_context_header(s, out) != STATUS_SUCCESS) { + if (write_file_context_header(out) != STATUS_SUCCESS) { retval = STATUS_ERR; goto done; } diff --git a/libsemanage/src/semanage_store.c b/libsemanage/src/semanage_store.c index 339bbd0..3321609 100644 --- a/libsemanage/src/semanage_store.c +++ b/libsemanage/src/semanage_store.c @@ -380,7 +380,7 @@ int semanage_create_store(semanage_handle_t * sh, int create) * SEMANAGE_CAN_READ if the store can be read and the lock file used * SEMANAGE_CAN_WRITE if the modules directory and binary policy dir can be written to */ -int semanage_store_access_check(semanage_handle_t * sh) +int semanage_store_access_check(void) { const char *path; int rc = -1; diff --git a/libsemanage/src/semanage_store.h b/libsemanage/src/semanage_store.h index 6abb2ee..a0b2dd8 100644 --- a/libsemanage/src/semanage_store.h +++ b/libsemanage/src/semanage_store.h @@ -75,7 +75,7 @@ extern const char *semanage_path(enum semanage_store_defs store, int semanage_create_store(semanage_handle_t * sh, int create); -int semanage_store_access_check(semanage_handle_t * sh); +int semanage_store_access_check(void); int semanage_remove_directory(const char *path); -- 1.7.6