summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3a5660d)
raw | patch | inline | side by side (parent: 3a5660d)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 24 May 2009 10:31:44 +0000 (10:31 +0000) | ||
committer | oetiker <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/branches/1.3@1808 a5681a0c-68f1-0310-ab6d-d61299d08faa
* 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/branches/1.3@1808 a5681a0c-68f1-0310-ab6d-d61299d08faa
program/configure.ac | patch | blob | history | |
program/src/rrd_info.c | patch | blob | history | |
program/src/rrd_open.c | patch | blob | history | |
program/src/rrd_update.c | patch | blob | history |
diff --git a/program/configure.ac b/program/configure.ac
index ce37e4fdbec60b003b4888da4c4da45b6062710f..10e08f9cee9c02f9e1dbe32eaa546283b8124548 100644 (file)
--- a/program/configure.ac
+++ b/program/configure.ac
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
diff --git a/program/src/rrd_info.c b/program/src/rrd_info.c
index 83364d20688714a006575862bd1bda413ac28f06..9ea68d4c7e3cefdba7151fb8b11b7dd3bd5be5e4 100644 (file)
--- a/program/src/rrd_info.c
+++ b/program/src/rrd_info.c
char *fmt,
...)
{
- int maxlen = 1024 + strlen(fmt);
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);
vsprintf(str, fmt, argp);
#endif
}
+#endif // HAVE_VASPRINTF
va_end(argp);
return str;
}
diff --git a/program/src/rrd_open.c b/program/src/rrd_open.c
index a1b2670ef8a249187ea54ed86b5e9371725e7cd1..dba1a018d7b6db55a86596b9fc44425e5b7e3e07 100644 (file)
--- a/program/src/rrd_open.c
+++ b/program/src/rrd_open.c
for (i=0; i<rrd->stat_head->rra_cnt; i++)
row_cnt += rrd->rra_def[i].row_cnt;
- off_t correct_len = rrd_file->header_len +
+ size_t correct_len = rrd_file->header_len +
sizeof(rrd_value_t) * row_cnt * rrd->stat_head->ds_cnt;
if (correct_len > rrd_file->file_len)
rrd_t *rrd)
{
#if defined USE_MADVISE || defined HAVE_POSIX_FADVISE
- unsigned long dontneed_start;
- unsigned long rra_start;
- unsigned long active_block;
- unsigned long i;
+ size_t dontneed_start;
+ size_t rra_start;
+ size_t active_block;
+ size_t i;
ssize_t _page_size = sysconf(_SC_PAGESIZE);
if (rrd_file == NULL) {
index 36a7e1dbf55d761cfe59b5a1bd776d9fc298a881..3ee6ce5e042abdf89ce28ef71c22ec7e2cab69d0 100644 (file)
--- a/program/src/rrd_update.c
+++ b/program/src/rrd_update.c
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