* in 1.3: Changed types used in rrd_file_t from off_t to size_t to prevent: warning...
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sun, 24 May 2009 10:31:44 +0000 (10:31 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Sun, 24 May 2009 10:31:44 +0000 (10:31 +0000)
* Misc other off_t -> size_t changes to prevent signed warning
* in 1.3: Added rrd_dump_opt_r declaration to prevent undef warning
* Explicit cast to time_t of check in rrd_fetch to prevent signed warning
* Added vasprintf path to sprintf_alloc to prevent excessive mallocing
* in 1.3: fixed STRERROR_R_CHAR_P undef warning

patch by Steven Hartland killing multiplay.co.uk

git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1808 a5681a0c-68f1-0310-ab6d-d61299d08faa

configure.ac
src/rrd_info.c
src/rrd_open.c
src/rrd_update.c

index ac5023e..8647eb0 100644 (file)
@@ -203,7 +203,7 @@ AC_C_BIGENDIAN
 dnl for each function found we get a definition in config.h 
 dnl of the form HAVE_FUNCTION
 
 dnl for each function found we get a definition in config.h 
 dnl of the form HAVE_FUNCTION
 
-AC_CHECK_FUNCS(tzset fsync mbstowcs opendir readdir chdir chroot getuid setlocale strerror snprintf vsnprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday)
+AC_CHECK_FUNCS(tzset fsync mbstowcs opendir readdir chdir chroot getuid setlocale strerror snprintf vsnprintf vasprintf fpclass class fp_class isnan memmove strchr mktime getrusage gettimeofday)
 
 AC_FUNC_STRERROR_R
 
 
 AC_FUNC_STRERROR_R
 
index 9b2363f..73407a9 100644 (file)
@@ -21,9 +21,13 @@ char     *sprintf_alloc(
     char *fmt,
     ...)
 {
     char *fmt,
     ...)
 {
-    int       maxlen = 1024 + strlen(fmt);
     char     *str = NULL;
     va_list   argp;
     char     *str = NULL;
     va_list   argp;
+#ifdef HAVE_VASPRINTF
+       va_start( argp, fmt );
+       vasprintf( &str, fmt, argp );
+#else
+    int       maxlen = 1024 + strlen(fmt);
     str = (char*)malloc(sizeof(char) * (maxlen + 1));
     if (str != NULL) {
         va_start(argp, fmt);
     str = (char*)malloc(sizeof(char) * (maxlen + 1));
     if (str != NULL) {
         va_start(argp, fmt);
@@ -33,6 +37,7 @@ char     *sprintf_alloc(
         vsprintf(str, fmt, argp);
 #endif
     }
         vsprintf(str, fmt, argp);
 #endif
     }
+#endif // HAVE_VASPRINTF
     va_end(argp);
     return str;
 }
     va_end(argp);
     return str;
 }
index 42426c6..dba4ca6 100644 (file)
@@ -464,7 +464,7 @@ void rrd_dontneed(
     size_t dontneed_start;
     size_t rra_start;
     size_t active_block;
     size_t dontneed_start;
     size_t rra_start;
     size_t active_block;
-    unsigned long i;
+    size_t i;
     ssize_t   _page_size = sysconf(_SC_PAGESIZE);
 
     if (rrd_file == NULL) {
     ssize_t   _page_size = sysconf(_SC_PAGESIZE);
 
     if (rrd_file == NULL) {
index 5c60702..11a00bb 100644 (file)
@@ -1896,7 +1896,7 @@ static int write_to_rras(
                  scratch_idx = CDP_secondary_val,
                  step_subtract = 2) {
 
                  scratch_idx = CDP_secondary_val,
                  step_subtract = 2) {
 
-            off_t rra_pos_new;
+            size_t rra_pos_new;
 #ifdef DEBUG
             fprintf(stderr, "  -- RRA Preseek %ld\n", rrd_file->pos);
 #endif
 #ifdef DEBUG
             fprintf(stderr, "  -- RRA Preseek %ld\n", rrd_file->pos);
 #endif