summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4e6fc7a)
raw | patch | inline | side by side (parent: 4e6fc7a)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 9 May 2005 20:13:28 +0000 (20:13 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 9 May 2005 20:13:28 +0000 (20:13 +0000) |
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@530 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/art_rgba_svp.c | patch | blob | history | |
src/rrd_afm.c | patch | blob | history | |
src/rrd_gfx.c | patch | blob | history | |
src/rrd_update.c | patch | blob | history | |
src/rrd_xport.c | patch | blob | history | |
src/unused.h | [new file with mode: 0644] | patch | blob |
diff --git a/src/art_rgba_svp.c b/src/art_rgba_svp.c
index b4adb4cdb52e0ff4a7b77d4d0b91baa7d1756978..25083d780e2119c7663a20c54fc688f6086412bf 100644 (file)
--- a/src/art_rgba_svp.c
+++ b/src/art_rgba_svp.c
#include <libart_lgpl/art_rgb.h>
#include "art_rgba_svp.h"
+#include "unused.h"
static void art_rgba_fill_run (art_u8 * linebuf, art_u8 r, art_u8 g, art_u8 b, int n);
static void art_rgba_run_alpha (art_u8 * linebuf, art_u8 r, art_u8 g, art_u8 b, int alpha, int n);
};
static void
-art_rgba_svp_alpha_callback (void *callback_data, int y,
+art_rgba_svp_alpha_callback (void *callback_data, int UNUSED(y),
int start, ArtSVPRenderAAStep *steps, int n_steps)
{
ArtRgbaSVPAlphaData *data = callback_data;
}
static void
-art_rgba_svp_alpha_opaque_callback (void *callback_data, int y,
+art_rgba_svp_alpha_opaque_callback (void *callback_data, int UNUSED(y),
int start,
ArtSVPRenderAAStep *steps, int n_steps)
{
int libart_x0, int libart_y0, int libart_x1, int libart_y1,
art_u32 rgba,
art_u8 *buf, int rowstride,
- ArtAlphaGamma *alphagamma)
+ ArtAlphaGamma UNUSED(*alphagamma))
{
ArtRgbaSVPAlphaData data;
int r, g, b, alpha;
diff --git a/src/rrd_afm.c b/src/rrd_afm.c
index 0bb0ac4f0cf30ec0ac6459f094533e928b8ef113..20a65a033e2b495ce49c8f24064821470bafe4e0 100644 (file)
--- a/src/rrd_afm.c
+++ b/src/rrd_afm.c
#include <string.h>
#endif
+#include "unused.h"
+
#if 0
# define DEBUG 1
# define DLOG(x) fprintf x
}
/* measure width of a text string */
-double afm_get_text_width ( double start, const char* font, double size,
- double tabwidth, const char* text)
+double afm_get_text_width ( double UNUSED(start), const char* font, double size,
+ double UNUSED(tabwidth), const char* text)
{
const afm_fontinfo *fontinfo = afm_findfont(font);
long width = 0;
diff --git a/src/rrd_gfx.c b/src/rrd_gfx.c
index e288f034bbb3165d39695a3abb0c0abbec358ccd..2b3283189e1542cddea2ed08dcd13cde0a30cac1 100644 (file)
--- a/src/rrd_gfx.c
+++ b/src/rrd_gfx.c
#include "rrd_gfx.h"
#include "rrd_afm.h"
+#include "unused.h"
/* lines are better drawn on the pixle than between pixles */
#define LINEOFFSET 0.5
}
double gfx_get_text_width_libart (
- gfx_canvas_t *canvas, double start, char* font, double size,
+ gfx_canvas_t *canvas, double UNUSED(start), char* font, double size,
double tabwidth, char* text, int rotation ){
int error;
int gfx_render_pdf (gfx_canvas_t *canvas,
art_u32 width, art_u32 height,
- gfx_color_t background, FILE *fp){
+ gfx_color_t UNUSED(background), FILE *fp){
struct pdf_state state;
memset(&state, 0, sizeof(pdf_state));
state.fp = fp;
diff --git a/src/rrd_update.c b/src/rrd_update.c
index 1896466797a0bf6c54ef24d17c68bc40d651f048..6ec40f769125158efe33a132a0271d290dbc3bbc 100644 (file)
--- a/src/rrd_update.c
+++ b/src/rrd_update.c
#include "rrd_rpncalc.h"
#include "rrd_is_thread_safe.h"
+#include "unused.h"
#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
/*
#ifdef HAVE_MMAP
info_t *write_RRA_row (rrd_t *rrd, unsigned long rra_idx,
unsigned long *rra_current,
- unsigned short CDP_scratch_idx, FILE *rrd_file,
+ unsigned short CDP_scratch_idx,
+#ifndef DEBUG
+FILE UNUSED(*rrd_file),
+#else
+FILE *rrd_file,
+#endif
info_t *pcdp_summary, time_t *rra_time, void *rrd_mmaped_file);
#else
info_t *write_RRA_row (rrd_t *rrd, unsigned long rra_idx,
#ifdef HAVE_MMAP
info_t
*write_RRA_row (rrd_t *rrd, unsigned long rra_idx, unsigned long *rra_current,
- unsigned short CDP_scratch_idx, FILE *rrd_file,
+ unsigned short CDP_scratch_idx,
+#ifndef DEBUG
+FILE UNUSED(*rrd_file),
+#else
+FILE *rrd_file,
+#endif
info_t *pcdp_summary, time_t *rra_time, void *rrd_mmaped_file)
#else
info_t
diff --git a/src/rrd_xport.c b/src/rrd_xport.c
index 0e64dfd589ee560ef68a67fb2e23d849284cc7d4..129dd30ac3e7c6c5d8c1c647ad24c02e13474dcf 100644 (file)
--- a/src/rrd_xport.c
+++ b/src/rrd_xport.c
#include "rrd_tool.h"
#include "rrd_graph.h"
#include "rrd_xport.h"
+#include "unused.h"
#if defined(WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)
#include <io.h>
int
-rrd_xport(int argc, char **argv, int *xsize,
+rrd_xport(int argc, char **argv, int UNUSED(*xsize),
time_t *start,
time_t *end, /* which time frame do you want ?
* will be changed to represent reality */
diff --git a/src/unused.h b/src/unused.h
--- /dev/null
+++ b/src/unused.h
@@ -0,0 +1,11 @@
+/* define a macro to wrap variables in that would
+ otherwhise generate UNUSED variable warnings */
+
+#ifdef UNUSED
+#elif defined(__GNUC__)
+# define UNUSED(x) x __attribute__((unused))
+#elif defined(__LCLINT__)
+# define UNUSED(x) /*@unused@*/ x
+#else
+# define UNUSED(x) x
+#endif