Browse Source

Fix GCC's -Wimplicit-function-declaration warnings

Fix the issues found by GCC when the -Wimplicit-function-declaration
flag is specified.
Holger Weiss 12 years ago
parent
commit
b48cb1f130
5 changed files with 17 additions and 13 deletions
  1. 3 0
      lib/utils_base.c
  2. 8 2
      plugins/check_ide_smart.c
  3. 2 0
      plugins/check_tcp.c
  4. 3 0
      plugins/negate.c
  5. 1 11
      plugins/runcmd.h

+ 3 - 0
lib/utils_base.c

@@ -27,6 +27,7 @@
 #include "common.h"
 #include <stdarg.h>
 #include "utils_base.h"
+#include <ctype.h>
 #include <fcntl.h>
 #include <sys/stat.h>
 
@@ -34,6 +35,8 @@
 
 nagios_plugin *this_nagios_plugin=NULL;
 
+int _np_state_read_file(FILE *);
+
 void np_init( char *plugin_name, int argc, char **argv ) {
 	if (this_nagios_plugin==NULL) {
 		this_nagios_plugin = calloc(1, sizeof(nagios_plugin));

+ 8 - 2
plugins/check_ide_smart.c

@@ -164,8 +164,14 @@ enum SmartCommand
 		SMART_CMD_AUTO_OFFLINE 
 	};
 
-void print_values (values_t * p, thresholds_t * t);
-int smart_cmd_simple (int fd, enum SmartCommand command, __u8 val0, char show_error); 
+char *get_offline_text (int);
+int smart_read_values (int, values_t *);
+int values_not_passed (values_t *, thresholds_t *);
+int nagios (values_t *, thresholds_t *);
+void print_value (value_t *, threshold_t *);
+void print_values (values_t *, thresholds_t *);
+int smart_cmd_simple (int, enum SmartCommand, __u8, char);
+int smart_read_thresholds (int, thresholds_t *);
 
 int
 main (int argc, char *argv[]) 

+ 2 - 0
plugins/check_tcp.c

@@ -32,6 +32,8 @@ char *progname;
 const char *copyright = "1999-2008";
 const char *email = "nagiosplug-devel@lists.sourceforge.net";
 
+#include <ctype.h>
+
 #include "common.h"
 #include "netutils.h"
 #include "utils.h"

+ 3 - 0
plugins/negate.c

@@ -35,6 +35,8 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net";
 
 #define DEFAULT_TIMEOUT 11
 
+#include <ctype.h>
+
 #include "common.h"
 #include "utils.h"
 #include "utils_cmd.h"
@@ -43,6 +45,7 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net";
 
 static const char **process_arguments (int, char **);
 int validate_arguments (char **);
+int translate_state (char *);
 void print_help (void);
 void print_usage (void);
 int subst_text = FALSE;

+ 1 - 11
plugins/runcmd.h

@@ -25,17 +25,7 @@
 #define NAGIOSPLUG_RUNCMD_H
 
 #include "common.h"
-
-/** types **/
-struct output {
-	char *buf;     /* output buffer */
-	size_t buflen; /* output buffer content length */
-	char **line;   /* array of lines (points to buf) */
-	size_t *lens;  /* string lengths */
-	size_t lines;  /* lines of output */
-};
-
-typedef struct output output;
+#include "utils_cmd.h" /* for the "output" type */
 
 /** prototypes **/
 int np_runcmd(const char *, output *, output *, int);