mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-23 19:39:06 +00:00
some linting on function definitions
* instead of empty args "void" should always be specified. Using this, the compiler can detect incorrect function calls, like with update_stuff(). * No args seems to be interpreted as "unspecified args" by the compiler, as with update_mail_count(). So no checking for correctness of arguments when calling was done at all. * This is not complete yet, as I still don't have any BSD for testing. git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1055 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
59c5fe4d11
commit
e306a2c2e8
@ -1,5 +1,8 @@
|
||||
# $Id$
|
||||
|
||||
2008-03-29
|
||||
* Increased C99 compliance.
|
||||
|
||||
2008-03-28
|
||||
* Fixed messed up percentages (fs_free_perc, fs_used_perc, mpd_percent,
|
||||
battery_percent).
|
||||
|
@ -36,12 +36,12 @@
|
||||
|
||||
struct information info;
|
||||
|
||||
void update_uname()
|
||||
void update_uname(void)
|
||||
{
|
||||
uname(&info.uname_s);
|
||||
}
|
||||
|
||||
double get_time()
|
||||
double get_time(void)
|
||||
{
|
||||
struct timeval tv;
|
||||
|
||||
@ -234,7 +234,7 @@ unsigned long long need_mask;
|
||||
|
||||
#define NEED(a) ((need_mask & (1 << a)) && ((info.mask & (1 << a)) == 0))
|
||||
|
||||
void update_stuff()
|
||||
void update_stuff(void)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
|
30
src/conky.c
30
src/conky.c
@ -74,7 +74,7 @@
|
||||
/* #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);
|
||||
|
||||
@ -188,7 +188,7 @@ struct font_list *fonts = NULL;
|
||||
|
||||
#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)
|
||||
{
|
||||
@ -241,7 +241,7 @@ void set_first_font(const char *data_in)
|
||||
}
|
||||
}
|
||||
|
||||
void free_fonts()
|
||||
void free_fonts(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -263,7 +263,7 @@ void free_fonts()
|
||||
selected_font = 0;
|
||||
}
|
||||
|
||||
static void load_fonts()
|
||||
static void load_fonts(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -727,7 +727,7 @@ inline void graph_append(struct special_t *graph, double f)
|
||||
}
|
||||
|
||||
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
|
||||
@ -1950,7 +1950,7 @@ void *threaded_exec(struct text_object *obj)
|
||||
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));
|
||||
@ -6145,7 +6145,7 @@ head:
|
||||
|
||||
double current_update_time, last_update_time;
|
||||
|
||||
static void generate_text()
|
||||
static void generate_text(void)
|
||||
{
|
||||
struct information *cur = &info;
|
||||
char *p;
|
||||
@ -6156,7 +6156,7 @@ static void generate_text()
|
||||
|
||||
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;
|
||||
@ -6186,7 +6186,7 @@ static void generate_text()
|
||||
}
|
||||
|
||||
#ifdef X11
|
||||
static void set_font()
|
||||
static void set_font(void)
|
||||
{
|
||||
#ifdef XFT
|
||||
if (use_xft) {
|
||||
@ -6257,7 +6257,7 @@ static inline int get_string_width_special(char *s)
|
||||
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;
|
||||
|
||||
@ -6525,7 +6525,7 @@ static void draw_string(const char *s)
|
||||
|
||||
long redmask, greenmask, bluemask;
|
||||
|
||||
void set_up_gradient()
|
||||
void set_up_gradient(void)
|
||||
{
|
||||
#ifdef X11
|
||||
colour_depth = DisplayPlanes(display, screen);
|
||||
@ -6934,7 +6934,7 @@ static void draw_line(char *s)
|
||||
#endif /* X11 */
|
||||
}
|
||||
|
||||
static void draw_text()
|
||||
static void draw_text(void)
|
||||
{
|
||||
#ifdef X11
|
||||
cur_y = text_start_y;
|
||||
@ -6965,7 +6965,7 @@ static void draw_text()
|
||||
for_each_line(text_buffer, draw_line);
|
||||
}
|
||||
|
||||
static void draw_stuff()
|
||||
static void draw_stuff(void)
|
||||
{
|
||||
#ifdef X11
|
||||
selected_font = 0;
|
||||
@ -7038,7 +7038,7 @@ static void clear_text(int exposures)
|
||||
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
|
||||
@ -7047,7 +7047,7 @@ static void update_text()
|
||||
need_to_update = 1;
|
||||
}
|
||||
|
||||
static void main_loop()
|
||||
static void main_loop(void)
|
||||
{
|
||||
#ifdef SIGNAL_BLOCKING
|
||||
sigset_t newmask, oldmask;
|
||||
|
32
src/conky.h
32
src/conky.h
@ -233,7 +233,7 @@ struct audacious_s {
|
||||
#endif
|
||||
|
||||
#ifdef BMPX
|
||||
void update_bmpx();
|
||||
void update_bmpx(void);
|
||||
struct bmpx_s {
|
||||
char *title;
|
||||
char *artist;
|
||||
@ -244,7 +244,7 @@ struct bmpx_s {
|
||||
};
|
||||
#endif
|
||||
|
||||
void update_entropy();
|
||||
void update_entropy(void);
|
||||
struct entropy_s {
|
||||
unsigned int entropy_avail;
|
||||
unsigned int poolsize;
|
||||
@ -493,10 +493,10 @@ extern int workarea[4];
|
||||
|
||||
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 *);
|
||||
|
||||
@ -514,7 +514,7 @@ void signal_handler(int);
|
||||
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);
|
||||
@ -524,9 +524,9 @@ struct net_stat *get_net_stat(const char *dev);
|
||||
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);
|
||||
|
||||
@ -551,7 +551,7 @@ void update_i8k(void);
|
||||
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);
|
||||
@ -585,7 +585,7 @@ void get_ibm_acpi_temps(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];
|
||||
@ -641,9 +641,9 @@ struct local_mail_s {
|
||||
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) */
|
||||
|
||||
@ -662,7 +662,7 @@ int mixer_get_right(int);
|
||||
|
||||
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__)
|
||||
@ -690,7 +690,7 @@ void free_mpd_vars(struct information *current_info);
|
||||
|
||||
/* in xmms2.c */
|
||||
#ifdef XMMS2
|
||||
void update_xmms2();
|
||||
void update_xmms2(void);
|
||||
#endif
|
||||
|
||||
/* in hddtemp.c */
|
||||
@ -702,8 +702,8 @@ char *get_hddtemp_info(char *dev, char *addr, int port, char *unit);
|
||||
/* 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 */
|
||||
|
@ -33,7 +33,7 @@
|
||||
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++) {
|
||||
|
@ -41,6 +41,6 @@ struct diskio_stat {
|
||||
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_ */
|
||||
|
4
src/fs.c
4
src/fs.c
@ -59,7 +59,7 @@ static void update_fs_stat(struct fs_stat *fs);
|
||||
|
||||
void get_fs_type(const char *path, char *result);
|
||||
|
||||
void update_fs_stats()
|
||||
void update_fs_stats(void)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
@ -70,7 +70,7 @@ void update_fs_stats()
|
||||
}
|
||||
}
|
||||
|
||||
void clear_fs_stats()
|
||||
void clear_fs_stats(void)
|
||||
{
|
||||
unsigned i;
|
||||
for (i = 0; i < MAX_FS_STATS; ++i) {
|
||||
|
34
src/linux.c
34
src/linux.c
@ -73,11 +73,11 @@ static int show_nice_processes;
|
||||
* 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) {
|
||||
@ -126,7 +126,7 @@ int check_mount(char *s)
|
||||
/* 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;
|
||||
@ -171,7 +171,7 @@ void update_meminfo()
|
||||
fclose(meminfo_fp);
|
||||
}
|
||||
|
||||
int get_laptop_mode()
|
||||
int get_laptop_mode(void)
|
||||
{
|
||||
FILE *fp;
|
||||
int val = -1;
|
||||
@ -241,7 +241,7 @@ int interface_up(const char *dev)
|
||||
x = strdup(y); \
|
||||
}
|
||||
|
||||
void update_gateway_info()
|
||||
void update_gateway_info(void)
|
||||
{
|
||||
FILE *fp;
|
||||
struct in_addr ina;
|
||||
@ -288,7 +288,7 @@ FAIL:
|
||||
return;
|
||||
}
|
||||
|
||||
inline void update_net_stats()
|
||||
inline void update_net_stats(void)
|
||||
{
|
||||
FILE *net_dev_fp;
|
||||
static int rep = 0;
|
||||
@ -506,7 +506,7 @@ inline void update_net_stats()
|
||||
|
||||
int result;
|
||||
|
||||
void update_total_processes()
|
||||
void update_total_processes(void)
|
||||
{
|
||||
#ifdef HAVE_SYSINFO
|
||||
if (!prefer_proc) {
|
||||
@ -565,7 +565,7 @@ void determine_longstat(char *buf)
|
||||
}
|
||||
}
|
||||
|
||||
void get_cpu_count()
|
||||
void get_cpu_count(void)
|
||||
{
|
||||
FILE *stat_fp;
|
||||
static int rep = 0;
|
||||
@ -601,7 +601,7 @@ void get_cpu_count()
|
||||
#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;
|
||||
@ -699,17 +699,17 @@ inline static void update_stat()
|
||||
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) {
|
||||
@ -739,7 +739,7 @@ void update_load_average()
|
||||
#define PROC_I8K "/proc/i8k"
|
||||
#define I8K_DELIM " "
|
||||
static char *i8k_procbuf = NULL;
|
||||
void update_i8k()
|
||||
void update_i8k(void)
|
||||
{
|
||||
FILE *fp;
|
||||
|
||||
@ -1031,7 +1031,7 @@ void get_adt746x_cpu(char *p_client_buffer, size_t client_buffer_size)
|
||||
* 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;
|
||||
|
||||
@ -2047,7 +2047,7 @@ void get_powerbook_batt_info(char *buf, size_t n, int i)
|
||||
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);
|
||||
@ -2069,7 +2069,7 @@ void update_top()
|
||||
#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;
|
||||
@ -2256,7 +2256,7 @@ temperatures: 41 43 31 46 33 -128 29 -128
|
||||
* 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 */
|
||||
|
@ -88,7 +88,7 @@ int rss_delay(int *wait, int delay)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void init_rss_info()
|
||||
void init_rss_info(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -99,7 +99,7 @@ void init_rss_info()
|
||||
}
|
||||
}
|
||||
|
||||
void free_rss_info()
|
||||
void free_rss_info(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
10
src/top.c
10
src/top.c
@ -32,12 +32,12 @@ static unsigned long g_time = 0;
|
||||
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;
|
||||
|
||||
@ -246,7 +246,7 @@ static int calculate_cpu(struct process *process)
|
||||
* Update process table *
|
||||
******************************************/
|
||||
|
||||
static int update_process_table()
|
||||
static int update_process_table(void)
|
||||
{
|
||||
DIR *dir;
|
||||
struct dirent *entry;
|
||||
@ -320,7 +320,7 @@ static void delete_process(struct process *p)
|
||||
* Strip dead process entries *
|
||||
******************************************/
|
||||
|
||||
static void process_cleanup()
|
||||
static void process_cleanup(void)
|
||||
{
|
||||
|
||||
struct process *p = first_process;
|
||||
@ -346,7 +346,7 @@ static void process_cleanup()
|
||||
#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;
|
||||
|
@ -116,7 +116,7 @@ static void users_alloc(struct information *ptr)
|
||||
}
|
||||
}
|
||||
|
||||
void update_users()
|
||||
void update_users(void)
|
||||
{
|
||||
struct information *current_info = &info;
|
||||
char temp[512] = "";
|
||||
|
@ -59,12 +59,12 @@ int workarea[4];
|
||||
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));
|
||||
@ -77,7 +77,7 @@ void init_X11()
|
||||
update_workarea();
|
||||
}
|
||||
|
||||
static void update_workarea()
|
||||
static void update_workarea(void)
|
||||
{
|
||||
Window root = RootWindow(display, screen);
|
||||
unsigned long nitems, bytes;
|
||||
@ -535,7 +535,7 @@ long get_x11_color(const char *name)
|
||||
return (long) color.pixel;
|
||||
}
|
||||
|
||||
void create_gc()
|
||||
void create_gc(void)
|
||||
{
|
||||
XGCValues values;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user