From: Florian Forster Date: Tue, 15 Jun 2010 11:24:00 +0000 (+0200) Subject: Fix compiler warnings. X-Git-Tag: v4.0.0~257 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=0a4d88e7530531c01324af54e881ca770edd10d2;p=collection4.git Fix compiler warnings. --- diff --git a/action_list_graphs.c b/action_list_graphs.c index fc4ec14..4ec9a30 100644 --- a/action_list_graphs.c +++ b/action_list_graphs.c @@ -4,6 +4,7 @@ #include #include "action_list_graphs.h" +#include "graph.h" #include "graph_list.h" #include "utils_params.h" @@ -81,7 +82,7 @@ static int print_graph_html (graph_config_t *cfg, /* {{{ */ char buffer[1024]; memset (buffer, 0, sizeof (buffer)); - gl_graph_get_title (cfg, buffer, sizeof (buffer)); + graph_get_title (cfg, buffer, sizeof (buffer)); printf ("
  • %s\n
      \n", buffer); gl_graph_instance_get_all (cfg, print_graph_inst_html, /* user_data = */ NULL); diff --git a/filesystem.c b/filesystem.c index ba57249..a5eeb81 100644 --- a/filesystem.c +++ b/filesystem.c @@ -8,8 +8,6 @@ #include #include -#define DATA_DIR "/var/lib/collectd/rrd" - #include "filesystem.h" struct fs_scan_dir_data_s /* {{{ */ @@ -92,7 +90,7 @@ static int foreach_dir (const char *dir, /* {{{ */ { DIR *dh; struct dirent *entry; - int status; + int status = 0; if (callback == NULL) return (EINVAL); diff --git a/filesystem.h b/filesystem.h index 49798a0..9569bc3 100644 --- a/filesystem.h +++ b/filesystem.h @@ -3,6 +3,8 @@ #include "graph_ident.h" +#define DATA_DIR "/var/lib/collectd/rrd" + typedef int (*fs_ident_cb_t) (const graph_ident_t *ident, void *user_data); int fs_scan (fs_ident_cb_t callback, void *user_data); diff --git a/graph.c b/graph.c index c092482..79964f3 100644 --- a/graph.c +++ b/graph.c @@ -183,7 +183,7 @@ int graph_add_file (graph_config_t *cfg, const graph_ident_t *file) /* {{{ */ return (inst_add_file (inst, file)); } /* }}} int graph_add_file */ -int gl_graph_get_title (graph_config_t *cfg, /* {{{ */ +int graph_get_title (graph_config_t *cfg, /* {{{ */ char *buffer, size_t buffer_size) { if ((cfg == NULL) || (buffer == NULL) || (buffer_size < 1)) @@ -199,7 +199,7 @@ int gl_graph_get_title (graph_config_t *cfg, /* {{{ */ buffer[buffer_size - 1] = 0; return (0); -} /* }}} int gl_graph_get_title */ +} /* }}} int graph_get_title */ graph_ident_t *graph_get_selector (graph_config_t *cfg) /* {{{ */ { diff --git a/graph_config.c b/graph_config.c index 1b612c6..94dd440 100644 --- a/graph_config.c +++ b/graph_config.c @@ -47,7 +47,7 @@ static int internal_read_config (void) /* {{{ */ oconfig_free (ci); - graph_config_submit (); + gl_config_submit (); return (0); } /* }}} int internal_read_config */ diff --git a/graph_ident.c b/graph_ident.c index fb6e206..454cc1a 100644 --- a/graph_ident.c +++ b/graph_ident.c @@ -6,6 +6,7 @@ #include "graph_ident.h" #include "common.h" +#include "filesystem.h" #define IS_ANY(str) (((str) != NULL) && (strcasecmp (ANY_TOKEN, (str)) == 0)) #define IS_ALL(str) (((str) != NULL) && (strcasecmp (ALL_TOKEN, (str)) == 0)) diff --git a/graph_instance.c b/graph_instance.c index 25a24a4..11629a5 100644 --- a/graph_instance.c +++ b/graph_instance.c @@ -4,6 +4,7 @@ #include "graph_instance.h" #include "graph_ident.h" +#include "graph_list.h" #include "common.h" #include "utils_params.h" diff --git a/graph_list.c b/graph_list.c index f59508d..965fcba 100644 --- a/graph_list.c +++ b/graph_list.c @@ -128,7 +128,7 @@ int gl_add_graph (graph_config_t *cfg) /* {{{ */ return (gl_add_graph_internal (cfg, &gl_staging, &gl_staging_num)); } /* }}} int gl_add_graph */ -int graph_config_submit (void) /* {{{ */ +int gl_config_submit (void) /* {{{ */ { graph_config_t **old; size_t old_num; diff --git a/graph_list.h b/graph_list.h index 8f21e86..c17d6fc 100644 --- a/graph_list.h +++ b/graph_list.h @@ -17,6 +17,8 @@ typedef int (*gl_inst_callback) (graph_config_t *cfg, */ int gl_add_graph (graph_config_t *cfg); +int gl_config_submit (void); + int gl_graph_get_all (gl_cfg_callback callback, void *user_data);