Hi again, I have a few easy fixes for you. They're all against the current trunk.
- 0001-MakeMakefile-check_for_intltool.patch
I've checked out the repository on another machine and started
searching why I didn't have the `IT_PROG_INTLTOOL' autoconf macro. So
I've added that to the `MakeMakefile' script.
Also I've changed the clean up part a bit. If you don't like it,
please change at least the `rm -r' to a `rm -rf', because otherwise it
complains about non-existing files.
- 0002-rrd_restore.c-fix_header.patch
I assume you used `indent' when applying my patch to rrd_restore.c.
Somehow the comment at the beginning of the file got messed up badly.
So bad, it wouldn't even compile here.. This patch fixes that and
makes the header nice again.
The following patches fix warnings. Warnings annoy me so that I usually
build with `-Werror'. I guess you know what I'm talking about, since
basically all available `-W*' options are used ;) Please consider the
following patches:
- 0003-rrd_graph.c-compare_signed_unsigned.patch
Somewhere in rrd_graph.c an int is compared to a size_t, which may or
may not be signed. This patch casts the size_t to an int to avoid a
warning.
- 0004-rrd_open.c-unused_static_function.patch
There's a static function that's only used when debugging is enabled,
but declared in any case. This patch changes that, so that the
function is only declared if it is used, too.
- 0005-rrd_tool.c-help_strings.patch
(My version of) GCC doesn't like initializations like
char foo[] = N_("bar");
so I've changed that to be
const char *foo = N_("bar");
The variables are later passed to `_' which now gets a pointer to
read-only memory. I'm not entirely sure how the `_' macro works, but
on my machine it worked all out fine.
- 0006-rrd_update.c-unused_arguments.patch
The function `calculate_cdp_val' in rrd_update.c gets passed two
arguments, that are only used if debugging is enabled. This patch
assigns a value to the variables to silence the compiler. This
assignment should be removed by optimizers and thus not pose a
performance issue.
- 0007-rrdgraph_examples.pod-runaway_list.patch
A `=over' in rrdgraph_examples.pod was not matched by a `=back'. This
patch fixes this.
Regards,
-octo
--
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
Index: MakeMakefile
===================================================================
--- MakeMakefile (revision 1310)
+++ MakeMakefile (working copy)
@@ -10,7 +10,7 @@
perl <<PERL
@t = split /\./, "$1";
@v = map { int \$_ } split /\./, (split /\s+/, \`$2\`)[3];
-print "$2 = ", (join ".",@v), " (expected $1)\n";
+print "$2 = ", (join ".",@v), " (expecting $1 or later)\n";
\$v = \$t[0]*1000000+\$t[1]*1000+\$t[2] <= \$v[0]*1000000+\$v[1]*1000+\$v[2];
exit \$v
PERL
@@ -49,18 +49,22 @@
ERROR=1
fi
+if vcheck 0.35.0 "intltoolize --version"
+then
+ echo "get a copy of GNU intltoolize >= 0.35.0"
+ ERROR=1
+fi
+
if [ $ERROR -ne 0 ]
then
exit 1
fi
# cleanup
-set -x
-find . -name Makefile | grep -v win32 | grep -v netware | xargs rm -f _UNKNONW_
-find . -name "*.la" | xargs rm -f _UNKNOWN_
-find . -name Makefile.in | xargs rm -f _UNKNONW_
-find . -name .libs | xargs rm -r
-find . -name .debs | xargs rm -r
+if [ -e Makefile ]
+then
+ make clean >/dev/null
+fi
intltoolize --automake -c -f
$aclocal
@@ -69,3 +73,5 @@
$aclocal
$automake --foreign --add-missing --force-missing --copy
autoconf --force
+
+# vim: set syntax=sh :
Index: src/rrd_restore.c
===================================================================
--- src/rrd_restore.c (revision 1310)
+++ src/rrd_restore.c (working copy)
@@ -3,28 +3,30 @@
* This file: Copyright 2008 Florian octo Forster
* Distributed under the GPL
*****************************************************************************
- * rrd_thread_safe.c Contains routines used when thread safety is required
+ * rrd_restore.c Contains logic to parse XML input and create an RRD file
*****************************************************************************
* $Id$
*************************************************************************** */
-* *This program is free software;
-you can redistribute it and / or modify it
- *
- under the terms of the GNU General Public License as published by the Free
- * Software Foundation;
-either version 2 of the License, or(
- at your option)
-* any later version.
- * *This program is distributed in the hope that it will be useful,
-but WITHOUT * ANY WARRANTY;
- without even the implied warranty of MERCHANTABILITY or
- *
- FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for *more details. *
- *You should have received a copy of the GNU General Public License
- along * with this program; if not
- , write to the Free Software Foundation, Inc., *51 Franklin St, Fifth Floor, Boston, MA 02110 - 1301 USA * *Authors:
- *Florian octo Forster < octo at verplant.org > **/
+
+/*
+ * This program is free software; you can redistribute it and / or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (t your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110 - 1301 USA
+ *
+ * Authors:
+ * Florian octo Forster <octo at verplant.org>
+ **/
+
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -46,7 +48,7 @@
/*
* Auxiliary functions
*/
- static int get_string_from_node(
+static int get_string_from_node(
xmlDoc * doc,
xmlNode * node,
char *buffer,
Index: src/rrd_graph.c
===================================================================
--- src/rrd_graph.c (revision 1310)
+++ src/rrd_graph.c (working copy)
@@ -4084,7 +4084,7 @@
if (size > 0) {
im->text_prop[propidx].size = size;
}
- if (strlen(prop) > end) {
+ if ((int) strlen (prop) > end) {
if (prop[end] == ':') {
strncpy(im->text_prop[propidx].font,
prop + end + 1, 255);
Index: src/rrd_open.c
===================================================================
--- src/rrd_open.c (revision 1310)
+++ src/rrd_open.c (working copy)
@@ -268,6 +268,7 @@
}
+#if defined DEBUG && DEBUG > 1
/* Print list of in-core pages of a the current rrd_file. */
static
void mincore_print(
@@ -310,6 +311,7 @@
fprintf(stderr, "sorry mincore only works with mmap");
#endif
}
+#endif /* defined DEBUG && DEBUG > 1 */
/* drop cache except for the header and the active pages */
Index: src/rrd_tool.c
===================================================================
--- src/rrd_tool.c (revision 1310)
+++ src/rrd_tool.c (working copy)
@@ -45,53 +45,53 @@
char *cmd)
{
- char help_main[] =
+ const char *help_main =
N_("RRDtool %s"
" Copyright 1997-2007 by Tobias Oetiker <[EMAIL PROTECTED]>\n"
" Compiled %s %s\n\n"
"Usage: rrdtool [options] command command_options\n\n");
- char help_list[] =
+ const char *help_list =
N_("Valid commands: create, update, updatev, graph, dump, restore,\n"
"\t\tlast, lastupdate, first, info, fetch, tune,\n"
"\t\tresize, xport\n\n");
- char help_listremote[] =
+ const char *help_listremote =
N_("Valid remote commands: quit, ls, cd, mkdir, pwd\n\n");
- char help_create[] =
+ const char *help_create =
N_("* create - create a new RRD\n\n"
"\trrdtool create filename [--start|-b start time]\n"
"\t\t[--step|-s step]\n"
"\t\t[DS:ds-name:DST:dst arguments]\n"
"\t\t[RRA:CF:cf arguments]\n\n");
- char help_dump[] =
+ const char *help_dump =
N_("* dump - dump an RRD to XML\n\n"
"\trrdtool dump filename.rrd >filename.xml\n\n");
- char help_info[] =
+ const char *help_info =
N_("* info - returns the configuration and status of the RRD\n\n"
"\trrdtool info filename.rrd\n\n");
- char help_restore[] =
+ const char *help_restore =
N_("* restore - restore an RRD file from its XML form\n\n"
"\trrdtool restore [--range-check|-r] [--force-overwrite|-f] filename.xml filename.rrd\n\n");
- char help_last[] =
+ const char *help_last =
N_("* last - show last update time for RRD\n\n"
"\trrdtool last filename.rrd\n\n");
- char help_lastupdate[] =
+ const char *help_lastupdate =
N_("* lastupdate - returns the most recent datum stored for\n"
" each DS in an RRD\n\n" "\trrdtool lastupdate filename.rrd\n\n");
- char help_first[] =
+ const char *help_first =
N_("* first - show first update time for RRA within an RRD\n\n"
"\trrdtool first filename.rrd [--rraindex number]\n\n");
- char help_update[] =
+ const char *help_update =
N_("* update - update an RRD\n\n"
"\trrdtool update filename\n"
"\t\t--template|-t ds-name:ds-name:...\n"
@@ -99,7 +99,7 @@
"[EMAIL PROTECTED]:value...]\n\n"
"\t\t[ time:value[:value...] ..]\n\n");
- char help_updatev[] =
+ const char *help_updatev =
N_("* updatev - a verbose version of update\n"
"\treturns information about values, RRAs, and datasources updated\n\n"
"\trrdtool updatev filename\n"
@@ -108,7 +108,7 @@
"[EMAIL PROTECTED]:value...]\n\n"
"\t\t[ time:value[:value...] ..]\n\n");
- char help_fetch[] =
+ const char *help_fetch =
N_("* fetch - fetch data out of an RRD\n\n"
"\trrdtool fetch filename.rrd CF\n"
"\t\t[-r|--resolution resolution]\n"
@@ -116,7 +116,7 @@
/* break up very large strings (help_graph, help_tune) for ISO C89 compliance*/
- char help_graph1[] =
+ const char *help_graph1 =
N_("* graph - generate a graph from one or several RRD\n\n"
"\trrdtool graph filename [-s|--start seconds] [-e|--end seconds]\n"
"\t\t[-x|--x-grid x-axis grid and label]\n"
@@ -128,7 +128,7 @@
"\t\t[-l|--lower-limit value] [-r|--rigid]\n"
"\t\t[-g|--no-legend]\n"
"\t\t[-F|--force-rules-legend]\n" "\t\t[-j|--only-graph]\n");
- char help_graph2[] =
+ const char *help_graph2 =
N_("\t\t[-n|--font FONTTAG:size:font]\n"
"\t\t[-m|--zoom factor]\n"
"\t\t[-A|--alt-autoscale]\n"
@@ -145,7 +145,7 @@
"\t\t[-c|--color COLORTAG#rrggbb[aa]] [-t|--title string]\n"
"\t\t[-W|--watermark string]\n"
"\t\t[DEF:vname=rrd:ds-name:CF]\n");
- char help_graph3[] =
+ const char *help_graph3 =
N_("\t\t[CDEF:vname=rpn-expression]\n"
"\t\t[VDEF:vdefname=rpn-expression]\n"
"\t\t[PRINT:vdefname:format]\n" "\t\t[GPRINT:vdefname:format]\n"
@@ -159,7 +159,7 @@
"\t\t[GPRINT:vname:CF:format] (deprecated)\n"
"\t\t[STACK:vname[#rrggbb[aa][:legend]]] (deprecated)\n\n");
- char help_tune1[] =
+ const char *help_tune1 =
N_(" * tune - Modify some basic properties of an RRD\n\n"
"\trrdtool tune filename\n"
"\t\t[--heartbeat|-h ds-name:heartbeat]\n"
@@ -170,18 +170,18 @@
"\t\t[--failure-threshold integer]\n"
"\t\t[--window-length integer]\n"
"\t\t[--alpha adaptation-parameter]\n");
- char help_tune2[] =
+ const char *help_tune2 =
N_(" * tune - Modify some basic properties of an RRD\n\n"
"\t\t[--beta adaptation-parameter]\n"
"\t\t[--gamma adaptation-parameter]\n"
"\t\t[--gamma-deviation adaptation-parameter]\n"
"\t\t[--aberrant-reset ds-name]\n\n");
- char help_resize[] =
+ const char *help_resize =
N_(" * resize - alter the length of one of the RRAs in an RRD\n\n"
"\trrdtool resize filename rranum GROW|SHRINK rows\n\n");
- char help_xport[] =
+ const char *help_xport =
N_("* xport - generate XML dump from one or several RRD\n\n"
"\trrdtool xport [-s|--start seconds] [-e|--end seconds]\n"
"\t\t[-m|--maxrows rows]\n"
@@ -191,27 +191,27 @@
"\t\t[CDEF:vname=rpn-expression]\n"
"\t\t[XPORT:vname:legend]\n\n");
- char help_quit[] =
+ const char *help_quit =
N_(" * quit - closing a session in remote mode\n\n"
"\trrdtool quit\n\n");
- char help_ls[] =
+ const char *help_ls =
N_(" * ls - lists all *.rrd files in current directory\n\n"
"\trrdtool ls\n\n");
- char help_cd[] =
+ const char *help_cd =
N_(" * cd - changes the current directory\n\n"
"\trrdtool cd new directory\n\n");
- char help_mkdir[] =
+ const char *help_mkdir =
N_(" * mkdir - creates a new directory\n\n"
"\trrdtool mkdir newdirectoryname\n\n");
- char help_pwd[] =
+ const char *help_pwd =
N_(" * pwd - returns the current working directory\n\n"
"\trrdtool pwd\n\n");
- char help_lic[] =
+ const char *help_lic =
N_("RRDtool is distributed under the Terms of the GNU General\n"
"Public License Version 2. (www.gnu.org/copyleft/gpl.html)\n\n"
"For more information read the RRD manpages\n\n");
Index: src/rrd_update.c
===================================================================
--- src/rrd_update.c (revision 1310)
+++ src/rrd_update.c (working copy)
@@ -1755,6 +1755,9 @@
#ifdef DEBUG
fprintf(stderr, "Initialize CDP_val for RRA %d DS %d: %10.2f\n",
i, ii, pdp_temp_val);
+#else
+ /* Make compiler shut up */
+ i = ii = pdp_temp_val;
#endif
return pdp_temp_val;
}
Index: doc/rrdgraph_examples.pod
===================================================================
--- doc/rrdgraph_examples.pod (revision 1310)
+++ doc/rrdgraph_examples.pod (working copy)
@@ -115,6 +115,8 @@
more fancy style with offset: - - --- - --- -
LINE1:data#FF0000:"another dashed line":dashes=15,5,5,10:dash-offset=10
+=back
+
=head2 Time ranges
Last four weeks: --start end-4w --end 00:00
signature.asc
Description: Digital signature
_______________________________________________ rrd-developers mailing list [email protected] https://lists.oetiker.ch/cgi-bin/listinfo/rrd-developers
