Code

prepare for the release of rrdtool-1.3.7
[rrdtool-all.git] / program / src / rrd_first.c
index 07c5a447874fa1b1ce22f93b3b4347908ae2a990..6a951a29a8daee362566a23c1fc3d0de32422d1a 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.3.2  Copyright by Tobi Oetiker, 1997-2008
+ * RRDtool 1.3.7  Copyright by Tobi Oetiker, 1997-2009
  *****************************************************************************
  * rrd_first Return
  *****************************************************************************
@@ -8,6 +8,9 @@
 
 #include "rrd_tool.h"
 
+#ifdef WIN32
+#include <stdlib.h>
+#endif
 
 time_t rrd_first(
     int argc,
@@ -80,7 +83,7 @@ time_t rrd_first_r(
              (rra_start +
               (rrd.rra_ptr[rraindex].cur_row + 1) *
               rrd.stat_head->ds_cnt * sizeof(rrd_value_t)), SEEK_SET);
-    timer = -(rrd.rra_def[rraindex].row_cnt - 1);
+    timer = -(long)(rrd.rra_def[rraindex].row_cnt - 1);
     if (rrd.rra_ptr[rraindex].cur_row + 1 > rrd.rra_def[rraindex].row_cnt) {
         rrd_seek(rrd_file, rra_start, SEEK_SET);
     }