# $Id$
+2008-03-29
+ * Increased C99 compliance.
+
2008-03-28
* Fixed messed up percentages (fs_free_perc, fs_used_perc, mpd_percent,
battery_percent).
struct information info;
-void update_uname()
+void update_uname(void)
{
uname(&info.uname_s);
}
-double get_time()
+double get_time(void)
{
struct timeval tv;
#define NEED(a) ((need_mask & (1 << a)) && ((info.mask & (1 << a)) == 0))
-void update_stuff()
+void update_stuff(void)
{
unsigned int i;
/* #define SIGNAL_BLOCKING */
#undef SIGNAL_BLOCKING
-static void print_version()
+static void print_version(void)
{
printf("Conky %s compiled %s for %s\n", VERSION, BUILD_DATE, BUILD_ARCH);
#define MAX_FONTS 64 // hmm, no particular reason, just makes sense.
-static void set_font();
+static void set_font(void);
int addfont(const char *data_in)
{
}
}
-void free_fonts()
+void free_fonts(void)
{
int i;
selected_font = 0;
}
-static void load_fonts()
+static void load_fonts(void)
{
int i;
}
short colour_depth = 0;
-void set_up_gradient();
+void set_up_gradient(void);
/* precalculated: 31/255, and 63/255 */
#define CONST_8_TO_5_BITS 0.12156862745098
return 0;
}
-static struct text_object *new_text_object_internal()
+static struct text_object *new_text_object_internal(void)
{
struct text_object *obj = malloc(sizeof(struct text_object));
memset(obj, 0, sizeof(struct text_object));
double current_update_time, last_update_time;
-static void generate_text()
+static void generate_text(void)
{
struct information *cur = &info;
char *p;
current_update_time = get_time();
- update_stuff(cur);
+ update_stuff();
/* fix diskio rates to b/s (use update_interval */
diskio_read_value = diskio_read_value / update_interval;
diskio_write_value = diskio_write_value / update_interval;
}
#ifdef X11
-static void set_font()
+static void set_font(void)
{
#ifdef XFT
if (use_xft) {
static void text_size_updater(char *s);
int last_font_height;
-static void update_text_area()
+static void update_text_area(void)
{
int x, y;
long redmask, greenmask, bluemask;
-void set_up_gradient()
+void set_up_gradient(void)
{
#ifdef X11
colour_depth = DisplayPlanes(display, screen);
#endif /* X11 */
}
-static void draw_text()
+static void draw_text(void)
{
#ifdef X11
cur_y = text_start_y;
for_each_line(text_buffer, draw_line);
}
-static void draw_stuff()
+static void draw_stuff(void)
{
#ifdef X11
selected_font = 0;
static int need_to_update;
/* update_text() generates new text and clears old text area */
-static void update_text()
+static void update_text(void)
{
generate_text();
#ifdef X11
need_to_update = 1;
}
-static void main_loop()
+static void main_loop(void)
{
#ifdef SIGNAL_BLOCKING
sigset_t newmask, oldmask;
#endif
#ifdef BMPX
-void update_bmpx();
+void update_bmpx(void);
struct bmpx_s {
char *title;
char *artist;
};
#endif
-void update_entropy();
+void update_entropy(void);
struct entropy_s {
unsigned int entropy_avail;
unsigned int poolsize;
extern struct conky_window window;
-void init_X11();
+void init_X11(void);
void init_window(int use_own_window, int width, int height, int set_trans,
int back_colour, char **argv, int argc);
-void create_gc();
+void create_gc(void);
void set_transparent_background(Window win);
long get_x11_color(const char *);
void reload_config(void);
void clean_up(void);
-void update_uname();
+void update_uname(void);
double get_time(void);
FILE *open_file(const char *file, int *reported);
void variable_substitute(const char *s, char *dest, unsigned int n);
void clear_net_stats(void);
void free_dns_data(void);
void update_dns_data(void);
-void update_users();
+void update_users(void);
-void update_stuff();
+void update_stuff(void);
int round_to_int(float f);
char get_freq(char *, size_t, char *, int, unsigned int);
void get_freq_dynamic(char *, size_t, char *, int);
char get_voltage(char *, size_t, char *, int, unsigned int); /* ptarjan */
-void update_load_average();
+void update_load_average(void);
int interface_up(const char *dev);
char *get_ioscheduler(char *);
int get_laptop_mode(void);
void get_ibm_acpi_volume(char *buf, size_t client_buffer_size);
void get_ibm_acpi_brightness(char *buf, size_t client_buffer_size);
char *get_disk_protect_queue(char *disk);
-void get_cpu_count();
+void get_cpu_count(void);
struct ibm_acpi_struct {
unsigned int temps[8];
double last_update;
};
-void update_top();
-void free_all_processes();
-struct process *get_first_process();
+void update_top(void);
+void free_all_processes(void);
+struct process *get_first_process(void);
/* fs-stuff is possibly system dependant (in fs.c) */
extern char *current_mail_spool;
-void update_mail_count();
+void update_mail_count(struct local_mail_s *);
/* in freebsd.c */
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
/* in xmms2.c */
#ifdef XMMS2
-void update_xmms2();
+void update_xmms2(void);
#endif
/* in hddtemp.c */
/* in rss.c */
#ifdef RSS
PRSS *get_rss_info(char *uri, int delay);
-void init_rss_info();
-void free_rss_info();
+void init_rss_info(void);
+void free_rss_info(void);
#endif /* RSS */
/* in linux.c */
static struct diskio_stat diskio_stats_[MAX_DISKIO_STATS];
struct diskio_stat *diskio_stats = diskio_stats_;
-void clear_diskio_stats()
+void clear_diskio_stats(void)
{
unsigned i;
for(i = 0; i < MAX_DISKIO_STATS; i++) {
struct diskio_stat *diskio_stats;
struct diskio_stat *prepare_diskio_stat(const char *s);
-void clear_diskio_stats();
+void clear_diskio_stats(void);
#endif /* DISKIO_H_ */
void get_fs_type(const char *path, char *result);
-void update_fs_stats()
+void update_fs_stats(void)
{
unsigned i;
}
}
-void clear_fs_stats()
+void clear_fs_stats(void)
{
unsigned i;
for (i = 0; i < MAX_FS_STATS; ++i) {
* using a flag in this manner creates less confusing code. */
static int prefer_proc = 0;
-void prepare_update()
+void prepare_update(void)
{
}
-void update_uptime()
+void update_uptime(void)
{
#ifdef HAVE_SYSINFO
if (!prefer_proc) {
/* these things are also in sysinfo except Buffers:
* (that's why I'm reading them from proc) */
-void update_meminfo()
+void update_meminfo(void)
{
FILE *meminfo_fp;
static int rep = 0;
fclose(meminfo_fp);
}
-int get_laptop_mode()
+int get_laptop_mode(void)
{
FILE *fp;
int val = -1;
x = strdup(y); \
}
-void update_gateway_info()
+void update_gateway_info(void)
{
FILE *fp;
struct in_addr ina;
return;
}
-inline void update_net_stats()
+inline void update_net_stats(void)
{
FILE *net_dev_fp;
static int rep = 0;
int result;
-void update_total_processes()
+void update_total_processes(void)
{
#ifdef HAVE_SYSINFO
if (!prefer_proc) {
}
}
-void get_cpu_count()
+void get_cpu_count(void)
{
FILE *stat_fp;
static int rep = 0;
#define TMPL_LONGSTAT "%*s %llu %llu %llu %llu %llu %llu %llu %llu"
#define TMPL_SHORTSTAT "%*s %llu %llu %llu %llu"
-inline static void update_stat()
+inline static void update_stat(void)
{
FILE *stat_fp;
static int rep = 0;
fclose(stat_fp);
}
-void update_running_processes()
+void update_running_processes(void)
{
update_stat();
}
-void update_cpu_usage()
+void update_cpu_usage(void)
{
update_stat();
}
-void update_load_average()
+void update_load_average(void)
{
#ifdef HAVE_GETLOADAVG
if (!prefer_proc) {
#define PROC_I8K "/proc/i8k"
#define I8K_DELIM " "
static char *i8k_procbuf = NULL;
-void update_i8k()
+void update_i8k(void)
{
FILE *fp;
* Small changes by David Sterba <sterd9am@ss1000.ms.mff.cuni.cz> */
#if defined(__i386) || defined(__x86_64)
-__inline__ unsigned long long int rdtsc()
+__inline__ unsigned long long int rdtsc(void)
{
unsigned long long int x;
snprintf(buf, n, "%s", pb_battery_info[i]);
}
-void update_top()
+void update_top(void)
{
show_nice_processes = 1;
process_find_top(info.cpu, info.memu);
#define NBD_MAJOR 43
#endif
-void update_diskio()
+void update_diskio(void)
{
static unsigned int last = UINT_MAX;
static unsigned int last_read = UINT_MAX;
* Peter Tarjan (ptarjan@citromail.hu) */
static double last_ibm_acpi_temp_time;
-void get_ibm_acpi_temps()
+void get_ibm_acpi_temps(void)
{
/* don't update too often */
return 0;
}
-void init_rss_info()
+void init_rss_info(void)
{
int i;
}
}
-void free_rss_info()
+void free_rss_info(void)
{
int i;
static unsigned long long previous_total = 0;
static struct process *first_process = 0;
-struct process *get_first_process()
+struct process *get_first_process(void)
{
return first_process;
}
-void free_all_processes()
+void free_all_processes(void)
{
struct process *next = NULL, *pr = first_process;
* Update process table *
******************************************/
-static int update_process_table()
+static int update_process_table(void)
{
DIR *dir;
struct dirent *entry;
* Strip dead process entries *
******************************************/
-static void process_cleanup()
+static void process_cleanup(void)
{
struct process *p = first_process;
#define TMPL_SHORTPROC "%*s %llu %llu %llu %llu"
#define TMPL_LONGPROC "%*s %llu %llu %llu %llu %llu %llu %llu %llu"
-static unsigned long long calc_cpu_total()
+static unsigned long long calc_cpu_total(void)
{
unsigned long long total = 0;
unsigned long long t = 0;
}
}
-void update_users()
+void update_users(void)
{
struct information *current_info = &info;
char temp[512] = "";
struct conky_window window;
/* local prototypes */
-static void update_workarea();
+static void update_workarea(void);
static Window find_desktop_window(Window *p_root, Window *p_desktop);
static Window find_subwindow(Window win, int w, int h);
/* X11 initializer */
-void init_X11()
+void init_X11(void)
{
if ((display = XOpenDisplay(0)) == NULL) {
CRIT_ERR("can't open display: %s", XDisplayName(0));
update_workarea();
}
-static void update_workarea()
+static void update_workarea(void)
{
Window root = RootWindow(display, screen);
unsigned long nitems, bytes;
return (long) color.pixel;
}
-void create_gc()
+void create_gc(void)
{
XGCValues values;