From ee98b9ea304744766e22ccc10899dadf71a361b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Z=CC=8Cilvinas=20Valinskas?= Date: Fri, 2 May 2014 20:02:59 +0300 Subject: [PATCH] osx: fix remaining compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Žilvinas Valinskas Signed-off-by: Thomas Graf --- include/bmon/list.h | 8 ++++++++ src/module.c | 1 + src/out_format.c | 4 ++-- 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);