char *head, *tail, *result;
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);
free(head);
uint32_t top_end_x;
uint32_t bottom_start_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_start_x = 0;
POS_BOT
} 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 {
int modifier;
position_t position;
int num_outputs;
char **outputs;
- /* Bar display mode (hide unless modifier is pressed or show in dock mode or always hide in invisible mode) */
- enum { M_DOCK = 0, M_HIDE = 1, M_INVISIBLE = 2 } hide_on_modifier;
+ bar_display_mode_t hide_on_modifier;
/* The current hidden_state of the bar, which indicates whether it is hidden or shown */
enum { S_HIDE = 0, S_SHOW = 1 } hidden_state;
#include "common.h"
/* Global variables for child_*() */
-i3bar_child child = {};
+i3bar_child child;
/* stdin- and sigchild-watchers */
ev_io *stdin_io;
/* update the configuration with the received settings */
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);
if (old_mode != config.hide_on_modifier) {
reconfig_windows(true);
uint32_t top_end_x;
uint32_t bottom_start_x;
uint32_t bottom_end_x;
- } __attribute__((__packed__)) strut_partial = {};
+ } __attribute__((__packed__)) strut_partial;
+ memset(&strut_partial, 0, sizeof(strut_partial));
+
switch (config.position) {
case POS_NONE:
break;
* 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
* container).
*
*/
-int con_orientation(Con *con);
+orientation_t con_orientation(Con *con);
/**
* Returns the container which will be focused next when the given container
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.
*
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
* tabbed. Special containers in the tree (above workspaces) have special
* layouts like dockarea or output.
* 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;
/* TODO: is breadth-first-search really appropriate? (check as soon as
* container).
*
*/
-int con_orientation(Con *con) {
+orientation_t con_orientation(Con *con) {
switch (con->layout) {
case L_SPLITV:
/* stacking containers behave like they are in vertical orientation */
char *head, *tail, *result;
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);
free(head);