static int config_keys_num = STATIC_ARRAY_SIZE (config_keys);
static size_t apache_curl_callback (void *buf, size_t size, size_t nmemb,
- void *stream)
+ void __attribute__((unused)) *stream)
{
size_t len = size * nmemb;
} /* }}} int ascent_submit_gauge */
static size_t ascent_curl_callback (void *buf, size_t size, size_t nmemb, /* {{{ */
- void *stream)
+ void __attribute__((unused)) *stream)
{
size_t len = size * nmemb;
#endif /* HAVE_IOKIT_IOKITLIB_H */
#if KERNEL_LINUX
-static int battery_read_acpi (const char *dir, const char *name,
- void *user_data)
+static int battery_read_acpi (const char __attribute__((unused)) *dir,
+ const char *name, void __attribute__((unused)) *user_data)
{
double current = INVALID_VALUE;
double voltage = INVALID_VALUE;
} /* void submit_counter */
static size_t bind_curl_callback (void *buf, size_t size, size_t nmemb,
- void *stream)
+ void __attribute__((unused)) *stream)
{
size_t len = size * nmemb;
static int loop = 0;
-static void *do_flush (void *arg)
+static void *do_flush (void __attribute__((unused)) *arg)
{
INFO ("Flushing all data.");
plugin_flush (NULL, -1, NULL);
return NULL;
}
-static void sig_int_handler (int signal)
+static void sig_int_handler (int __attribute__((unused)) signal)
{
loop++;
}
-static void sig_term_handler (int signal)
+static void sig_term_handler (int __attribute__((unused)) signal)
{
loop++;
}
-static void sig_usr1_handler (int signal)
+static void sig_usr1_handler (int __attribute__((unused)) signal)
{
pthread_t thread;
pthread_attr_t attr;
* Sebastian Harl <sh at tokkee.org>
**/
+#if !defined(__GNUC__) || !__GNUC__
+# define __attribute__(x) /**/
+#endif
+
#include "config.h"
#include <assert.h>
return 0;
} /* collectd_stop */
-static void sig_int_term_handler (int signo)
+static void sig_int_term_handler (int __attribute__((unused)) signo)
{
++loop;
return;
} /* sig_int_term_handler */
-static void sig_hup_handler (int signo)
+static void sig_hup_handler (int __attribute__((unused)) signo)
{
++restart;
return;
pthread_mutex_unlock (&opcode_mutex);
}
-static void *dns_child_loop (void *dummy)
+static void *dns_child_loop (void __attribute__((unused)) *dummy)
{
pcap_t *pcap_obj;
char pcap_error[PCAP_ERRBUF_SIZE];
pthread_exit ((void *)0);
} /* static void *collect (void *) */
-static void *open_connection (void *arg)
+static void *open_connection (void __attribute__((unused)) *arg)
{
struct sockaddr_un addr;
/*
* Functions
*/
-static void sigchld_handler (int signal) /* {{{ */
+static void sigchld_handler (int __attribute__((unused)) signal) /* {{{ */
{
pid_t pid;
int status;
} /* }}} int fc_bit_jump_destroy */
static int fc_bit_jump_invoke (const data_set_t *ds, /* {{{ */
- value_list_t *vl, notification_meta_t **meta, void **user_data)
+ value_list_t *vl, notification_meta_t __attribute__((unused)) **meta,
+ void **user_data)
{
char *chain_name;
fc_chain_t *chain;
return (FC_TARGET_CONTINUE);
} /* }}} int fc_bit_jump_invoke */
-static int fc_bit_stop_invoke (const data_set_t *ds, /* {{{ */
- value_list_t *vl, notification_meta_t **meta, void **user_data)
+static int fc_bit_stop_invoke (const data_set_t __attribute__((unused)) *ds, /* {{{ */
+ value_list_t __attribute__((unused)) *vl,
+ notification_meta_t __attribute__((unused)) **meta,
+ void __attribute__((unused)) **user_data)
{
return (FC_TARGET_STOP);
} /* }}} int fc_bit_stop_invoke */
-static int fc_bit_return_invoke (const data_set_t *ds, /* {{{ */
- value_list_t *vl, notification_meta_t **meta, void **user_data)
+static int fc_bit_return_invoke (const data_set_t __attribute__((unused)) *ds, /* {{{ */
+ value_list_t __attribute__((unused)) *vl,
+ notification_meta_t __attribute__((unused)) **meta,
+ void __attribute__((unused)) **user_data)
{
return (FC_TARGET_RETURN);
} /* }}} int fc_bit_return_invoke */
} /* }}} int fc_bit_write_destroy */
static int fc_bit_write_invoke (const data_set_t *ds, /* {{{ */
- value_list_t *vl, notification_meta_t **meta, void **user_data)
+ value_list_t *vl, notification_meta_t __attribute__((unused)) **meta,
+ void **user_data)
{
char **plugin_list;
int status;
static void sensor_read_handler (ipmi_sensor_t *sensor,
int err,
enum ipmi_value_present_e value_present,
- unsigned int raw_value,
+ unsigned int __attribute__((unused)) raw_value,
double value,
- ipmi_states_t *states,
+ ipmi_states_t __attribute__((unused)) *states,
void *user_data)
{
value_t values[1];
* Entity handlers
*/
static void entity_sensor_update_handler (enum ipmi_update_e op,
- ipmi_entity_t *entity,
+ ipmi_entity_t __attribute__((unused)) *entity,
ipmi_sensor_t *sensor,
- void *user_data)
+ void __attribute__((unused)) *user_data)
{
/* TODO: Ignore sensors we cannot read */
* Domain handlers
*/
static void domain_entity_update_handler (enum ipmi_update_e op,
- ipmi_domain_t *domain,
+ ipmi_domain_t __attribute__((unused)) *domain,
ipmi_entity_t *entity,
- void *user_data)
+ void __attribute__((unused)) *user_data)
{
int status;
return (0);
} /* int thread_init */
-static void *thread_main (void *user_data)
+static void *thread_main (void __attribute__((unused)) *user_data)
{
int status;
os_handler_t *os_handler = NULL;
return (0);
} /* }}} int mr_destroy */
-static int mr_match (const data_set_t *ds, const value_list_t *vl, /* {{{ */
- notification_meta_t **meta, void **user_data)
+static int mr_match (const data_set_t __attribute__((unused)) *ds, /* {{{ */
+ const value_list_t *vl,
+ notification_meta_t __attribute__((unused)) **meta,
+ void **user_data)
{
mr_match_t *m;
} /* }}} int mv_destroy */
static int mv_match (const data_set_t *ds, const value_list_t *vl, /* {{{ */
- notification_meta_t **meta, void **user_data)
+ notification_meta_t __attribute__((unused)) **meta, void **user_data)
{
mv_match_t *m;
gauge_t *values;
plugin_dispatch_values (&vl);
} /* void submit_two */
-static int link_filter (const struct sockaddr_nl *sa,
- struct nlmsghdr *nmh, void *args)
+static int link_filter (const struct sockaddr_nl __attribute__((unused)) *sa,
+ struct nlmsghdr *nmh, void __attribute__((unused)) *args)
{
struct ifinfomsg *msg;
int msg_len;
return (0);
} /* int link_filter */
-static int qos_filter (const struct sockaddr_nl *sa,
+static int qos_filter (const struct sockaddr_nl __attribute__((unused)) *sa,
struct nlmsghdr *nmh, void *args)
{
struct tcmsg *msg;
return (0);
} /* int network_get_listen_socket */
-static void *dispatch_thread (void *arg)
+static void *dispatch_thread (void __attribute__((unused)) *arg)
{
while (42)
{
return (0);
}
-static void *receive_thread (void *arg)
+static void *receive_thread (void __attribute__((unused)) *arg)
{
return (network_receive () ? (void *) 1 : (void *) 0);
} /* void *receive_thread */
* just send the buffer if `flush' is called - if the requested value was in
* there, good. If not, well, then there is nothing to flush.. -octo
*/
-static int network_flush (int timeout, const char *identifier)
+static int network_flush (int timeout,
+ const char __attribute__((unused)) *identifier)
{
pthread_mutex_lock (&send_buffer_lock);
};
static int config_keys_num = STATIC_ARRAY_SIZE (config_keys);
-static size_t nginx_curl_callback (void *buf, size_t size, size_t nmemb, void *stream)
+static size_t nginx_curl_callback (void *buf, size_t size, size_t nmemb,
+ void __attribute__((unused)) *stream)
{
size_t len = size * nmemb;
/* Callback to get username and password */
static int authinteract (auth_client_request_t request, char **result,
- int fields, void *arg)
+ int fields, void __attribute__((unused)) *arg)
{
int i;
for (i = 0; i < fields; i++)
/* Callback to print the recipient status */
static void print_recipient_status (smtp_recipient_t recipient,
- const char *mailbox, void *arg)
+ const char *mailbox, void __attribute__((unused)) *arg)
{
const smtp_status_t *status;
} /* void print_recipient_status */
/* Callback to monitor SMTP activity */
-static void monitor_cb (const char *buf, int buflen, int writing, void *arg)
+static void monitor_cb (const char *buf, int buflen, int writing,
+ void __attribute__((unused)) *arg)
{
char log_str[MAXSTRING];
return (0);
}
-static void *plugin_read_thread (void *args)
+static void *plugin_read_thread (void __attribute__((unused)) *args)
{
llentry_t *le;
read_func_t *rf;
} /* int value_list_to_string */
static int value_list_to_filename (char *buffer, int buffer_len,
- const data_set_t *ds, const value_list_t *vl)
+ const data_set_t __attribute__((unused)) *ds, const value_list_t *vl)
{
int offset = 0;
int status;
return (0);
} /* int value_list_to_filename */
-static void *rrd_queue_thread (void *data)
+static void *rrd_queue_thread (void __attribute__((unused)) *data)
{
struct timeval tv_next_update;
struct timeval tv_now;
return (0);
} /* int csnmp_read_host */
-static void *csnmp_read_thread (void *data)
+static void *csnmp_read_thread (void __attribute__((unused)) *data)
{
host_definition_t *host;
} /* }}} int tn_create */
static int tn_invoke (const data_set_t *ds, value_list_t *vl, /* {{{ */
- notification_meta_t **meta, void **user_data)
+ notification_meta_t __attribute__((unused)) **meta, void **user_data)
{
tn_data_t *data;
notification_t n;
} /* }}} int tr_create */
static int tr_invoke (const data_set_t *ds, value_list_t *vl, /* {{{ */
- notification_meta_t **meta, void **user_data)
+ notification_meta_t __attribute__((unused)) **meta, void **user_data)
{
tr_data_t *data;
} /* }}} int ts_create */
static int ts_invoke (const data_set_t *ds, value_list_t *vl, /* {{{ */
- notification_meta_t **meta, void **user_data)
+ notification_meta_t __attribute__((unused)) **meta, void **user_data)
{
ts_data_t *data;
} /* int tss2_select_vserver */
static int tss2_vserver_gapl (FILE *read_fh, FILE *write_fh,
- vserver_list_t *vserver, gauge_t *ret_value)
+ gauge_t *ret_value)
{
/*
* Reads the vserver's average packet loss and submits it to collectd.
* with an error. */
if ((status == 0) && (vserver != NULL))
{
- status = tss2_vserver_gapl (read_fh, write_fh, vserver, &packet_loss);
+ status = tss2_vserver_gapl (read_fh, write_fh, &packet_loss);
if (status == 0)
{
valid |= 0x20;
plugin_dispatch_values (&vl);
}
-static int thermal_sysfs_device_read (const char *dir, const char *name,
- void *user_data)
+static int thermal_sysfs_device_read (const char __attribute__((unused)) *dir,
+ const char *name, void __attribute__((unused)) *user_data)
{
char filename[256];
char data[1024];
return ok ? 0 : -1;
}
-static int thermal_procfs_device_read (const char *dir, const char *name,
- void *user_data)
+static int thermal_procfs_device_read (const char __attribute__((unused)) *dir,
+ const char *name, void __attribute__((unused)) *user_data)
{
const char str_temp[] = "temperature:";
char filename[256];
return ((void *) 0);
} /* void *us_handle_client */
-static void *us_server_thread (void *arg)
+static void *us_server_thread (void __attribute__((unused)) *arg)
{
int status;
int *remote_fd;
}
static int
-handle_dns(const char *buf, int len,
- const struct in6_addr *s_addr,
- const struct in6_addr *d_addr)
+handle_dns(const char *buf, int len)
{
rfc1035_header_t qh;
uint16_t us;
}
static int
-handle_udp(const struct udphdr *udp, int len,
- const struct in6_addr *s_addr,
- const struct in6_addr *d_addr)
+handle_udp(const struct udphdr *udp, int len)
{
char buf[PCAP_SNAPLEN];
if ((ntohs (udp->UDP_DEST) != 53)
&& (ntohs (udp->UDP_SRC) != 53))
return 0;
memcpy(buf, udp + 1, len - sizeof(*udp));
- if (0 == handle_dns(buf, len - sizeof(*udp), s_addr, d_addr))
+ if (0 == handle_dns(buf, len - sizeof(*udp)))
return 0;
return 1;
}
return (0);
memcpy (buf, (char *) ipv6 + offset, payload_len);
- if (handle_udp ((struct udphdr *) buf, payload_len, &s_addr, &d_addr) == 0)
+ if (handle_udp ((struct udphdr *) buf, payload_len) == 0)
return (0);
return (1); /* Success */
if (IPPROTO_UDP != ip->ip_p)
return 0;
memcpy(buf, (void *) ip + offset, len - offset);
- if (0 == handle_udp((struct udphdr *) buf, len - offset, &s_addr, &d_addr))
+ if (0 == handle_udp((struct udphdr *) buf, len - offset))
return 0;
return 1;
}
return (ret);
} /* char *match_substr */
-static int default_callback (const char *str,
+static int default_callback (const char __attribute__((unused)) *str,
char * const *matches, size_t matches_num, void *user_data)
{
cu_match_value_t *data = (cu_match_value_t *) user_data;
return (0);
} /* int simple_submit_match */
-static int tail_callback (void *data, char *buf, int buflen)
+static int tail_callback (void *data, char *buf,
+ int __attribute__((unused)) buflen)
{
cu_tail_match_t *obj = (cu_tail_match_t *) data;
int i;
* Does not fail.
*/
static int ut_check_one_data_source (const data_set_t *ds,
- const value_list_t *vl,
+ const value_list_t __attribute__((unused)) *vl,
const threshold_t *th,
const gauge_t *values,
int ds_index)