Fix 'gcc -Wextra -Wno-unused-parameter'.

This commit is contained in:
Peter Boström 2014-01-04 13:18:38 +01:00 committed by Michael Stapelberg
parent 2314f10778
commit f78c1ba053
10 changed files with 21 additions and 13 deletions

View File

@ -453,7 +453,7 @@ static char *resolve_tilde(const char *path) {
char *head, *tail, *result; char *head, *tail, *result;
tail = strchr(path, '/'); tail = strchr(path, '/');
head = strndup(path, tail ? tail - path : strlen(path)); head = strndup(path, tail ? (size_t)(tail - path) : strlen(path));
int res = glob(head, GLOB_TILDE, NULL, &globbuf); int res = glob(head, GLOB_TILDE, NULL, &globbuf);
free(head); free(head);

View File

@ -467,7 +467,8 @@ int main(int argc, char *argv[]) {
uint32_t top_end_x; uint32_t top_end_x;
uint32_t bottom_start_x; uint32_t bottom_start_x;
uint32_t bottom_end_x; uint32_t bottom_end_x;
} __attribute__((__packed__)) strut_partial = {}; } __attribute__((__packed__)) strut_partial;
memset(&strut_partial, 0, sizeof(strut_partial));
strut_partial.top = font.height + 6; strut_partial.top = font.height + 6;
strut_partial.top_start_x = 0; strut_partial.top_start_x = 0;

View File

@ -17,6 +17,9 @@ typedef enum {
POS_BOT POS_BOT
} position_t; } position_t;
/* Bar display mode (hide unless modifier is pressed or show in dock mode or always hide in invisible mode) */
typedef enum { M_DOCK = 0, M_HIDE = 1, M_INVISIBLE = 2 } bar_display_mode_t;
typedef struct config_t { typedef struct config_t {
int modifier; int modifier;
position_t position; position_t position;
@ -31,8 +34,7 @@ typedef struct config_t {
int num_outputs; int num_outputs;
char **outputs; char **outputs;
/* Bar display mode (hide unless modifier is pressed or show in dock mode or always hide in invisible mode) */ bar_display_mode_t hide_on_modifier;
enum { M_DOCK = 0, M_HIDE = 1, M_INVISIBLE = 2 } hide_on_modifier;
/* The current hidden_state of the bar, which indicates whether it is hidden or shown */ /* The current hidden_state of the bar, which indicates whether it is hidden or shown */
enum { S_HIDE = 0, S_SHOW = 1 } hidden_state; enum { S_HIDE = 0, S_SHOW = 1 } hidden_state;

View File

@ -28,7 +28,7 @@
#include "common.h" #include "common.h"
/* Global variables for child_*() */ /* Global variables for child_*() */
i3bar_child child = {}; i3bar_child child;
/* stdin- and sigchild-watchers */ /* stdin- and sigchild-watchers */
ev_io *stdin_io; ev_io *stdin_io;

View File

@ -161,7 +161,7 @@ void got_bar_config_update(char *event) {
/* update the configuration with the received settings */ /* update the configuration with the received settings */
DLOG("Received bar config update \"%s\"\n", event); DLOG("Received bar config update \"%s\"\n", event);
int old_mode = config.hide_on_modifier; bar_display_mode_t old_mode = config.hide_on_modifier;
parse_config_json(event); parse_config_json(event);
if (old_mode != config.hide_on_modifier) { if (old_mode != config.hide_on_modifier) {
reconfig_windows(true); reconfig_windows(true);

View File

@ -1524,7 +1524,9 @@ void reconfig_windows(bool redraw_bars) {
uint32_t top_end_x; uint32_t top_end_x;
uint32_t bottom_start_x; uint32_t bottom_start_x;
uint32_t bottom_end_x; uint32_t bottom_end_x;
} __attribute__((__packed__)) strut_partial = {}; } __attribute__((__packed__)) strut_partial;
memset(&strut_partial, 0, sizeof(strut_partial));
switch (config.position) { switch (config.position) {
case POS_NONE: case POS_NONE:
break; break;

View File

@ -80,7 +80,7 @@ Con *con_parent_with_orientation(Con *con, orientation_t orientation);
* Returns the first fullscreen node below this node. * Returns the first fullscreen node below this node.
* *
*/ */
Con *con_get_fullscreen_con(Con *con, int fullscreen_mode); Con *con_get_fullscreen_con(Con *con, fullscreen_mode_t fullscreen_mode);
/** /**
* Returns true if the container is internal, such as __i3_scratch * Returns true if the container is internal, such as __i3_scratch
@ -192,7 +192,7 @@ void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool
* container). * container).
* *
*/ */
int con_orientation(Con *con); orientation_t con_orientation(Con *con);
/** /**
* Returns the container which will be focused next when the given container * Returns the container which will be focused next when the given container

View File

@ -449,6 +449,9 @@ struct Assignment {
TAILQ_ENTRY(Assignment) assignments; TAILQ_ENTRY(Assignment) assignments;
}; };
/** Fullscreen modes. Used by Con.fullscreen_mode. */
typedef enum { CF_NONE = 0, CF_OUTPUT = 1, CF_GLOBAL = 2 } fullscreen_mode_t;
/** /**
* A 'Con' represents everything from the X11 root window down to a single X11 window. * A 'Con' represents everything from the X11 root window down to a single X11 window.
* *
@ -537,7 +540,7 @@ struct Con {
TAILQ_HEAD(swallow_head, Match) swallow_head; TAILQ_HEAD(swallow_head, Match) swallow_head;
enum { CF_NONE = 0, CF_OUTPUT = 1, CF_GLOBAL = 2 } fullscreen_mode; fullscreen_mode_t fullscreen_mode;
/* layout is the layout of this container: one of split[v|h], stacked or /* layout is the layout of this container: one of split[v|h], stacked or
* tabbed. Special containers in the tree (above workspaces) have special * tabbed. Special containers in the tree (above workspaces) have special
* layouts like dockarea or output. * layouts like dockarea or output.

View File

@ -353,7 +353,7 @@ struct bfs_entry {
* Returns the first fullscreen node below this node. * Returns the first fullscreen node below this node.
* *
*/ */
Con *con_get_fullscreen_con(Con *con, int fullscreen_mode) { Con *con_get_fullscreen_con(Con *con, fullscreen_mode_t fullscreen_mode) {
Con *current, *child; Con *current, *child;
/* TODO: is breadth-first-search really appropriate? (check as soon as /* TODO: is breadth-first-search really appropriate? (check as soon as
@ -826,7 +826,7 @@ void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool
* container). * container).
* *
*/ */
int con_orientation(Con *con) { orientation_t con_orientation(Con *con) {
switch (con->layout) { switch (con->layout) {
case L_SPLITV: case L_SPLITV:
/* stacking containers behave like they are in vertical orientation */ /* stacking containers behave like they are in vertical orientation */

View File

@ -130,7 +130,7 @@ char *resolve_tilde(const char *path) {
char *head, *tail, *result; char *head, *tail, *result;
tail = strchr(path, '/'); tail = strchr(path, '/');
head = strndup(path, tail ? tail - path : strlen(path)); head = strndup(path, tail ? (size_t)(tail - path) : strlen(path));
int res = glob(head, GLOB_TILDE, NULL, &globbuf); int res = glob(head, GLOB_TILDE, NULL, &globbuf);
free(head); free(head);