Code

prepare for the release of rrdtool-1.3.7
[rrdtool.git] / src / rrd_info.c
index f2a81f06d452a3dd8a6e3ffa3662960a06b17a89..d4e6219040debe3a350b20a891e7ef20ff7b64ed 100644 (file)
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * RRDtool 1.3.0  Copyright by Tobi Oetiker, 1997-2008
+ * RRDtool 1.3.7  Copyright by Tobi Oetiker, 1997-2009
  *****************************************************************************
  * rrd_info  Get Information about the configuration of an RRD
  *****************************************************************************/
@@ -8,6 +8,10 @@
 #include "rrd_rpncalc.h"
 #include <stdarg.h>
 
+#ifdef WIN32
+#include <stdlib.h>
+#endif
+
 /* proto */
 rrd_info_t *rrd_info(
     int,
@@ -23,7 +27,7 @@ char     *sprintf_alloc(
     int       maxlen = 1024 + strlen(fmt);
     char     *str = NULL;
     va_list   argp;
-    str = malloc(sizeof(char) * (maxlen + 1));
+    str = (char*)(malloc(sizeof(char) * (maxlen + 1)));
     if (str != NULL) {
         va_start(argp, fmt);
 #ifdef HAVE_VSNPRINTF
@@ -44,7 +48,7 @@ rrd_info_t
 {
     rrd_info_t *next;
 
-    next = malloc(sizeof(*next));
+    next = (rrd_info_t*)(malloc(sizeof(*next)));
     next->next = (rrd_info_t *) 0;
     if (info)
         info->next = next;
@@ -61,13 +65,13 @@ rrd_info_t
         next->value.u_int = value.u_int;
         break;
     case RD_I_STR:
-        next->value.u_str = malloc(sizeof(char) * (strlen(value.u_str) + 1));
+        next->value.u_str = (char*)(malloc(sizeof(char) * (strlen(value.u_str) + 1)));
         strcpy(next->value.u_str, value.u_str);
         break;
     case RD_I_BLO:
         next->value.u_blo.size = value.u_blo.size;
         next->value.u_blo.ptr =
-            malloc(sizeof(unsigned char) * value.u_blo.size);
+            (unsigned char*)malloc(sizeof(unsigned char) * value.u_blo.size);
         memcpy(next->value.u_blo.ptr, value.u_blo.ptr, value.u_blo.size);
         break;
     }