From 40a5de43d34b3d692c5dec999fc23ce893573d00 Mon Sep 17 00:00:00 2001 From: oetiker Date: Tue, 14 Aug 2012 09:23:11 +0000 Subject: [PATCH] remove a bunch of variables which were set but never used as pointed out by gcc git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@2303 a5681a0c-68f1-0310-ab6d-d61299d08faa --- src/rrd_cgi.c | 5 +---- src/rrd_graph.c | 2 -- src/rrd_open.c | 4 +++- src/rrd_parsetime.c | 2 -- src/rrd_resize.c | 4 ++-- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/rrd_cgi.c b/src/rrd_cgi.c index a0c9b3b..b403ca6 100644 --- a/src/rrd_cgi.c +++ b/src/rrd_cgi.c @@ -454,9 +454,7 @@ int main( int argc, char *argv[]) { - long length; char *buffer; - char *server_url = NULL; long i; long filter = 0; struct option long_options[] = { @@ -498,7 +496,6 @@ int main( if (!filter) { rrdcgiDebug(0, 0); rrdcgiArg = rrdcgiInit(); - server_url = getenv("SERVER_URL"); } /* make sure we have one extra argument, @@ -512,7 +509,7 @@ int main( fprintf(stderr, "ERROR: expected a filename\n"); exit(1); } else { - length = readfile(argv[optind], &buffer, 1); + readfile(argv[optind], &buffer, 1); } if (rrd_test_error()) { diff --git a/src/rrd_graph.c b/src/rrd_graph.c index 317becc..94616cb 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -1740,7 +1740,6 @@ int leg_place( int leg_c = 0; double leg_x = border; int leg_y = 0; //im->yimg; - int leg_y_prev = 0; // im->yimg; int leg_cc; double glue = 0; int i, ii, mark = 0; @@ -1916,7 +1915,6 @@ int leg_place( +(double)legspace[ii] + glue; } - leg_y_prev = leg_y; if (leg_x > border || prt_fctn == 's') leg_y += im->text_prop[TEXT_PROP_LEGEND].size * 1.8; if (prt_fctn == 's') diff --git a/src/rrd_open.c b/src/rrd_open.c index 9c839a1..46a5fcf 100644 --- a/src/rrd_open.c +++ b/src/rrd_open.c @@ -622,9 +622,11 @@ off_t rrd_seek( int whence) { off_t ret = 0; +#ifndef HAVE_MMAP rrd_simple_file_t *rrd_simple_file; rrd_simple_file = (rrd_simple_file_t *)rrd_file->pvt; - +#endif + #ifdef HAVE_MMAP if (whence == SEEK_SET) rrd_file->pos = off; diff --git a/src/rrd_parsetime.c b/src/rrd_parsetime.c index d854dfb..d8b96f3 100644 --- a/src/rrd_parsetime.c +++ b/src/rrd_parsetime.c @@ -687,7 +687,6 @@ static char *day( { /* using time_t seems to help portability with 64bit oses */ time_t mday = 0, wday, mon, year = ptv->tm.tm_year; - int tlen; switch (sc_tokid) { case YESTERDAY: @@ -756,7 +755,6 @@ static char *day( case NUMBER: /* get numeric , MM/DD/[YY]YY, or DD.MM.[YY]YY */ - tlen = strlen(sc_token); mon = atol(sc_token); if (mon > 10 * 365 * 24 * 60 * 60) { ptv->tm = *localtime(&mon); diff --git a/src/rrd_resize.c b/src/rrd_resize.c index 3613d3f..d429f17 100644 --- a/src/rrd_resize.c +++ b/src/rrd_resize.c @@ -21,7 +21,7 @@ int rrd_resize( unsigned long l, rra; long modify; unsigned long target_rra; - int grow = 0, shrink = 0; + int shrink = 0; char *endptr; rrd_file_t *rrd_file, *rrd_out_file; @@ -38,7 +38,7 @@ int rrd_resize( target_rra = strtol(argv[2], &endptr, 0); if (!strcmp(argv[3], "GROW")) - grow = 1; + shrink = 0; else if (!strcmp(argv[3], "SHRINK")) shrink = 1; else { -- 2.30.2