[PATCH] Clean up loads of compiler warnings

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[PATCH] Clean up loads of compiler warnings

Post by Guest »


--rJwd6BRFiFCcLxzm
Content-Type: multipart/mixed; boundary="WIyZ46R2i8wDzkSu"
Content-Disposition: inline


--WIyZ46R2i8wDzkSu
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi there,

While looking around the source to get familiar, I rebuilt with -Wall
and noticed lots of compiler warnings. These should all be pretty safe.

Cheers,
--=20
--------------------------------------------------------------------------
| Stephen Gran | does your DRESSING ROOM have enough |
| [email protected] | ASPARAGUS? |
| http://www.lobefin.net/~steve | |
--------------------------------------------------------------------------

--WIyZ46R2i8wDzkSu
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment;
filename="0001-Clean-up-loads-of-compiler-warnings.patch"
Content-Transfer-Encoding: quoted-printable

=46rom d4d6938fb214067de49b72263a4f0b75e8e93586 Mon Sep 17 00:00:00 2001
=46rom: Stephen Gran
Date: Mon, 20 Sep 2010 09:59:52 +0100
Subject: [PATCH] Clean up loads of compiler warnings
Signed-off-by: Stephen Gran

---
base/broker.c | 4 ++--
base/checks.c | 1 -
base/nagiostats.c | 3 +--
base/utils.c | 9 ++-------
cgi/cgiauth.c | 1 -
cgi/cmd.c | 23 +++++++++++++++++++++--
cgi/extcmd_list.c | 1 -
cgi/status.c | 1 -
common/macros.c | 12 ++++++------
common/objects.c | 3 ---
xdata/xsddefault.c | 1 -
11 files changed, 32 insertions(+), 27 deletions(-)

diff --git a/base/broker.c b/base/broker.c
index 8c0bdd2..b90c79b 100644
--- a/base/broker.c
+++ b/base/broker.c
@@ -184,10 +184,10 @@ int broker_event_handler(int type, int flags, int att=
r, int eventhandler_type, v
int return_code=3DOK;
=20
if(!(event_broker_options & BROKER_EVENT_HANDLERS))
- return;
+ return return_code;
=09
if(data=3D=3DNULL)
- return;
+ return return_code;
=20
/* get command name/args */
if(cmd!=3DNULL){
diff --git a/base/checks.c b/base/checks.c
index 26bf5c2..f29d01f 100644
--- a/base/checks.c
+++ b/base/checks.c
@@ -134,7 +134,6 @@ int reap_check_results(void){
check_result *queued_check_result=3DNULL;
service *temp_service=3DNULL;
host *temp_host=3DNULL;
- char *temp_buffer=3DNULL;
time_t current_time=3D0L;
time_t reaper_start_time=3D0L;
int reaped_checks=3D0;
diff --git a/base/nagiostats.c b/base/nagiostats.c
index bf7e608..e144267 100644
--- a/base/nagiostats.c
+++ b/base/nagiostats.c
@@ -206,6 +206,7 @@ int read_config_file(void);
int read_status_file(void);
void strip(char *);
void get_time_breakdown(unsigned long,int *,int *,int *,int *);
+int read_nagiostats_file(void);
=20
=20
int main(int argc, char **argv){
@@ -1380,12 +1381,10 @@ int read_status_file(void){
int read_nagiostats_file(void){
char temp_buffer[MAX_INPUT_BUFFER];
FILE *fp=3DNULL;
- int data_type=3DSTATUS_NO_DATA;
char *var=3DNULL;
char *val=3DNULL;
char *temp_ptr=3DNULL;
time_t current_time;
- unsigned long time_difference=3D0L;
=20
time(&current_time);
=20
diff --git a/base/utils.c b/base/utils.c
index a2fd575..429178e 100644
--- a/base/utils.c
+++ b/base/utils.c
@@ -2369,7 +2369,6 @@ int process_check_result_queue(char *dirname){
/* reads check result(s) from a file */
int process_check_result_file(char *fname){
mmapfile *thefile=3DNULL;
- char *temp_buffer=3DNULL;
char *input=3DNULL;
char *var=3DNULL;
char *val=3DNULL;
@@ -2831,7 +2830,7 @@ int parse_check_output(char *buf, char **short_output=
, char **long_output, char
/* save long output */
if(long_output && (db1.buf && strcmp(db1.buf,""))){
=20
- if(escape_newlines=3D=3DFALSE)
+ if(escape_newlines_please=3D=3DFALSE)
*long_output=3D(char *)strdup(db1.buf);
=20
else{
@@ -3291,11 +3290,7 @@ int compare_hashdata(const char *val1a, const char *=
val1b, const char *val2a, co
=20
/* renames a file - works across filesystems (Mike Wiacek) */
int my_rename(char *source, char *dest){
- char buffer[MAX_INPUT_BUFFER]=3D{0};
int rename_result=3

...[email truncated]...


This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked