[icinga-checkins] icinga.org: icinga-core/mfriedrich/core: Janitor patch: Remove unused variables (Andreas Ericsson)

git at icinga.org git at icinga.org
Wed May 12 18:57:43 CEST 2010


Module: icinga-core
Branch: mfriedrich/core
Commit: a596b294c06a6c8e0797ba91c16cac4ed5909d62
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=a596b294c06a6c8e0797ba91c16cac4ed5909d62

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Wed May 12 18:41:17 2010 +0200

Janitor patch: Remove unused variables (Andreas Ericsson)

detected by gcc -Wall

fixes #395

---

 Changelog          |    1 +
 base/checks.c      |    1 -
 base/utils.c       |    5 -----
 cgi/cgiauth.c      |    1 -
 cgi/cmd.c          |    1 -
 common/objects.c   |    3 ---
 xdata/xsddefault.c |    1 -
 7 files changed, 1 insertions(+), 12 deletions(-)

diff --git a/Changelog b/Changelog
index 2d5d84b..f48cf02 100644
--- a/Changelog
+++ b/Changelog
@@ -26,6 +26,7 @@ FIXES
 * core: icinga.c: replace asprintf() + write_to_logs_and_console() with logit() (Andreas Ericsson)
 * core: revamp logging somewhat (Andreas Ericsson)
 * core: create logging.h, with stubs for the common function in cgiutils.c (Andreas Ericsson)
+* core: Janitor patch: Remove unused variables (Andreas Ericsson)
 
 * idoutils: Host DB inserts use string 'NULL\n' instead of NULL (William Preston)
 * idoutils: ndo2db_get_object_id fails to return existing IDs (William Preston)
diff --git a/base/checks.c b/base/checks.c
index 4508fce..c5b3cf1 100644
--- a/base/checks.c
+++ b/base/checks.c
@@ -134,7 +134,6 @@ int reap_check_results(void){
 	check_result *queued_check_result=NULL;
 	service *temp_service=NULL;
 	host *temp_host=NULL;
-	char *temp_buffer=NULL;
 	time_t current_time=0L;
 	time_t reaper_start_time=0L;
 	int reaped_checks=0;
diff --git a/base/utils.c b/base/utils.c
index ab7de42..8b1e022 100644
--- a/base/utils.c
+++ b/base/utils.c
@@ -2254,7 +2254,6 @@ int process_check_result_queue(char *dirname){
 /* reads check result(s) from a file */
 int process_check_result_file(char *fname){
 	mmapfile *thefile=NULL;
-	char *temp_buffer=NULL;
 	char *input=NULL;
 	char *var=NULL;
 	char *val=NULL;
@@ -2960,11 +2959,7 @@ int compare_strings(char *val1a, char *val2a){
 
 /* renames a file - works across filesystems (Mike Wiacek) */
 int my_rename(char *source, char *dest){
-	char buffer[MAX_INPUT_BUFFER]={0};
 	int rename_result=0;
-	int source_fd=-1;
-	int dest_fd=-1;
-	int bytes_read=0;
 
 
 	/* make sure we have something */
diff --git a/cgi/cgiauth.c b/cgi/cgiauth.c
index c637498..654d4a5 100644
--- a/cgi/cgiauth.c
+++ b/cgi/cgiauth.c
@@ -44,7 +44,6 @@ int get_authentication_information(authdata *authinfo){
 	mmapfile *thefile;
 	char *input=NULL;
 	char *temp_ptr;
-	int needed_options;
 
 	if(authinfo==NULL)
 		return ERROR;
diff --git a/cgi/cmd.c b/cgi/cmd.c
index 5c328f0..222b341 100644
--- a/cgi/cmd.c
+++ b/cgi/cmd.c
@@ -1931,7 +1931,6 @@ static int cmd_submitf(int id, const char *fmt, ...){
 
 /* commits a command for processing */
 int commit_command(int cmd){
-	char command_buffer[MAX_INPUT_BUFFER];
 	time_t current_time;
 	time_t scheduled_time;
 	time_t notification_time;
diff --git a/common/objects.c b/common/objects.c
index 7970be3..8fa4d6b 100644
--- a/common/objects.c
+++ b/common/objects.c
@@ -180,7 +180,6 @@ int skiplist_compare_host(void *a, void *b){
 int skiplist_compare_service(void *a, void *b){
 	service *oa=NULL;
 	service *ob=NULL;
-	int result=0;
 
 	oa=(service *)a;
 	ob=(service *)b;
@@ -325,7 +324,6 @@ int skiplist_compare_hostescalation(void *a, void *b){
 int skiplist_compare_serviceescalation(void *a, void *b){
 	serviceescalation *oa=NULL;
 	serviceescalation *ob=NULL;
-	int result=0;
 
 	oa=(serviceescalation *)a;
 	ob=(serviceescalation *)b;
@@ -362,7 +360,6 @@ int skiplist_compare_hostdependency(void *a, void *b){
 int skiplist_compare_servicedependency(void *a, void *b){
 	servicedependency *oa=NULL;
 	servicedependency *ob=NULL;
-	int result=0;
 
 	oa=(servicedependency *)a;
 	ob=(servicedependency *)b;
diff --git a/xdata/xsddefault.c b/xdata/xsddefault.c
index 98c74df..034c3e2 100644
--- a/xdata/xsddefault.c
+++ b/xdata/xsddefault.c
@@ -338,7 +338,6 @@ int xsddefault_save_status_data(void){
 	FILE *fp=NULL;
 	int used_external_command_buffer_slots=0;
 	int high_external_command_buffer_slots=0;
-	void *ptr=NULL;
 	int result=OK;
 
 	log_debug_info(DEBUGL_FUNCTIONS,0,"save_status_data()\n");





More information about the icinga-checkins mailing list