1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-27 04:32:55 +00:00

update machinery: clean up

* Remove leftover INFO_* values from object definitions which didn't
  trigger anything.
* Drop the whole INFO_* enum as it's values are not used anymore.
This commit is contained in:
Phil Sutter 2009-09-07 01:12:11 +02:00
parent e044093735
commit e83fb84c55
4 changed files with 13 additions and 38 deletions

View File

@ -415,18 +415,13 @@ void free_update_callbacks(void)
update_cb_head.next = NULL; update_cb_head.next = NULL;
} }
unsigned long long need_mask;
int no_buffers; int no_buffers;
#define NEED(a) ((need_mask & (1ULL << a)) && ((info.mask & (1ULL << a)) == 0))
void update_stuff(void) void update_stuff(void)
{ {
int i; int i;
struct update_cb *uc; struct update_cb *uc;
info.mask = 0;
/* clear speeds and up status in case device was removed and doesn't get /* clear speeds and up status in case device was removed and doesn't get
* updated */ * updated */

View File

@ -53,7 +53,6 @@ int round_to_int_temp(float);
unsigned int round_to_int(float); unsigned int round_to_int(float);
extern unsigned long long need_mask;
extern int no_buffers; extern int no_buffers;
struct dns_data { struct dns_data {

View File

@ -206,25 +206,6 @@ extern struct conftree *currentconffile;
#define MAX_TEMPLATES 10 #define MAX_TEMPLATES 10
char **get_templates(void); char **get_templates(void);
enum {
INFO_MAIL = 1,
INFO_FS = 8,
INFO_SYSFS = 9,
INFO_MIXER = 10,
INFO_UNAME = 12,
INFO_FREQ = 13,
INFO_WIFI = 16,
#ifdef IBM
INFO_SMAPI = 25,
#endif
#ifdef NVIDIA
INFO_NVIDIA = 28,
#endif
#ifdef WEATHER
INFO_WEATHER = 33,
#endif
};
/* get_battery_stuff() item selector /* get_battery_stuff() item selector
* needed by conky.c, linux.c and freebsd.c */ * needed by conky.c, linux.c and freebsd.c */
enum { enum {

View File

@ -244,12 +244,12 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
} else } else
#endif /* X11 */ #endif /* X11 */
#ifdef __OpenBSD__ #ifdef __OpenBSD__
OBJ(freq, INFO_FREQ) OBJ(freq, 0)
#else #else
OBJ(acpitemp, 0) OBJ(acpitemp, 0)
obj->data.i = open_acpi_temperature(arg); obj->data.i = open_acpi_temperature(arg);
END OBJ(acpiacadapter, 0) END OBJ(acpiacadapter, 0)
END OBJ(freq, INFO_FREQ) END OBJ(freq, 0)
#endif /* !__OpenBSD__ */ #endif /* !__OpenBSD__ */
get_cpu_count(); get_cpu_count();
if (!arg || !isdigit(arg[0]) || strlen(arg) >= 2 || atoi(&arg[0]) == 0 if (!arg || !isdigit(arg[0]) || strlen(arg) >= 2 || atoi(&arg[0]) == 0
@ -261,7 +261,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
obj->data.cpu_index = atoi(&arg[0]); obj->data.cpu_index = atoi(&arg[0]);
} }
obj->a = 1; obj->a = 1;
END OBJ(freq_g, INFO_FREQ) END OBJ(freq_g, 0)
get_cpu_count(); get_cpu_count();
if (!arg || !isdigit(arg[0]) || strlen(arg) >= 2 || atoi(&arg[0]) == 0 if (!arg || !isdigit(arg[0]) || strlen(arg) >= 2 || atoi(&arg[0]) == 0
|| (unsigned int) atoi(&arg[0]) > info.cpu_count) { || (unsigned int) atoi(&arg[0]) > info.cpu_count) {
@ -933,7 +933,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
obj->data.pair.b = b; obj->data.pair.b = b;
#ifdef __linux__ #ifdef __linux__
END OBJ(i2c, INFO_SYSFS) END OBJ(i2c, 0)
char buf1[64], buf2[64]; char buf1[64], buf2[64];
float factor, offset; float factor, offset;
int n, found = 0; int n, found = 0;
@ -967,7 +967,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
obj->data.sysfs.factor = factor; obj->data.sysfs.factor = factor;
obj->data.sysfs.offset = offset; obj->data.sysfs.offset = offset;
END OBJ(platform, INFO_SYSFS) END OBJ(platform, 0)
char buf1[64], buf2[64]; char buf1[64], buf2[64];
float factor, offset; float factor, offset;
int n, found = 0; int n, found = 0;
@ -995,7 +995,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
obj->data.sysfs.factor = factor; obj->data.sysfs.factor = factor;
obj->data.sysfs.offset = offset; obj->data.sysfs.offset = offset;
END OBJ(hwmon, INFO_SYSFS) END OBJ(hwmon, 0)
char buf1[64], buf2[64]; char buf1[64], buf2[64];
float factor, offset; float factor, offset;
int n, found = 0; int n, found = 0;
@ -1391,27 +1391,27 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
if (buf) free(buf); if (buf) free(buf);
#endif /* X11*/ #endif /* X11*/
END OBJ(mixer, INFO_MIXER) END OBJ(mixer, 0)
obj->data.l = mixer_init(arg); obj->data.l = mixer_init(arg);
END OBJ(mixerl, INFO_MIXER) END OBJ(mixerl, 0)
obj->data.l = mixer_init(arg); obj->data.l = mixer_init(arg);
END OBJ(mixerr, INFO_MIXER) END OBJ(mixerr, 0)
obj->data.l = mixer_init(arg); obj->data.l = mixer_init(arg);
#ifdef X11 #ifdef X11
END OBJ(mixerbar, INFO_MIXER) END OBJ(mixerbar, 0)
SIZE_DEFAULTS(bar); SIZE_DEFAULTS(bar);
scan_mixer_bar(arg, &obj->data.mixerbar.l, &obj->data.mixerbar.w, scan_mixer_bar(arg, &obj->data.mixerbar.l, &obj->data.mixerbar.w,
&obj->data.mixerbar.h); &obj->data.mixerbar.h);
END OBJ(mixerlbar, INFO_MIXER) END OBJ(mixerlbar, 0)
SIZE_DEFAULTS(bar); SIZE_DEFAULTS(bar);
scan_mixer_bar(arg, &obj->data.mixerbar.l, &obj->data.mixerbar.w, scan_mixer_bar(arg, &obj->data.mixerbar.l, &obj->data.mixerbar.w,
&obj->data.mixerbar.h); &obj->data.mixerbar.h);
END OBJ(mixerrbar, INFO_MIXER) END OBJ(mixerrbar, 0)
SIZE_DEFAULTS(bar); SIZE_DEFAULTS(bar);
scan_mixer_bar(arg, &obj->data.mixerbar.l, &obj->data.mixerbar.w, scan_mixer_bar(arg, &obj->data.mixerbar.l, &obj->data.mixerbar.w,
&obj->data.mixerbar.h); &obj->data.mixerbar.h);
#endif #endif
END OBJ_IF(if_mixer_mute, INFO_MIXER) END OBJ_IF(if_mixer_mute, 0)
obj->data.ifblock.i = mixer_init(arg); obj->data.ifblock.i = mixer_init(arg);
#ifdef X11 #ifdef X11
END OBJ(monitor, CALLBACK(&update_x11info)) END OBJ(monitor, CALLBACK(&update_x11info))