From 82336d4b8f2f2227e733cf3078378ed87fd6e79c Mon Sep 17 00:00:00 2001 From: oetiker Date: Mon, 14 Jan 2008 16:50:51 +0000 Subject: [PATCH] * fixed madvise/fadvise detection * fixed many compiler warnings -- Peter Breitenlohner peb mppmu.mpg.de git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1269 a5681a0c-68f1-0310-ab6d-d61299d08faa --- bindings/tcl/tclrrd.c | 12 ++++-------- configure.ac | 2 ++ src/parsetime.c | 2 +- src/rrd_cgi.c | 2 +- src/rrd_create.c | 2 +- src/rrd_nan_inf.c | 1 + 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/bindings/tcl/tclrrd.c b/bindings/tcl/tclrrd.c index c5a899a..c99c1b0 100644 --- a/bindings/tcl/tclrrd.c +++ b/bindings/tcl/tclrrd.c @@ -69,10 +69,8 @@ static void getopt_cleanup( } static void getopt_free_element( - argv2, - argn) - char *argv2[]; - int argn; + char *argv2[], + int argn) { if (argv2[argn] != NULL) { free(argv2[argn]); @@ -81,10 +79,8 @@ static void getopt_free_element( } static void getopt_squieeze( - argc, - argv2) - int *argc; - char *argv2[]; + int *argc, + char *argv2[]) { int i, null_i = 0, argc_tmp = *argc; diff --git a/configure.ac b/configure.ac index 101520f..7cadc3b 100644 --- a/configure.ac +++ b/configure.ac @@ -61,6 +61,8 @@ AH_TOP([ AH_BOTTOM([ /* make sure that we pickup the correct stuff from all headers */ #ifdef HAVE_FEATURES_H +#undef _XOPEN_SOURCE /* keep unmodified */ +#undef _BSD_SOURCE /* keep unmodified */ #define _XOPEN_SOURCE 600 #define _BSD_SOURCE 1 # include diff --git a/src/parsetime.c b/src/parsetime.c index a2b76ed..4c0f089 100644 --- a/src/parsetime.c +++ b/src/parsetime.c @@ -232,7 +232,7 @@ static const struct SpecialToken TimeMultipliers[] = { * required for us to be able distinguish between 'mon' as 'month' * and 'mon' as 'monday' */ -static struct SpecialToken *Specials; +static const struct SpecialToken *Specials; static const char **scp; /* scanner - pointer at arglist */ static char scc; /* scanner - count of remaining arguments */ diff --git a/src/rrd_cgi.c b/src/rrd_cgi.c index fba2204..844f9ac 100644 --- a/src/rrd_cgi.c +++ b/src/rrd_cgi.c @@ -1430,7 +1430,7 @@ s_var **rrdcgiReadVariables( /* try to find out if there's already such a variable */ for (k = 0; k < i && (strncmp(result[k]->name, cp, esp - cp) - || !(strlen(result[k]->name) == esp - cp)); + || !(strlen(result[k]->name) == (size_t)(esp - cp))); k++); if (k == i) { /* No such variable yet */ diff --git a/src/rrd_create.c b/src/rrd_create.c index f636961..f948f3a 100644 --- a/src/rrd_create.c +++ b/src/rrd_create.c @@ -663,7 +663,7 @@ int rrd_create_fn( rrd_t rrd_dn; if ((rrd_file = - open(file_name, O_WRONLY | O_CREAT | O_TRUNC, 0666)) == NULL) { + open(file_name, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) { rrd_set_error("creating '%s': %s", file_name, rrd_strerror(errno)); rrd_free(rrd); return (-1); diff --git a/src/rrd_nan_inf.c b/src/rrd_nan_inf.c index b13264e..1787948 100644 --- a/src/rrd_nan_inf.c +++ b/src/rrd_nan_inf.c @@ -12,6 +12,7 @@ double dinf; #define INF_FUNC (double)fabs((double)log(0.0)) #else +#include "rrd.h" #define NAN_FUNC (double)(0.0/0.0) #define INF_FUNC (double)(1.0/0.0) -- 2.11.0