summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a64145f)
raw | patch | inline | side by side (parent: a64145f)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 1 Jun 2007 09:10:33 +0000 (09:10 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 1 Jun 2007 09:10:33 +0000 (09:10 +0000) |
- use 'z' length modifier when printing size_t
- add a cast to __rrd_read and document why it is there
- add RANDOM hint for the header
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1096 a5681a0c-68f1-0310-ab6d-d61299d08faa
- add a cast to __rrd_read and document why it is there
- add RANDOM hint for the header
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1096 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_cgi.c | patch | blob | history | |
src/rrd_graph_helper.c | patch | blob | history | |
src/rrd_open.c | patch | blob | history |
diff --git a/src/rrd_cgi.c b/src/rrd_cgi.c
index 23567c5d2252fe0ca05988a6a4ac58d9c6c2923e..75dabf4a7eecf5000518282d7e54a4c2b05b5dec 100644 (file)
--- a/src/rrd_cgi.c
+++ b/src/rrd_cgi.c
if (!filter) {
printf("Content-Type: text/html\n"
- "Content-Length: %d\n", strlen(buffer));
+ "Content-Length: %zd\n", strlen(buffer));
if (labs(goodfor) > 0) {
time_t now;
diff --git a/src/rrd_graph_helper.c b/src/rrd_graph_helper.c
index 0c1c7d80792bbf294bbd6ded1edf81cfbe41a832..2ea3a2d2b563a4e6470e96d6be459d8ad68cb71e 100644 (file)
--- a/src/rrd_graph_helper.c
+++ b/src/rrd_graph_helper.c
break;
}
if (gdp->debug) {
- dprintf("used %i out of %i chars\n", eaten, strlen(argv[i]));
+ dprintf("used %i out of %zi chars\n", eaten, strlen(argv[i]));
dprintf("parsed line: '%s'\n", argv[i]);
dprintf("remaining: '%s'\n", &argv[i][eaten]);
if (eaten >= strlen(argv[i]))
diff --git a/src/rrd_open.c b/src/rrd_open.c
index 525fa29738f64a804896f93e80eda1aeafc992ae..746044edc0cadb9380b53038e29e2db43c71166e 100644 (file)
--- a/src/rrd_open.c
+++ b/src/rrd_open.c
#define CHECK_MADVISE_OVERLAPS 1
#ifdef HAVE_MMAP
+/* the cast to void* is there to avoid this warning seen on ia64 with certain
+ versions of gcc: 'cast increases required alignment of target type'
+*/
#define __rrd_read(dst, dst_t, cnt) \
- (dst) = (dst_t*) (data + offset); \
+ (dst) = (dst_t*)(void*) (data + offset); \
offset += sizeof(dst_t) * (cnt)
#else
#define __rrd_read(dst, dst_t, cnt) \
_madvise(data, rrd_file->file_len, MADV_WILLNEED | MADV_SEQUENTIAL);
goto out_done;
}
+# ifndef ONE_PAGE
/* We do not need to read anything in for the moment */
-#ifndef ONE_PAGE
_madvise(data, rrd_file->file_len, MADV_DONTNEED);
-// _madvise(data, rrd_file->file_len, MADV_RANDOM);
-#else
-/* alternatively: keep 2 pages worth of data, likely headers,
+# else
+/* alternatively: keep 1 page worth of data, likely headers,
* don't need the rest. */
_madvise(data, _page_size, MADV_WILLNEED | MADV_SEQUENTIAL);
_madvise(data + _page_size, (rrd_file->file_len >= _page_size)
? rrd_file->file_len - _page_size : 0, MADV_DONTNEED);
-#endif
+# endif
#endif
#if defined USE_MADVISE && !defined ONE_PAGE
/* the stat_head will be needed soonish, so hint accordingly */
-// too finegrained to calc the individual sizes, just keep 2 pages worth of hdr
_madvise(data + PAGE_ALIGN_DOWN(offset), PAGE_ALIGN(sizeof(stat_head_t)),
- MADV_WILLNEED);
+ MADV_WILLNEED | MADV_RANDOM);
#endif