summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 56f2825)
raw | patch | inline | side by side (parent: 56f2825)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 7 Apr 2010 13:04:33 +0000 (13:04 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Wed, 7 Apr 2010 13:04:33 +0000 (13:04 +0000) |
program/src/rrd_daemon.c | patch | blob | history | |
program/src/rrd_fetch_libdbi.c | patch | blob | history | |
program/src/rrd_getopt.c | patch | blob | history | |
program/src/rrd_open.c | patch | blob | history |
index 128f3c444afe0bdde1d75331532f73ea388df0c2..58b07049d836924fe2ad65e6a6f7220af6320428 100644 (file)
--- a/program/src/rrd_daemon.c
+++ b/program/src/rrd_daemon.c
#include "rrd.h"
#include "rrd_client.h"
+#include "unused.h"
#include <stdlib.h>
syslog ((severity), __VA_ARGS__); \
} while (0)
-#ifndef __GNUC__
-# define __attribute__(x) /**/
-#endif
-
/*
* Types
*/
struct command_s;
typedef struct command_s command_t;
/* note: guard against "unused" warnings in the handlers */
-#define DISPATCH_PROTO listen_socket_t *sock __attribute__((unused)),\
- time_t now __attribute__((unused)),\
- char *buffer __attribute__((unused)),\
- size_t buffer_size __attribute__((unused))
+#define DISPATCH_PROTO listen_socket_t UNUSED(*sock),\
+ time_t UNUSED(now),\
+ char UNUSED(*buffer),\
+ size_t UNUSED(buffer_size)
-#define HANDLER_PROTO command_t *cmd __attribute__((unused)),\
+#define HANDLER_PROTO command_t UNUSED(*cmd),\
DISPATCH_PROTO
struct command_s {
pthread_cond_broadcast(&queue_cond);
} /* }}} void sig_common */
-static void sig_int_handler (int s __attribute__((unused))) /* {{{ */
+static void sig_int_handler (int UNUSED(s)) /* {{{ */
{
sig_common("INT");
} /* }}} void sig_int_handler */
-static void sig_term_handler (int s __attribute__((unused))) /* {{{ */
+static void sig_term_handler (int UNUSED(s)) /* {{{ */
{
sig_common("TERM");
} /* }}} void sig_term_handler */
-static void sig_usr1_handler (int s __attribute__((unused))) /* {{{ */
+static void sig_usr1_handler (int UNUSED(s)) /* {{{ */
{
config_flush_at_shutdown = 1;
sig_common("USR1");
} /* }}} void sig_usr1_handler */
-static void sig_usr2_handler (int s __attribute__((unused))) /* {{{ */
+static void sig_usr2_handler (int UNUSED(s)) /* {{{ */
{
config_flush_at_shutdown = 0;
sig_common("USR2");
return (0);
} /* int flush_old_values */
-static void *flush_thread_main (void *args __attribute__((unused))) /* {{{ */
+static void *flush_thread_main (void UNUSED(*args)) /* {{{ */
{
struct timeval now;
struct timespec next_flush;
return NULL;
} /* void *flush_thread_main */
-static void *queue_thread_main (void *args __attribute__((unused))) /* {{{ */
+static void *queue_thread_main (void UNUSED(*args)) /* {{{ */
{
pthread_mutex_lock (&cache_lock);
return (0);
} /* }}} int close_listen_sockets */
-static void *listen_thread_main (void *args __attribute__((unused))) /* {{{ */
+static void *listen_thread_main (void UNUSED(*args)) /* {{{ */
{
struct pollfd *pollfds;
int pollfds_num;
index 0e8bc939b32eab0bdc5c4999241fdaebb25be7ba..7ca809e34f613193ddc04ae97abaaccdaaf84c42 100644 (file)
#include "rrd_tool.h"
+#include "unused.h"
#include <dbi/dbi.h>
#include <time.h>
int
rrd_fetch_fn_libdbi(
const char *filename, /* name of the rrd */
- enum cf_en cf_idx __attribute__((unused)), /* consolidation function */
+ enum cf_en UNUSED(cf_idx), /* consolidation function */
time_t *start,
time_t *end, /* which time frame do you want ?
* will be changed to represent reality */
index f973471c0f016e3c11da534f6a22969c300260d1..a74ff88de7a6bcc140c492cd2da5d5158414d471 100644 (file)
--- a/program/src/rrd_getopt.c
+++ b/program/src/rrd_getopt.c
to getopt is that one passed to the process. */
static void store_args(
int argc,
- char *const *argv) __attribute__ ((unused));
+ char *const *argv);
+
static void store_args(
int argc,
char *const *argv)
diff --git a/program/src/rrd_open.c b/program/src/rrd_open.c
index 820b5471381d79004fc730b4e577942ed70dff59..9f4f6e2758a9095c657f2a19c90fcf1f3008d888 100644 (file)
--- a/program/src/rrd_open.c
+++ b/program/src/rrd_open.c
/* this is a leftover from the old days, it serves no purpose
and is therefore turned into a no-op */
void rrd_flush(
- rrd_file_t *rrd_file __attribute__((unused)))
+ rrd_file_t UNUSED(*rrd_file))
{
}
* aligning RRAs within stripes, or other performance enhancements
*/
void rrd_notify_row(
- rrd_file_t *rrd_file __attribute__((unused)),
- int rra_idx __attribute__((unused)),
- unsigned long rra_row __attribute__((unused)),
- time_t rra_time __attribute__((unused)))
+ rrd_file_t UNUSED(*rrd_file),
+ int UNUSED(rra_idx),
+ unsigned long UNUSED(rra_row),
+ time_t UNUSED(rra_time))
{
}
* don't change to a new disk block at the same time
*/
unsigned long rrd_select_initial_row(
- rrd_file_t *rrd_file __attribute__((unused)),
- int rra_idx __attribute__((unused)),
+ rrd_file_t UNUSED(*rrd_file),
+ int UNUSED(rra_idx),
rra_def_t *rra
)
{