summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorŽilvinas Valinskas <zilvinas.valinskas@gmail.com>2014-05-02 20:02:59 +0300
committerThomas Graf <tgraf@suug.ch>2014-06-02 15:03:26 +0200
commitee98b9ea304744766e22ccc10899dadf71a361b8 (patch)
treebdb06efde359947e3e24a0d3bcda3b5279b1a39d
parent852008c4aebfaa4f26efaf41a2c05ffd7e399869 (diff)
osx: fix remaining compiler warnings
Signed-off-by: Žilvinas Valinskas <zilvinas.valinskas@gmail.com> Signed-off-by: Thomas Graf <tgraf@suug.ch>
-rw-r--r--include/bmon/list.h8
-rw-r--r--src/module.c1
-rw-r--r--src/out_format.c4
3 files changed, 11 insertions, 2 deletions
diff --git a/include/bmon/list.h b/include/bmon/list.h
index c7569d7..fff9409 100644
--- a/include/bmon/list.h
+++ b/include/bmon/list.h
@@ -8,6 +8,14 @@
#ifndef BMON_LIST_H_
#define BMON_LIST_H_
+#ifdef __APPLE__
+/* Apple systems define these macros in system headers, so we undef
+ * them prior to inclusion of this file */
+#undef LIST_HEAD
+#undef LIST_HEAD_INIT
+#undef INIT_LIST_HEAD
+#endif
+
struct list_head
{
struct list_head * next;
diff --git a/src/module.c b/src/module.c
index 5727e58..b245f72 100644
--- a/src/module.c
+++ b/src/module.c
@@ -115,6 +115,7 @@ int module_register(struct bmon_subsys *ss, struct bmon_module *m)
list_add_tail(&m->m_list, &ss->s_mod_list);
m->m_subsys = ss;
+ return 0;
}
static void __auto_load(struct bmon_module *m)
diff --git a/src/out_format.c b/src/out_format.c
index bfe29a5..19c588f 100644
--- a/src/out_format.c
+++ b/src/out_format.c
@@ -126,10 +126,10 @@ static char *get_token(struct element_group *g, struct element *e,
}
if (!strncasecmp(type, "rx:", 3)) {
- snprintf(buf, len, "%lu", a->a_rx_rate.r_total);
+ snprintf(buf, len, "%llu", a->a_rx_rate.r_total);
return buf;
} else if (!strncasecmp(type, "tx:", 3)) {
- snprintf(buf, len, "%lu", a->a_tx_rate.r_total);
+ snprintf(buf, len, "%llu", a->a_tx_rate.r_total);
return buf;
} else if (!strncasecmp(type, "rxrate:", 7)) {
snprintf(buf, len, "%.2f", a->a_rx_rate.r_rate);