[PATCH 01/10] Use void as "parameter" for functions without arguments.

Simon Ruderich simon at ruderich.org
Sat Feb 1 21:55:14 CET 2014


If nothing is specified, the function can take any number of arguments.
---
 ipc-client/ipc-client.c |  2 +-
 ipc-client/main.c       |  4 ++--
 src/clientlist.c        | 16 ++++++++--------
 src/clientlist.h        | 14 +++++++-------
 src/ewmh.c              | 18 +++++++++---------
 src/ewmh.h              | 18 +++++++++---------
 src/hook.c              |  4 ++--
 src/hook.h              |  4 ++--
 src/ipc-server.c        |  4 ++--
 src/ipc-server.h        |  4 ++--
 src/key.c               | 12 ++++++------
 src/key.h               | 12 ++++++------
 src/layout.c            | 14 +++++++-------
 src/layout.h            | 12 ++++++------
 src/main.c              | 26 +++++++++++++-------------
 src/monitor.c           | 24 ++++++++++++------------
 src/monitor.h           | 24 ++++++++++++------------
 src/mouse.c             | 12 ++++++------
 src/mouse.h             | 10 +++++-----
 src/object.c            |  8 ++++----
 src/object.h            |  8 ++++----
 src/rules.c             |  6 +++---
 src/rules.h             |  6 +++---
 src/settings.c          |  6 +++---
 src/settings.h          |  8 ++++----
 src/stack.c             |  8 ++++----
 src/stack.h             |  6 +++---
 src/tag.c               | 18 +++++++++---------
 src/tag.h               | 18 +++++++++---------
 src/utils.c             |  2 +-
 src/utils.h             |  2 +-
 31 files changed, 165 insertions(+), 165 deletions(-)

diff --git a/ipc-client/ipc-client.c b/ipc-client/ipc-client.c
index d899351..37f4f52 100644
--- a/ipc-client/ipc-client.c
+++ b/ipc-client/ipc-client.c
@@ -31,7 +31,7 @@ struct HCConnection {
     Window      root;
 };
 
-HCConnection* hc_connect() {
+HCConnection* hc_connect(void) {
     Display* display = XOpenDisplay(NULL);
     if (display == NULL) {
         return NULL;
diff --git a/ipc-client/main.c b/ipc-client/main.c
index 678c55b..6039e23 100644
--- a/ipc-client/main.c
+++ b/ipc-client/main.c
@@ -18,7 +18,7 @@
 
 void print_help(char* command, FILE* file);
 void init_hook_regex(int argc, char* argv[]);
-void destroy_hook_regex();
+void destroy_hook_regex(void);
 
 int g_ensure_newline = 1; // if set, output ends with a newline
 int g_wait_for_hook = 0; // if set, do not execute command but wait
@@ -53,7 +53,7 @@ void init_hook_regex(int argc, char* argv[]) {
     g_hook_regex_count = argc;
 }
 
-void destroy_hook_regex() {
+void destroy_hook_regex(void) {
     int i;
     for (i = 0; i < g_hook_regex_count; i++) {
         regfree(g_hook_regex + i);
diff --git a/src/clientlist.c b/src/clientlist.c
index 34331ab..36dde75 100644
--- a/src/clientlist.c
+++ b/src/clientlist.c
@@ -53,7 +53,7 @@ static Atom g_wmatom[WMLast];
 
 static void client_set_urgent_force(HSClient* client, bool state);
 
-static HSClient* create_client() {
+static HSClient* create_client(void) {
     HSClient* hc = g_new0(HSClient, 1);
     hsobject_init(&hc->object);
     hc->window_str = NULL;
@@ -71,7 +71,7 @@ static HSClient* create_client() {
     return hc;
 }
 
-static void fetch_colors() {
+static void fetch_colors(void) {
     g_window_border_width = &(settings_find("window_border_width")->value.i);
     g_window_border_inner_width = &(settings_find("window_border_inner_width")->value.i);
     g_window_gap = &(settings_find("window_gap")->value.i);
@@ -89,7 +89,7 @@ static void fetch_colors() {
     g_pseudotile_center_threshold = &(settings_find("pseudotile_center_threshold")->value.i);
 }
 
-void clientlist_init() {
+void clientlist_init(void) {
     // init regex simple..
     fetch_colors();
     g_wmatom[WMProtocols] = XInternAtom(g_display, "WM_PROTOCOLS", False);
@@ -102,7 +102,7 @@ void clientlist_init() {
                                       NULL, (GDestroyNotify)client_destroy);
 }
 
-void reset_client_colors() {
+void reset_client_colors(void) {
     fetch_colors();
     all_monitors_apply_layout();
 }
@@ -127,7 +127,7 @@ static void client_show_window(void* key, void* client_void, void* data) {
     window_show(client->window);
 }
 
-void clientlist_destroy() {
+void clientlist_destroy(void) {
     // move all clients to their original floating position
     g_hash_table_foreach(g_clients, client_move_to_floatpos, NULL);
     g_hash_table_foreach(g_clients, client_show_window, NULL);
@@ -382,7 +382,7 @@ void window_unfocus(Window window) {
 }
 
 static Window lastfocus = 0;
-void window_unfocus_last() {
+void window_unfocus_last(void) {
     if (lastfocus) {
         window_unfocus(lastfocus);
     }
@@ -887,7 +887,7 @@ void client_update_title(HSClient* client) {
     }
 }
 
-HSClient* get_current_client() {
+HSClient* get_current_client(void) {
     return frame_focused_client(g_cur_frame);
 }
 
@@ -980,7 +980,7 @@ static bool is_client_urgent(void* key, HSClient* client, void* data) {
     return client->urgent;
 }
 
-HSClient* get_urgent_client() {
+HSClient* get_urgent_client(void) {
     return g_hash_table_find(g_clients, (GHRFunc)is_client_urgent, NULL);
 }
 
diff --git a/src/clientlist.h b/src/clientlist.h
index 9f3947d..196ffa4 100644
--- a/src/clientlist.h
+++ b/src/clientlist.h
@@ -46,17 +46,17 @@ typedef struct HSClient {
     struct HSSlice* slice;
 } HSClient;
 
-void clientlist_init();
-void clientlist_destroy();
+void clientlist_init(void);
+void clientlist_destroy(void);
 
 void clientlist_foreach(GHFunc func, gpointer data);
 
 void window_focus(Window window);
 void window_unfocus(Window window);
-void window_unfocus_last();
+void window_unfocus_last(void);
 
-void reset_client_colors();
-void reset_client_settings();
+void reset_client_colors(void);
+void reset_client_settings(void);
 
 // adds a new client to list of managed client windows
 HSClient* manage_client(Window win);
@@ -68,8 +68,8 @@ void window_enforce_last_size(Window in);
 void client_destroy(HSClient* client);
 
 HSClient* get_client_from_window(Window window);
-HSClient* get_current_client();
-HSClient* get_urgent_client();
+HSClient* get_current_client(void);
+HSClient* get_urgent_client(void);
 Rectangle client_outer_floating_rect(HSClient* client);
 
 Window string_to_client(char* str, HSClient** ret_client);
diff --git a/src/ewmh.c b/src/ewmh.c
index 5a818f2..c1104a9 100644
--- a/src/ewmh.c
+++ b/src/ewmh.c
@@ -65,7 +65,7 @@ char* g_netatom_names[NetCOUNT] = {
     [ NetWmWindowTypeNormal         ] = "_NET_WM_WINDOW_TYPE_NORMAL"        ,
 };
 
-void ewmh_init() {
+void ewmh_init(void) {
     /* init globals */
     g_focus_stealing_prevention =
         &(settings_find("focus_stealing_prevention")->value.i);
@@ -108,7 +108,7 @@ void ewmh_init() {
         XA_CARDINAL, 32, PropModeReplace, (unsigned char *) buf, LENGTH(buf));
 }
 
-void ewmh_update_all() {
+void ewmh_update_all(void) {
     /* init many properties */
     ewmh_update_client_list();
     ewmh_update_client_list_stacking();
@@ -117,7 +117,7 @@ void ewmh_update_all() {
     ewmh_update_desktop_names();
 }
 
-void ewmh_destroy() {
+void ewmh_destroy(void) {
     g_free(g_windows);
     if (g_original_clients) {
         XFree(g_original_clients);
@@ -135,11 +135,11 @@ void ewmh_set_wmname(char* name) {
         (unsigned char*)name, strlen(name));
 }
 
-void ewmh_update_wmname() {
+void ewmh_update_wmname(void) {
     ewmh_set_wmname(settings_find("wmname")->value.s);
 }
 
-void ewmh_update_client_list() {
+void ewmh_update_client_list(void) {
     XChangeProperty(g_display, g_root, g_netatom[NetClientList],
         XA_WINDOW, 32, PropModeReplace,
         (unsigned char *) g_windows, g_window_count);
@@ -188,7 +188,7 @@ static void ewmh_add_tag_stack(HSTag* tag, void* data) {
     }
 }
 
-void ewmh_update_client_list_stacking() {
+void ewmh_update_client_list_stacking(void) {
     // First: get the windows in the current stack
     struct ewmhstack stack;
     stack.count = g_window_count;
@@ -232,12 +232,12 @@ void ewmh_remove_client(Window win) {
     ewmh_update_client_list_stacking();
 }
 
-void ewmh_update_desktops() {
+void ewmh_update_desktops(void) {
     XChangeProperty(g_display, g_root, g_netatom[NetNumberOfDesktops],
         XA_CARDINAL, 32, PropModeReplace, (unsigned char*)&(g_tags->len), 1);
 }
 
-void ewmh_update_desktop_names() {
+void ewmh_update_desktop_names(void) {
     char**  names = g_new(char*, g_tags->len);
     for (int i = 0; i < g_tags->len; i++) {
         names[i] = g_array_index(g_tags, HSTag*,i)->name->str;
@@ -250,7 +250,7 @@ void ewmh_update_desktop_names() {
     g_free(names);
 }
 
-void ewmh_update_current_desktop() {
+void ewmh_update_current_desktop(void) {
     HSTag* tag = get_current_monitor()->tag;
     int index = array_find(g_tags->data, g_tags->len, sizeof(HSTag*), &tag);
     if (index < 0) {
diff --git a/src/ewmh.h b/src/ewmh.h
index 013a781..6a7bba5 100644
--- a/src/ewmh.h
+++ b/src/ewmh.h
@@ -63,22 +63,22 @@ Atom g_netatom[NetCOUNT];
 
 extern char* g_netatom_names[];
 
-void ewmh_init();
-void ewmh_destroy();
-void ewmh_update_all();
+void ewmh_init(void);
+void ewmh_destroy(void);
+void ewmh_update_all(void);
 
 void ewmh_add_client(Window win);
 void ewmh_remove_client(Window win);
 void ewmh_set_wmname(char* name);
-void ewmh_update_wmname();
+void ewmh_update_wmname(void);
 
-void ewmh_update_client_list();
+void ewmh_update_client_list(void);
 void ewmh_get_original_client_list(Window** buf, unsigned long *count);
-void ewmh_update_client_list_stacking();
-void ewmh_update_desktops();
-void ewmh_update_desktop_names();
+void ewmh_update_client_list_stacking(void);
+void ewmh_update_desktops(void);
+void ewmh_update_desktop_names(void);
 void ewmh_update_active_window(Window win);
-void ewmh_update_current_desktop();
+void ewmh_update_current_desktop(void);
 void ewmh_update_window_state(struct HSClient* client);
 bool ewmh_is_window_state_set(Window win, Atom hint);
 bool ewmh_is_fullscreen_set(Window win);
diff --git a/src/hook.c b/src/hook.c
index 5f9959a..84ccf31 100644
--- a/src/hook.c
+++ b/src/hook.c
@@ -21,7 +21,7 @@
 
 static Window g_event_window;
 
-void hook_init() {
+void hook_init(void) {
     g_event_window = XCreateSimpleWindow(g_display, g_root, 42, 42, 42, 42, 0, 0, 0);
     // set wm_class for window
     XClassHint *hint = XAllocClassHint();
@@ -36,7 +36,7 @@ void hook_init() {
         XA_ATOM, 32, PropModeReplace, (unsigned char*)&g_event_window, 1);
 }
 
-void hook_destroy() {
+void hook_destroy(void) {
     // remove property from root window
     XDeleteProperty(g_display, g_root, ATOM(HERBST_HOOK_WIN_ID_ATOM));
     XDestroyWindow(g_display, g_event_window);
diff --git a/src/hook.h b/src/hook.h
index 16c947f..bb66479 100644
--- a/src/hook.h
+++ b/src/hook.h
@@ -8,8 +8,8 @@
 
 #include "layout.h"
 
-void hook_init();
-void hook_destroy();
+void hook_init(void);
+void hook_destroy(void);
 
 void hook_emit(int argc, char** argv);
 void emit_tag_changed(HSTag* tag, int monitor);
diff --git a/src/ipc-server.c b/src/ipc-server.c
index 58fc62f..430cc78 100644
--- a/src/ipc-server.c
+++ b/src/ipc-server.c
@@ -20,10 +20,10 @@
 
 // public callable functions
 //
-void ipc_init() {
+void ipc_init(void) {
 }
 
-void ipc_destroy() {
+void ipc_destroy(void) {
 }
 
 void ipc_add_connection(Window window) {
diff --git a/src/ipc-server.h b/src/ipc-server.h
index 11de995..53d6851 100644
--- a/src/ipc-server.h
+++ b/src/ipc-server.h
@@ -9,8 +9,8 @@
 #include <X11/Xlib.h>
 #include <stdbool.h>
 
-void ipc_init();
-void ipc_destroy();
+void ipc_init(void);
+void ipc_destroy(void);
 
 void ipc_add_connection(Window win);
 // returns true if property was received successfully
diff --git a/src/key.c b/src/key.c
index d6a0c22..3e1d452 100644
--- a/src/key.c
+++ b/src/key.c
@@ -18,21 +18,21 @@
 static unsigned int numlockmask = 0;
 #define CLEANMASK(mask)         (mask & ~(numlockmask|LockMask))
 
-unsigned int* get_numlockmask_ptr() {
+unsigned int* get_numlockmask_ptr(void) {
     return &numlockmask;
 }
 
 GList* g_key_binds = NULL;
 
-void key_init() {
+void key_init(void) {
     update_numlockmask();
 }
 
-void key_destroy() {
+void key_destroy(void) {
     key_remove_all_binds();
 }
 
-void key_remove_all_binds() {
+void key_remove_all_binds(void) {
     g_list_free_full(g_key_binds, (GDestroyNotify)keybinding_free);
     g_key_binds = NULL;
     regrab_keys();
@@ -219,7 +219,7 @@ bool key_remove_bind_with_keysym(unsigned int modifiers, KeySym keysym){
     return true;
 }
 
-void regrab_keys() {
+void regrab_keys(void) {
     update_numlockmask();
     // init modifiers after updating numlockmask
     XUngrabKey(g_display, AnyKey, AnyModifier, g_root); // remove all current grabs
@@ -242,7 +242,7 @@ void grab_keybind(KeyBinding* binding, void* useless_pointer) {
 
 // update the numlockmask
 // from dwm.c
-void update_numlockmask() {
+void update_numlockmask(void) {
     unsigned int i, j;
     XModifierKeymap *modmap;
 
diff --git a/src/key.h b/src/key.h
index e99004d..275ea26 100644
--- a/src/key.h
+++ b/src/key.h
@@ -31,21 +31,21 @@ void keybinding_free(KeyBinding* binding);
 int key_list_binds(int argc, char** argv, GString* output);
 int list_keysyms(int argc, char** argv, GString* output);
 bool key_remove_bind_with_keysym(unsigned int modifiers, KeySym sym);
-void key_remove_all_binds();
+void key_remove_all_binds(void);
 GString* keybinding_to_g_string(KeyBinding* binding);
 void key_find_binds(char* needle, GString* output);
 void complete_against_modifiers(char* needle, char seperator,
                                 char* prefix, GString* output);
 void complete_against_keysyms(char* needle, char* prefix, GString* output);
-void regrab_keys();
+void regrab_keys(void);
 void grab_keybind(KeyBinding* binding, void* useless_pointer);
-void update_numlockmask();
-unsigned int* get_numlockmask_ptr();
+void update_numlockmask(void);
+unsigned int* get_numlockmask_ptr(void);
 
 void handle_key_press(XEvent* ev);
 
-void key_init();
-void key_destroy();
+void key_init(void);
+void key_destroy(void);
 
 #endif
 
diff --git a/src/layout.c b/src/layout.c
index 2853379..c7e8ffe 100644
--- a/src/layout.c
+++ b/src/layout.c
@@ -64,7 +64,7 @@ char* g_layout_names[] = {
     NULL,
 };
 
-static void fetch_frame_colors() {
+static void fetch_frame_colors(void) {
     // load settings
     g_frame_gap = &(settings_find("frame_gap")->value.i);
     g_frame_padding = &(settings_find("frame_padding")->value.i);
@@ -104,15 +104,15 @@ static void fetch_frame_colors() {
     }
 }
 
-void layout_init() {
+void layout_init(void) {
     fetch_frame_colors();
 }
-void reset_frame_colors() {
+void reset_frame_colors(void) {
     fetch_frame_colors();
     all_monitors_apply_layout();
 }
 
-void layout_destroy() {
+void layout_destroy(void) {
 }
 
 
@@ -912,7 +912,7 @@ HSFrame* frame_current_selection_below(HSFrame* frame) {
     return frame;
 }
 
-HSFrame* frame_current_selection() {
+HSFrame* frame_current_selection(void) {
     HSMonitor* m = get_current_monitor();
     if (!m->tag) return NULL;
     return frame_current_selection_below(m->tag->frame);
@@ -1599,7 +1599,7 @@ int frame_move_window_command(int argc, char** argv, GString* output) {
     return 0;
 }
 
-void frame_unfocus() {
+void frame_unfocus(void) {
     //XSetInputFocus(g_display, g_root, RevertToPointerRoot, CurrentTime);
 }
 
@@ -1817,7 +1817,7 @@ static void frame_rotate(HSFrame* frame) {
     }
 }
 
-int layout_rotate_command() {
+int layout_rotate_command(int argc, char** argv) {
     frame_do_recursive(get_current_monitor()->tag->frame, frame_rotate, -1);
     monitor_apply_layout(get_current_monitor());
     return 0;
diff --git a/src/layout.h b/src/layout.h
index 97a4fd8..964a646 100644
--- a/src/layout.h
+++ b/src/layout.h
@@ -97,13 +97,13 @@ int* g_frame_gap;
 int* g_window_gap;
 
 // functions
-void layout_init();
-void layout_destroy();
+void layout_init(void);
+void layout_destroy(void);
 // for frames
 HSFrame* frame_create_empty(HSFrame* parent, HSTag* parenttag);
 void frame_insert_client(HSFrame* frame, struct HSClient* client);
 HSFrame* lookup_frame(HSFrame* root, char* path);
-HSFrame* frame_current_selection();
+HSFrame* frame_current_selection(void);
 HSFrame* frame_current_selection_below(HSFrame* frame);
 // finds the subframe of frame that contains the window
 HSFrame* find_frame_with_client(HSFrame* frame, struct HSClient* client);
@@ -121,7 +121,7 @@ int frame_change_fraction_command(int argc, char** argv, GString* output);
 void frame_apply_layout(HSFrame* frame, Rectangle rect);
 void frame_apply_floating_layout(HSFrame* frame, struct HSMonitor* m);
 void frame_update_frame_window_visibility(HSFrame* frame);
-void reset_frame_colors();
+void reset_frame_colors(void);
 HSFrame* get_toplevel_frame(HSFrame* frame);
 
 void print_frame_tree(HSFrame* frame, GString* output);
@@ -140,7 +140,7 @@ int cycle_all_command(int argc, char** argv);
 int cycle_frame_command(int argc, char** argv);
 void cycle_frame(int direction, int new_window_index, bool skip_invisible);
 
-void frame_unfocus(); // unfocus currently focused window
+void frame_unfocus(void); // unfocus currently focused window
 
 // get neighbour in a specific direction 'l' 'r' 'u' 'd' (left, right,...)
 // returns the neighbour or NULL if there is no one
@@ -155,7 +155,7 @@ void frame_do_recursive_data(HSFrame* frame, void (*action)(HSFrame*,void*),
                              int order, void* data);
 void frame_hide_recursive(HSFrame* frame);
 void frame_show_recursive(HSFrame* frame);
-int layout_rotate_command();
+int layout_rotate_command(int argc, char** argv);
 // do an action for each client in frame tree
 // returns success or failure
 int frame_foreach_client(HSFrame* frame, ClientAction action, void* data);
diff --git a/src/main.c b/src/main.c
index 22fc4c9..5d93bf3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -49,16 +49,16 @@ static int*     g_raise_on_click = NULL;
 
 typedef void (*HandlerTable[LASTEvent]) (XEvent*);
 
-int quit();
-int reload();
+int quit(int argc, char* argv[]);
+int reload(int argc, char* argv[]);
 int version(int argc, char* argv[], GString* output);
 int echo(int argc, char* argv[], GString* output);
-int true_command();
-int false_command();
+int true_command(int argc, char* argv[]);
+int false_command(int argc, char* argv[]);
 int print_layout_command(int argc, char** argv, GString* output);
 int load_command(int argc, char** argv, GString* output);
 int print_tag_status_command(int argc, char** argv, GString* output);
-void execute_autostart_file();
+void execute_autostart_file(void);
 int raise_command(int argc, char** argv, GString* output);
 int spawn(int argc, char** argv);
 int wmexec(int argc, char** argv);
@@ -187,13 +187,13 @@ CommandBinding g_commands[] = {
 };
 
 // core functions
-int quit() {
+int quit(int argc, char* argv[]) {
     g_aboutToQuit = true;
     return 0;
 }
 
 // reload config
-int reload() {
+int reload(int argc, char* argv[]) {
     execute_autostart_file();
     return 0;
 }
@@ -218,11 +218,11 @@ int echo(int argc, char* argv[], GString* output) {
     return 0;
 }
 
-int true_command() {
+int true_command(int argc, char* argv[]) {
     return 0;
 }
 
-int false_command() {
+int false_command(int argc, char* argv[]) {
     return 1;
 }
 
@@ -600,7 +600,7 @@ void scan(void) {
     }
 }
 
-void execute_autostart_file() {
+void execute_autostart_file(void) {
     GString* path = NULL;
     if (g_autostart_path) {
         path = g_string_new(g_autostart_path);
@@ -695,7 +695,7 @@ static void sigaction_signal(int signum, void (*handler)(int)) {
     sigaction(signum, &act, NULL);
 }
 
-static void fetch_settings() {
+static void fetch_settings(void) {
     // fetch settings only for this main.c file from settings table
     g_focus_follows_mouse = &(settings_find("focus_follows_mouse")->value.i);
     g_raise_on_click = &(settings_find("raise_on_click")->value.i);
@@ -722,8 +722,8 @@ static HandlerTable g_default_handler = {
 };
 
 static struct {
-    void (*init)();
-    void (*destroy)();
+    void (*init)(void);
+    void (*destroy)(void);
 } g_modules[] = {
     { ipc_init,         ipc_destroy         },
     { object_tree_init, object_tree_destroy },
diff --git a/src/monitor.c b/src/monitor.c
index cb4d4c0..a3f9cd0 100644
--- a/src/monitor.c
+++ b/src/monitor.c
@@ -41,7 +41,7 @@ typedef struct RectList {
 
 static RectList* reclist_insert_disjoint(RectList* head, RectList* mt);
 
-void monitor_init() {
+void monitor_init(void) {
     g_monitors_locked = &(settings_find("monitors_locked")->value.i);
     g_cur_monitor = 0;
     g_monitors = g_array_new(false, false, sizeof(HSMonitor*));
@@ -53,7 +53,7 @@ void monitor_init() {
     g_monitor_by_name_object = hsobject_create_and_link(g_monitor_object, "by-name");
 }
 
-void monitor_destroy() {
+void monitor_destroy(void) {
     for (int i = 0; i < g_monitors->len; i++) {
         HSMonitor* m = monitor_with_index(i);
         stack_remove_slice(g_monitor_stack, m->slice);
@@ -710,7 +710,7 @@ HSMonitor* find_monitor_with_tag(HSTag* tag) {
     return NULL;
 }
 
-void ensure_monitors_are_available() {
+void ensure_monitors_are_available(void) {
     if (g_monitors->len > 0) {
         // nothing to do
         return;
@@ -739,15 +739,15 @@ HSMonitor* monitor_with_frame(HSFrame* frame) {
     return find_monitor_with_tag(tag);
 }
 
-HSMonitor* get_current_monitor() {
+HSMonitor* get_current_monitor(void) {
     return g_array_index(g_monitors, HSMonitor*, g_cur_monitor);
 }
 
-int monitor_count() {
+int monitor_count(void) {
     return g_monitors->len;
 }
 
-void all_monitors_apply_layout() {
+void all_monitors_apply_layout(void) {
     monitor_foreach(monitor_apply_layout);
 }
 
@@ -994,7 +994,7 @@ void monitor_focus_by_index(int new_selection) {
     emit_tag_changed(monitor->tag, new_selection);
 }
 
-void monitor_update_focus_objects() {
+void monitor_update_focus_objects(void) {
     hsobject_link(g_monitor_object, &get_current_monitor()->object, "focus");
     tag_update_focus_objects();
 }
@@ -1033,7 +1033,7 @@ int monitors_lock_command(int argc, char** argv) {
     return 0;
 }
 
-void monitors_lock() {
+void monitors_lock(void) {
     // lock-number must never be negative
     // ensure that lock value is valid
     if (*g_monitors_locked < 0) {
@@ -1049,7 +1049,7 @@ int monitors_unlock_command(int argc, char** argv) {
     return 0;
 }
 
-void monitors_unlock() {
+void monitors_unlock(void) {
     // lock-number must never be lower than 1 if unlocking
     // so: ensure that lock value is valid
     if (*g_monitors_locked < 1) {
@@ -1060,7 +1060,7 @@ void monitors_unlock() {
     monitors_lock_changed();
 }
 
-void monitors_lock_changed() {
+void monitors_lock_changed(void) {
     if (*g_monitors_locked < 0) {
         *g_monitors_locked = 0;
         HSDebug("fixing invalid monitors_locked value to 0\n");
@@ -1210,7 +1210,7 @@ void monitor_stack_to_window_buf(Window* buf, int len, bool only_clients,
     stack_to_window_buf(g_monitor_stack, buf, len, only_clients, remain_len);
 }
 
-HSStack* get_monitor_stack() {
+HSStack* get_monitor_stack(void) {
     return g_monitor_stack;
 }
 
@@ -1275,7 +1275,7 @@ void all_monitors_replace_previous_tag(HSTag *old, HSTag *new) {
     }
 }
 
-void drop_enternotify_events() {
+void drop_enternotify_events(void) {
     XEvent ev;
     XSync(g_display, False);
     while(XCheckMaskEvent(g_display, EnterWindowMask, &ev));
diff --git a/src/monitor.h b/src/monitor.h
index 0cec4e5..f2fd4b6 100644
--- a/src/monitor.h
+++ b/src/monitor.h
@@ -47,8 +47,8 @@ typedef struct HSMonitor {
 // globals
 int         g_cur_monitor;
 
-void monitor_init();
-void monitor_destroy();
+void monitor_init(void);
+void monitor_destroy(void);
 
 // adds a new monitor to g_monitors and returns a pointer to it
 HSMonitor* monitor_with_frame(struct HSFrame* frame);
@@ -78,34 +78,34 @@ int set_monitor_rects(Rectangle* templates, size_t count);
 int move_monitor_command(int argc, char** argv, GString* output);
 int rename_monitor_command(int argc, char** argv, GString* output);
 int monitor_rect_command(int argc, char** argv, GString* output);
-HSMonitor* get_current_monitor();
-int monitor_count();
+HSMonitor* get_current_monitor(void);
+int monitor_count(void);
 int monitor_set_tag(HSMonitor* monitor, struct HSTag* tag);
 int monitor_set_pad_command(int argc, char** argv, GString* output);
 int monitor_set_tag_command(int argc, char** argv, GString* output);
 int monitor_set_tag_by_index_command(int argc, char** argv, GString* output);
 int monitor_set_previous_tag_command(int argc, char** argv, GString* output);
-void monitors_lock();
-void monitors_unlock();
+void monitors_lock(void);
+void monitors_unlock(void);
 int monitors_lock_command(int argc, char** argv);
 int monitors_unlock_command(int argc, char** argv);
-void monitors_lock_changed();
+void monitors_lock_changed(void);
 int monitor_lock_tag_command(int argc, char** argv, GString* output);
 int monitor_unlock_tag_command(int argc, char** argv, GString* output);
 void monitor_apply_layout(HSMonitor* monitor);
-void all_monitors_apply_layout();
-void ensure_monitors_are_available();
+void all_monitors_apply_layout(void);
+void ensure_monitors_are_available(void);
 void all_monitors_replace_previous_tag(struct HSTag* old, struct HSTag* new);
 
-void drop_enternotify_events();
+void drop_enternotify_events(void);
 
 void monitor_restack(HSMonitor* monitor);
 int monitor_stack_window_count(bool only_clients);
 void monitor_stack_to_window_buf(Window* buf, int len, bool only_clients,
                                  int* remain_len);
-struct HSStack* get_monitor_stack();
+struct HSStack* get_monitor_stack(void);
 
-void monitor_update_focus_objects();
+void monitor_update_focus_objects(void);
 
 typedef bool (*MonitorDetection)(Rectangle**, size_t*);
 bool detect_monitors_xinerama(Rectangle** ret_rects, size_t* ret_count);
diff --git a/src/mouse.c b/src/mouse.c
index 15f07ea..620032c 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -44,7 +44,7 @@ static int* g_snap_gap;
      | Button4Mask \
      | Button5Mask ))
 
-void mouse_init() {
+void mouse_init(void) {
     g_numlockmask_ptr = get_numlockmask_ptr();
     g_snap_distance = &(settings_find("snap_distance")->value.i);
     g_snap_gap = &(settings_find("snap_gap")->value.i);
@@ -53,8 +53,8 @@ void mouse_init() {
     XDefineCursor(g_display, g_root, g_cursor);
 }
 
-void mouse_destroy() {
-    mouse_unbind_all();
+void mouse_destroy(void) {
+    mouse_unbind_all(0, NULL);
     XFreeCursor(g_display, g_cursor);
 }
 
@@ -86,7 +86,7 @@ void mouse_start_drag(XEvent* ev) {
             GrabModeAsync, None, None, CurrentTime);
 }
 
-void mouse_stop_drag() {
+void mouse_stop_drag(void) {
     if (g_win_drag_client) {
         g_win_drag_client->dragged = false;
         // resend last size
@@ -119,7 +119,7 @@ void handle_motion_event(XEvent* ev) {
     function(&(ev->xmotion));
 }
 
-bool mouse_is_dragging() {
+bool mouse_is_dragging(void) {
     return g_drag_bind != NULL;
 }
 
@@ -136,7 +136,7 @@ void mouse_bind_function(unsigned int modifiers, unsigned int button,
     }
 }
 
-int mouse_unbind_all() {
+int mouse_unbind_all(int argc, char** argv) {
     g_list_free_full(g_mouse_binds, g_free);
     g_mouse_binds = NULL;
     HSClient* client = get_current_client();
diff --git a/src/mouse.h b/src/mouse.h
index 0c7cf5c..ce037e5 100644
--- a/src/mouse.h
+++ b/src/mouse.h
@@ -25,8 +25,8 @@ enum SnapFlags {
 struct HSClient;
 struct HSTag;
 
-void mouse_init();
-void mouse_destroy();
+void mouse_init(void);
+void mouse_destroy(void);
 
 typedef void (*MouseFunction)(XMotionEvent*);
 
@@ -41,7 +41,7 @@ int mouse_binding_equals(MouseBinding* a, MouseBinding* b);
 void mouse_bind_function(unsigned int modifiers, unsigned int button,
                          MouseFunction function);
 int mouse_bind_command(int argc, char** argv, GString* output);
-int mouse_unbind_all();
+int mouse_unbind_all(int argc, char** argv);
 MouseBinding* mouse_binding_find(unsigned int modifiers, unsigned int button);
 
 unsigned int string2button(char* name);
@@ -50,8 +50,8 @@ MouseFunction string2mousefunction(char* name);
 void grab_client_buttons(struct HSClient* client, bool focused);
 
 void mouse_start_drag(XEvent* ev);
-void mouse_stop_drag();
-bool mouse_is_dragging();
+void mouse_stop_drag(void);
+bool mouse_is_dragging(void);
 void handle_motion_event(XEvent* ev);
 
 // get the vector to snap a client to it's neighbour
diff --git a/src/object.c b/src/object.c
index cb08f1c..478e106 100644
--- a/src/object.c
+++ b/src/object.c
@@ -25,18 +25,18 @@ static void hsattribute_free(HSAttribute* attr);
 static HSObject g_root_object;
 static HSObject* g_tmp_object;
 
-void object_tree_init() {
+void object_tree_init(void) {
     hsobject_init(&g_root_object);
     g_tmp_object = hsobject_create_and_link(&g_root_object, TMP_OBJECT_PATH);
 
 }
 
-void object_tree_destroy() {
+void object_tree_destroy(void) {
     hsobject_unlink_and_destroy(&g_root_object, g_tmp_object);
     hsobject_free(&g_root_object);
 }
 
-HSObject* hsobject_root() {
+HSObject* hsobject_root(void) {
     return &g_root_object;
 }
 
@@ -65,7 +65,7 @@ static void hsattribute_free(HSAttribute* attr) {
     }
 }
 
-HSObject* hsobject_create() {
+HSObject* hsobject_create(void) {
     HSObject* obj = g_new(HSObject, 1);
     hsobject_init(obj);
     return obj;
diff --git a/src/object.h b/src/object.h
index f421ef6..bc1d261 100644
--- a/src/object.h
+++ b/src/object.h
@@ -82,14 +82,14 @@ typedef struct HSAttribute {
 
 #define ATTRIBUTE_LAST { .name = NULL }
 
-void object_tree_init();
-void object_tree_destroy();
+void object_tree_init(void);
+void object_tree_destroy(void);
 
-HSObject* hsobject_root();
+HSObject* hsobject_root(void);
 
 bool hsobject_init(HSObject* obj);
 void hsobject_free(HSObject* obj);
-HSObject* hsobject_create();
+HSObject* hsobject_create(void);
 HSObject* hsobject_create_and_link(HSObject* parent, char* name);
 void hsobject_destroy(HSObject* obj);
 void hsobject_link(HSObject* parent, HSObject* child, char* name);
diff --git a/src/rules.c b/src/rules.c
index f4da9fb..ee4632c 100644
--- a/src/rules.c
+++ b/src/rules.c
@@ -97,12 +97,12 @@ static GQueue g_rules = G_QUEUE_INIT; // a list of HSRule* elements
 
 /// FUNCTIONS ///
 // RULES //
-void rules_init() {
+void rules_init(void) {
     g_maxage_type = find_condition_type("maxage");
     g_rule_label_index = 0;
 }
 
-void rules_destroy() {
+void rules_destroy(void) {
     g_queue_foreach(&g_rules, (GFunc)rule_destroy, NULL);
     g_queue_clear(&g_rules);
 }
@@ -258,7 +258,7 @@ static bool rule_label_replace(HSRule* rule, char op, char* value, GString* outp
 
 // rules parsing //
 
-HSRule* rule_create() {
+HSRule* rule_create(void) {
     HSRule* rule = g_new0(HSRule, 1);
     rule->once = false;
     rule->birth_time = get_monotonic_timestamp();
diff --git a/src/rules.h b/src/rules.h
index 5cdf739..a52a9ad 100644
--- a/src/rules.h
+++ b/src/rules.h
@@ -65,14 +65,14 @@ typedef struct {
     bool            ewmhnotify; // whether to send ewmh-notifications
 } HSClientChanges;
 
-void rules_init();
-void rules_destroy();
+void rules_init(void);
+void rules_destroy(void);
 void rules_apply(struct HSClient* client, HSClientChanges* changes);
 
 void client_changes_init(HSClientChanges* changes, struct HSClient* client);
 void client_changes_free_members(HSClientChanges* changes);
 
-HSRule* rule_create();
+HSRule* rule_create(void);
 void rule_destroy(HSRule* rule);
 
 void rule_complete(int argc, char** argv, int pos, GString* output);
diff --git a/src/settings.c b/src/settings.c
index 1017202..108a041 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -83,11 +83,11 @@ SettingsPair g_settings[] = {
 
 int             g_initial_monitors_locked = 0;
 
-int settings_count() {
+int settings_count(void) {
     return LENGTH(g_settings);
 }
 
-void settings_init() {
+void settings_init(void) {
     // recreate all strings -> move them to heap
     int i;
     for (i = 0; i < LENGTH(g_settings); i++) {
@@ -101,7 +101,7 @@ void settings_init() {
     settings_find("monitors_locked")->value.i = g_initial_monitors_locked;
 }
 
-void settings_destroy() {
+void settings_destroy(void) {
     // free all strings
     int i;
     for (i = 0; i < LENGTH(g_settings); i++) {
diff --git a/src/settings.h b/src/settings.h
index d2e2776..4cea157 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -21,14 +21,14 @@ typedef struct {
     }   value;
     int old_value_i;
     int type;
-    void (*on_change)(); // what to call on change
+    void (*on_change)(void); // what to call on change
 } SettingsPair;
 
 extern SettingsPair g_settings[];
 int g_initial_monitors_locked;
 
-void settings_init();
-void settings_destroy();
+void settings_init(void);
+void settings_destroy(void);
 
 SettingsPair* settings_find(char* name);
 
@@ -36,7 +36,7 @@ int settings_set(SettingsPair* pair, char* value);
 int settings_set_command(int argc, char** argv, GString* output);
 int settings_toggle(int argc, char** argv, GString* output);
 int settings_cycle_value(int argc, char** argv, GString* output);
-int settings_count();
+int settings_count(void);
 int settings_get(int argc, char** argv, GString* output);
 
 #endif
diff --git a/src/stack.c b/src/stack.c
index 5ca8e61..d44e1ca 100644
--- a/src/stack.c
+++ b/src/stack.c
@@ -20,14 +20,14 @@ char* g_layer_names[LAYER_COUNT] = {
     [ LAYER_FRAMES      ] = "Frame Layer"           ,
 };
 
-void stacklist_init() {
+void stacklist_init(void) {
 }
 
-void stacklist_destroy() {
+void stacklist_destroy(void) {
 }
 
 
-HSStack* stack_create() {
+HSStack* stack_create(void) {
     return g_new0(HSStack, 1);
 }
 
@@ -41,7 +41,7 @@ void stack_destroy(HSStack* s) {
     g_free(s);
 }
 
-static HSSlice* slice_create() {
+static HSSlice* slice_create(void) {
     HSSlice* s = g_new0(HSSlice, 1);
     s->layer[0] = LAYER_NORMAL;
     s->layer_count = 1;
diff --git a/src/stack.h b/src/stack.h
index fca3168..fb2cf60 100644
--- a/src/stack.h
+++ b/src/stack.h
@@ -47,8 +47,8 @@ typedef struct HSStack {
     bool    dirty;  /* stacking order changed but it wasn't restacked yet */
 } HSStack;
 
-void stacklist_init();
-void stacklist_destroy();
+void stacklist_init(void);
+void stacklist_destroy(void);
 
 HSSlice* slice_create_window(Window window);
 HSSlice* slice_create_frame(Window window);
@@ -75,7 +75,7 @@ void stack_to_window_buf(HSStack* stack, Window* buf, int len, bool only_clients
 void stack_restack(HSStack* stack);
 Window stack_lowest_window(HSStack* stack);
 
-HSStack* stack_create();
+HSStack* stack_create(void);
 void stack_destroy(HSStack* s);
 
 #endif
diff --git a/src/tag.c b/src/tag.c
index 134c36f..2b835bc 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -27,7 +27,7 @@ int* g_raise_on_focus_temporarily;
 
 static int tag_rename(HSTag* tag, char* name, GString* output);
 
-void tag_init() {
+void tag_init(void) {
     g_tags = g_array_new(false, false, sizeof(HSTag*));
     g_raise_on_focus_temporarily = &(settings_find("raise_on_focus_temporarily")
                                      ->value.i);
@@ -56,7 +56,7 @@ static void tag_free(HSTag* tag) {
     g_free(tag);
 }
 
-void tag_destroy() {
+void tag_destroy(void) {
     int i;
     for (i = 0; i < g_tags->len; i++) {
         HSTag* tag = g_array_index(g_tags, HSTag*, i);
@@ -127,7 +127,7 @@ HSTag* get_tag_by_index_str(char* index_str, bool skip_visible_tags) {
     return g_array_index(g_tags, HSTag*, index);
 }
 
-HSTag* find_unused_tag() {
+HSTag* find_unused_tag(void) {
     for (int i = 0; i < g_tags->len; i++) {
         if (!find_monitor_with_tag(g_array_index(g_tags, HSTag*, i))) {
             return g_array_index(g_tags, HSTag*, i);
@@ -391,7 +391,7 @@ static void client_update_tag_flags(void* key, void* client_void, void* data) {
     }
 }
 
-void tag_force_update_flags() {
+void tag_force_update_flags(void) {
     g_tag_flags_dirty = false;
     // unset all tags
     for (int i = 0; i < g_tags->len; i++) {
@@ -401,18 +401,18 @@ void tag_force_update_flags() {
     clientlist_foreach(client_update_tag_flags, NULL);
 }
 
-void tag_update_flags() {
+void tag_update_flags(void) {
     if (g_tag_flags_dirty) {
         tag_force_update_flags();
     }
 }
 
-void tag_set_flags_dirty() {
+void tag_set_flags_dirty(void) {
     g_tag_flags_dirty = true;
     hook_emit_list("tag_flags", NULL);
 }
 
-void ensure_tags_are_available() {
+void ensure_tags_are_available(void) {
     if (g_tags->len > 0) {
         // nothing to do
         return;
@@ -539,11 +539,11 @@ static void tag_update_focus_layer_helper(HSTag* tag, void* data) {
     (void) data;
     tag_update_focus_layer(tag);
 }
-void tag_update_each_focus_layer() {
+void tag_update_each_focus_layer(void) {
     tag_foreach(tag_update_focus_layer_helper, NULL);
 }
 
-void tag_update_focus_objects() {
+void tag_update_focus_objects(void) {
     hsobject_link(g_tag_object, get_current_monitor()->tag->object, "focus");
 }
 
diff --git a/src/tag.h b/src/tag.h
index cef1d93..0c47dbf 100644
--- a/src/tag.h
+++ b/src/tag.h
@@ -27,14 +27,14 @@ typedef struct HSTag {
 GArray*     g_tags; // Array of HSTag*
 bool        g_tag_flags_dirty;
 
-void tag_init();
-void tag_destroy();
+void tag_init(void);
+void tag_destroy(void);
 
 // for tags
 HSTag* add_tag(char* name);
 HSTag* find_tag(char* name);
 int    tag_index_of(HSTag* tag);
-HSTag* find_unused_tag();
+HSTag* find_unused_tag(void);
 HSTag* find_tag_with_toplevel_frame(struct HSFrame* frame);
 HSTag* get_tag_by_index(int index);
 HSTag* get_tag_by_index_str(char* index_str, bool skip_visible_tags);
@@ -48,12 +48,12 @@ int tag_remove_command(int argc, char** argv, GString* output);
 int tag_set_floating_command(int argc, char** argv, GString* output);
 void tag_update_focus_layer(HSTag* tag);
 void tag_foreach(void (*action)(HSTag*,void*), void* data);
-void tag_update_each_focus_layer();
-void tag_update_focus_objects();
-void tag_force_update_flags();
-void tag_update_flags();
-void tag_set_flags_dirty();
-void ensure_tags_are_available();
+void tag_update_each_focus_layer(void);
+void tag_update_focus_objects(void);
+void tag_force_update_flags(void);
+void tag_update_flags(void);
+void tag_set_flags_dirty(void);
+void ensure_tags_are_available(void);
 
 #endif
 
diff --git a/src/utils.c b/src/utils.c
index b885784..5f7e3d7 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -27,7 +27,7 @@
 
 char*   g_tree_style; /* the one from layout.c */
 
-time_t get_monotonic_timestamp() {
+time_t get_monotonic_timestamp(void) {
     struct timespec ts;
 #if defined(__MACH__) && ! defined(CLOCK_REALTIME) // OS X does not have clock_gettime, use clock_get_time
     clock_serv_t cclock;
diff --git a/src/utils.h b/src/utils.h
index 7cfe7ce..b07bd28 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -58,7 +58,7 @@ bool string_to_bool(char* string, bool oldvalue);
 
 char* strlasttoken(char* str, char* delim);
 
-time_t get_monotonic_timestamp();
+time_t get_monotonic_timestamp(void);
 
 // duplicates an argument-vector
 char** argv_duplicate(int argc, char** argv);
-- 
1.8.5.3

-- 
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://listi.jpberlin.de/pipermail/hlwm/attachments/20140201/3ac407c3/attachment.asc>


More information about the hlwm mailing list