From 6ee76e5c55f42c89f1df2e461bef1d74af3e15a3 Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Sun, 22 Nov 2009 14:05:11 +0100 Subject: [PATCH] Fix compiling with --disable-x11 --- src/exec.c | 4 ++-- src/exec.h | 4 ++-- src/llua.c | 2 +- src/llua.h | 2 +- src/mixer.c | 3 --- src/specials.c | 4 +--- src/specials.h | 4 ++-- src/text_object.h | 14 ++++++-------- 8 files changed, 15 insertions(+), 22 deletions(-) diff --git a/src/exec.c b/src/exec.c index 280e58ce..79cda00a 100644 --- a/src/exec.c +++ b/src/exec.c @@ -361,7 +361,6 @@ void print_texeci(struct text_object *obj, char *p, int p_max_size) } } -#ifdef X11 void print_execgauge(struct text_object *obj, char *p, int p_max_size) { double barnum; @@ -375,6 +374,7 @@ void print_execgauge(struct text_object *obj, char *p, int p_max_size) } } +#ifdef X11 void print_execgraph(struct text_object *obj, char *p, int p_max_size) { double barnum; @@ -411,6 +411,7 @@ void print_execigraph(struct text_object *obj, char *p, int p_max_size) } new_graph(obj, p, (int) (ed->barnum)); } +#endif /* X11 */ void print_execigauge(struct text_object *obj, char *p, int p_max_size) { @@ -432,7 +433,6 @@ void print_execigauge(struct text_object *obj, char *p, int p_max_size) } new_gauge(obj, p, p_max_size, round_to_int(ed->barnum)); } -#endif /* X11 */ void print_execbar(struct text_object *obj, char *p, int p_max_size) { diff --git a/src/exec.h b/src/exec.h index dd88b211..846d1141 100644 --- a/src/exec.h +++ b/src/exec.h @@ -42,12 +42,12 @@ void print_execp(struct text_object *, char *, int); void print_execi(struct text_object *, char *, int); void print_execpi(struct text_object *, char *, int); void print_texeci(struct text_object *, char *, int); -#ifdef X11 void print_execgauge(struct text_object *, char *, int); +#ifdef X11 void print_execgraph(struct text_object *, char *, int); void print_execigraph(struct text_object *, char *, int); -void print_execigauge(struct text_object *, char *, int); #endif /* X11 */ +void print_execigauge(struct text_object *, char *, int); void print_execbar(struct text_object *, char *, int); void print_execibar(struct text_object *, char *, int); void free_exec(struct text_object *); diff --git a/src/llua.c b/src/llua.c index 6153ea77..750c8f37 100644 --- a/src/llua.c +++ b/src/llua.c @@ -566,6 +566,7 @@ void print_lua_graph(struct text_object *obj, char *p, int p_max_size) new_graph(obj, p, per); } } +#endif /* X11 */ void print_lua_gauge(struct text_object *obj, char *p, int p_max_size) { @@ -578,4 +579,3 @@ void print_lua_gauge(struct text_object *obj, char *p, int p_max_size) new_gauge(obj, p, p_max_size, (per/100.0 * 255)); } } -#endif /* X11 */ diff --git a/src/llua.h b/src/llua.h index 4a10a1b2..0c940342 100644 --- a/src/llua.h +++ b/src/llua.h @@ -70,7 +70,7 @@ void print_lua_parse(struct text_object *, char *, int); void print_lua_bar(struct text_object *, char *, int); #ifdef X11 void print_lua_graph(struct text_object *, char *, int); -void print_lua_gauge(struct text_object *, char *, int); #endif /* X11 */ +void print_lua_gauge(struct text_object *, char *, int); #endif /* LUA_H_*/ diff --git a/src/mixer.c b/src/mixer.c index cf321083..b3f11965 100644 --- a/src/mixer.c +++ b/src/mixer.c @@ -325,7 +325,6 @@ int check_mixer_muted(struct text_object *obj) return 1; } -#ifdef X11 void scan_mixer_bar(struct text_object *obj, const char *arg) { char buf1[64]; @@ -372,5 +371,3 @@ void print_mixerr_bar(struct text_object *obj, char *p, int p_max_size) { print_mixer_bar_chan(obj, 1, p, p_max_size); } - -#endif /* X11 */ diff --git a/src/specials.c b/src/specials.c index a2904130..859da86a 100644 --- a/src/specials.c +++ b/src/specials.c @@ -48,8 +48,8 @@ int special_count; int default_bar_width = 0, default_bar_height = 6; #ifdef X11 int default_graph_width = 0, default_graph_height = 25; -int default_gauge_width = 40, default_gauge_height = 25; #endif /* X11 */ +int default_gauge_width = 40, default_gauge_height = 25; /* * Special data typedefs @@ -82,7 +82,6 @@ struct tab { * Scanning arguments to various special text objects */ -#ifdef X11 const char *scan_gauge(struct text_object *obj, const char *args) { struct gauge *g; @@ -109,7 +108,6 @@ const char *scan_gauge(struct text_object *obj, const char *args) obj->special_data = g; return args; } -#endif /* X11 */ const char *scan_bar(struct text_object *obj, const char *args) { diff --git a/src/specials.h b/src/specials.h index 0d93fa96..101306f7 100644 --- a/src/specials.h +++ b/src/specials.h @@ -103,13 +103,13 @@ void scan_tab(struct text_object *, const char *); void scan_stippled_hr(struct text_object *, const char*); /* printing specials */ -void new_gauge(struct text_object *, char *, int, int); -void new_bar(struct text_object *, char *, int, int); void new_font(char *, char *); void new_graph(struct text_object *, char *, double); void new_hr(char *, int); void new_stippled_hr(struct text_object *, char *); #endif +void new_gauge(struct text_object *, char *, int, int); +void new_bar(struct text_object *, char *, int, int); void new_fg(char *, long); void new_bg(char *, long); void new_outline(char *, long); diff --git a/src/text_object.h b/src/text_object.h index 08057d30..5c9f7795 100644 --- a/src/text_object.h +++ b/src/text_object.h @@ -67,8 +67,8 @@ enum text_object_type { OBJ_font, OBJ_cpu, OBJ_cpubar, -#ifdef X11 OBJ_cpugauge, +#ifdef X11 OBJ_cpugraph, OBJ_loadgraph, #endif /* X11 */ @@ -94,11 +94,11 @@ enum text_object_type { OBJ_texeci, OBJ_execbar, OBJ_execibar, -#ifdef X11 OBJ_execgauge, + OBJ_execigauge, +#ifdef X11 OBJ_execgraph, OBJ_execigraph, - OBJ_execigauge, #endif /* X11 */ OBJ_execp, OBJ_execpi, @@ -207,8 +207,8 @@ enum text_object_type { OBJ_mem, OBJ_memeasyfree, OBJ_memfree, -#ifdef X11 OBJ_memgauge, +#ifdef X11 OBJ_memgraph, #endif /* X11 */ OBJ_membar, @@ -217,11 +217,9 @@ enum text_object_type { OBJ_mixer, OBJ_mixerl, OBJ_mixerr, -#ifdef X11 OBJ_mixerbar, OBJ_mixerlbar, OBJ_mixerrbar, -#endif /* X11 */ OBJ_if_mixer_mute, #ifdef X11 OBJ_monitor, @@ -427,9 +425,9 @@ enum text_object_type { OBJ_lua, OBJ_lua_parse, OBJ_lua_bar, + OBJ_lua_gauge, #ifdef X11 OBJ_lua_graph, - OBJ_lua_gauge, #endif /* X11 */ #endif /* HAVE_LUA */ #ifdef TCP_PORT_MONITOR @@ -461,9 +459,9 @@ enum text_object_type { OBJ_apcupsd_linev, OBJ_apcupsd_load, OBJ_apcupsd_loadbar, + OBJ_apcupsd_loadgauge, #ifdef X11 OBJ_apcupsd_loadgraph, - OBJ_apcupsd_loadgauge, #endif /* X11 */ OBJ_apcupsd_charge, OBJ_apcupsd_timeleft,