From c4b06cfbbca759a6ea8eed045ed9d84ca97cd24f Mon Sep 17 00:00:00 2001 From: oetiker Date: Mon, 14 Jan 2008 16:47:23 +0000 Subject: [PATCH] * fix fadvice and madvice inclusion ... again * fix rrdcgi warning * fix warnings in tcl bindings -- Peter Breitenlohner peb mppmu.mpg.de git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@1268 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/bindings/tcl/tclrrd.c | 24 ++++++++++++++++++++++-- program/configure.ac | 5 +++-- program/src/rrd_cgi.c | 2 +- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/program/bindings/tcl/tclrrd.c b/program/bindings/tcl/tclrrd.c index 11d25dfa..841978c7 100644 --- a/program/bindings/tcl/tclrrd.c +++ b/program/bindings/tcl/tclrrd.c @@ -100,6 +100,8 @@ Rrd_Create(ClientData clientData, Tcl_Interp *interp, int argc, CONST84 char *ar unsigned long int pdp_step = 300; struct rrd_time_value last_up_tv; + (void) clientData; /* slience gcc */ + argv2 = getopt_init(argc, argv); for (argv_i = 1; argv_i < argc; argv_i++) { @@ -169,7 +171,7 @@ Rrd_Create(ClientData clientData, Tcl_Interp *interp, int argc, CONST84 char *ar return TCL_ERROR; } - rrd_create_r(argv2[1], pdp_step, last_up, argc - 2, argv2 + 2); + rrd_create_r(argv2[1], pdp_step, last_up, argc - 2, (const char **) argv2 + 2); getopt_cleanup(argc, argv2); @@ -189,6 +191,8 @@ Rrd_Create(ClientData clientData, Tcl_Interp *interp, int argc, CONST84 char *ar static int Rrd_Dump(ClientData clientData, Tcl_Interp *interp, int argc, CONST84 char *argv[]) { + (void) clientData; /* slience gcc */ + if (argc < 2) { Tcl_AppendResult(interp, "RRD Error: needs rrd filename", (char *) NULL); @@ -215,6 +219,8 @@ Rrd_Dump(ClientData clientData, Tcl_Interp *interp, int argc, CONST84 char *argv static int Rrd_Last(ClientData clientData, Tcl_Interp *interp, int argc, CONST84 char *argv[]) { + (void) clientData; /* slience gcc */ + time_t t; if (argc < 2) { @@ -246,6 +252,8 @@ Rrd_Update(ClientData clientData, Tcl_Interp *interp, int argc, CONST84 char *ar int argv_i; char **argv2, *template = NULL; + (void) clientData; /* slience gcc */ + argv2 = getopt_init(argc, argv); for (argv_i = 1; argv_i < argc; argv_i++) { @@ -291,7 +299,7 @@ Rrd_Update(ClientData clientData, Tcl_Interp *interp, int argc, CONST84 char *ar return TCL_ERROR; } - rrd_update_r(argv2[1], template, argc - 2, argv2 + 2); + rrd_update_r(argv2[1], template, argc - 2, (const char **) argv2 + 2); if (template != NULL) { free(template); @@ -319,6 +327,8 @@ Rrd_Lastupdate(ClientData clientData, Tcl_Interp *interp, int argc, CONST84 char Tcl_Obj *listPtr; unsigned long ds_cnt, i; + (void) clientData; /* slience gcc */ + argv2 = getopt_init(argc, argv); if (rrd_lastupdate(argc-1, argv2, &last_update, &ds_cnt, &ds_namv, &last_ds) == 0) { @@ -358,6 +368,8 @@ Rrd_Fetch(ClientData clientData, Tcl_Interp *interp, int argc, CONST84 char *arg char s[30]; char **argv2; + (void) clientData; /* slience gcc */ + argv2 = getopt_init(argc, argv); if (rrd_fetch(argc, argv2, &start, &end, &step, &ds_cnt, &ds_namv, &data) != -1) { @@ -402,6 +414,8 @@ Rrd_Graph(ClientData clientData, Tcl_Interp *interp, int argc, CONST84 char *arg char **argv2; CONST84 char *save; + (void) clientData; /* slience gcc */ + /* * If the "filename" is a Tcl fileID, then arrange for rrd_graph() to write to * that file descriptor. Will this work with windoze? I have no idea. @@ -496,6 +510,8 @@ Rrd_Tune(ClientData clientData, Tcl_Interp *interp, int argc, CONST84 char *argv { char **argv2; + (void) clientData; /* slience gcc */ + argv2 = getopt_init(argc, argv); rrd_tune(argc, argv2); getopt_cleanup(argc, argv2); @@ -517,6 +533,8 @@ Rrd_Resize(ClientData clientData, Tcl_Interp *interp, int argc, CONST84 char *ar { char **argv2; + (void) clientData; /* slience gcc */ + argv2 = getopt_init(argc, argv); rrd_resize(argc, argv2); getopt_cleanup(argc, argv2); @@ -538,6 +556,8 @@ Rrd_Restore(ClientData clientData, Tcl_Interp *interp, int argc, CONST84 char *a { char **argv2; + (void) clientData; /* slience gcc */ + argv2 = getopt_init(argc, argv); rrd_restore(argc, argv2); getopt_cleanup(argc, argv2); diff --git a/program/configure.ac b/program/configure.ac index aa8c5203..56124181 100644 --- a/program/configure.ac +++ b/program/configure.ac @@ -60,7 +60,8 @@ AH_TOP([ AH_BOTTOM([ #ifdef HAVE_FEATURES_H -#define _XOPEN_SOURCE 600 +#define _XOPEN_SOURCE 600 +#undef _BSD_SOURCE /* comment to prevent configure from modifying this line */ #define _BSD_SOURCE 1 # include #endif @@ -315,7 +316,7 @@ CONFIGURE_PART(Checking for Header Files) dnl Checks for header files. AC_HEADER_STDC AC_HEADER_DIRENT -AC_CHECK_HEADERS( sys/stat.h sys/types.h fcntl.h locale.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/times.h sys/param.h sys/resource.h float.h strings.h) +AC_CHECK_HEADERS( features.h sys/stat.h sys/types.h fcntl.h locale.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/times.h sys/param.h sys/resource.h float.h strings.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST diff --git a/program/src/rrd_cgi.c b/program/src/rrd_cgi.c index 8038a308..7e8aa322 100644 --- a/program/src/rrd_cgi.c +++ b/program/src/rrd_cgi.c @@ -1287,7 +1287,7 @@ s_var **rrdcgiReadVariables(void) if (iname,cp, esp-cp) || !(strlen (result[k]->name) == esp-cp)); k++); + for (k=0; kname,cp, esp-cp) || !(strlen (result[k]->name) == (size_t)(esp-cp))); k++); if (k == i) { /* No such variable yet */ if ((result[i] = (s_var *)malloc(sizeof(s_var))) == NULL) -- 2.30.2