From 376e048b40007bf24adffa2317ebb3e9903a3c86 Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 23 Jul 2010 03:48:47 +0200 Subject: move sink_list var to sink.c (included from sink.h) other c-files than sink.c get the extern definition via sink.h, only sink.c receives the non-extern one --- src/interface.c | 1 - src/pa-sink-ctl.c | 2 -- src/sink.c | 5 ++--- src/sink.h | 6 ++++++ 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/interface.c b/src/interface.c index c545bf9..3c02e78 100644 --- a/src/interface.c +++ b/src/interface.c @@ -14,7 +14,6 @@ #define VOLUME_BAR_LEN 50 #define H_MSG_BOX 3 -extern GArray *sink_list; extern pa_context* context; static WINDOW *menu_win; diff --git a/src/pa-sink-ctl.c b/src/pa-sink-ctl.c index 3d9421d..767a5a6 100644 --- a/src/pa-sink-ctl.c +++ b/src/pa-sink-ctl.c @@ -7,8 +7,6 @@ #include "interface.h" #include "pa-sink-ctl.h" -GArray *sink_list = NULL; - pa_context *context = NULL; static gboolean info_callbacks_finished = TRUE; diff --git a/src/sink.c b/src/sink.c index 8da3048..9f36f3e 100644 --- a/src/sink.c +++ b/src/sink.c @@ -1,9 +1,8 @@ #include -#include "sink_input.h" +#define SINK_C #include "sink.h" - -extern GArray *sink_list; +#include "sink_input.h" /* * init a sink list diff --git a/src/sink.h b/src/sink.h index 4e46045..cccbe1b 100644 --- a/src/sink.h +++ b/src/sink.h @@ -1,6 +1,12 @@ #ifndef SINK_H #define SINK_H +#ifdef SINK_C +GArray *sink_list; +#else +extern GArray *sink_list; +#endif + #include #include -- cgit