prepare for the release of rrdtool-1.2.21
[rrdtool.git] / src / rrd_tune.c
index 7ab31f5..4cf0c39 100644 (file)
@@ -1,10 +1,16 @@
 /*****************************************************************************
- * RRDtool 1.0.33  Copyright Tobias Oetiker, 1997 - 2000
+ * RRDtool 1.2.21  Copyright by Tobi Oetiker, 1997-2007
  *****************************************************************************
  * change header parameters of an rrd
  *****************************************************************************
  * $Id$
  * $Log$
+ * Revision 1.6  2004/05/26 22:11:12  oetiker
+ * reduce compiler warnings. Many small fixes. -- Mike Slifcak <slif@bellsouth.net>
+ *
+ * Revision 1.5  2002/02/01 20:34:49  oetiker
+ * fixed version number and date/time
+ *
  * Revision 1.4  2001/08/22 22:29:07  jake
  * Contents of this patch:
  * (1) Adds/revises documentation for rrd tune in rrd_tool.c and pod files.
@@ -55,6 +61,7 @@ rrd_tune(int argc, char **argv)
     double              min;
     double              max;
     char                dst[DST_SIZE];
+    optind = 0; opterr = 0;  /* initialize getopt */
 
 
     if(rrd_open(argv[1],&rrd_file,&rrd, RRD_READWRITE)==-1){
@@ -153,7 +160,7 @@ rrd_tune(int argc, char **argv)
                fclose(rrd_file);
                return -1;
            }
-           if (dst_conv(dst) == -1){
+           if ((int)dst_conv(dst) == -1){
                rrd_free(&rrd);
                fclose(rrd_file);
                return -1;
@@ -274,7 +281,7 @@ rrd_tune(int argc, char **argv)
                   rrd_file);
     } else {
        int i;
-       for(i=0;i< rrd.stat_head->ds_cnt;i++)
+       for(i=0;i< (int)rrd.stat_head->ds_cnt;i++)
                if (dst_conv(rrd.ds_def[i].dst) != DST_CDEF) {
            printf("DS[%s] typ: %s\thbt: %ld\tmin: %1.4f\tmax: %1.4f\n",
                   rrd.ds_def[i].ds_nam,
@@ -283,7 +290,7 @@ rrd_tune(int argc, char **argv)
                   rrd.ds_def[i].par[DS_min_val].u_val,
                   rrd.ds_def[i].par[DS_max_val].u_val);
                } else {
-               char *buffer;
+               char *buffer = NULL;
                rpn_compact2str((rpn_cdefds_t *) &(rrd.ds_def[i].par[DS_cdef]),rrd.ds_def,&buffer);
                printf("DS[%s] typ: %s\tcdef: %s\n", rrd.ds_def[i].ds_nam,rrd.ds_def[i].dst,buffer);
            free(buffer);