X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Ftokyotyrant.c;h=154215f867bcc16ed0c6e4cec866883628c3af6c;hb=6d8031d73b7c1d874d7afa4cad2f248c4073764d;hp=f04a5fceb3a51b9ae3b9738d505f5ee977b896f3;hpb=b286b677bb54a3192a4121c2aa0857a133fd0603;p=collectd.git diff --git a/src/tokyotyrant.c b/src/tokyotyrant.c index f04a5fce..154215f8 100644 --- a/src/tokyotyrant.c +++ b/src/tokyotyrant.c @@ -20,6 +20,7 @@ **/ #include "collectd.h" + #include "plugin.h" #include "common.h" #include "utils_cache.h" @@ -85,15 +86,12 @@ static void printerr (void) ecode, tcrdberrmsg(ecode)); } -static void tt_submit (gauge_t val, const char* type) +static void tt_submit (gauge_t value, const char* type) { - value_t values[1]; value_list_t vl = VALUE_LIST_INIT; - values[0].gauge = val; - - vl.values = values; - vl.values_len = STATIC_ARRAY_SIZE (values); + vl.values = &(value_t) { .gauge = value }; + vl.values_len = 1; sstrncpy (vl.host, config_host, sizeof (vl.host)); sstrncpy (vl.plugin, "tokyotyrant", sizeof (vl.plugin)); @@ -106,8 +104,8 @@ static void tt_submit (gauge_t val, const char* type) static void tt_open_db (void) { - char* host = NULL; - int port = DEFAULT_PORT; + const char *host; + int port = DEFAULT_PORT; if (rdb != NULL) return;