aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stapelberg <stapelberg@users.noreply.github.com>2020-02-15 12:25:58 +0100
committerGitHub <noreply@github.com>2020-02-15 12:25:58 +0100
commitf517b5aa57216a6c55fc00053dfaad378d9392fa (patch)
tree9ee8d9844197b712a1f0c066dafce8ce917b467d
parentc3bf7288b31584c58dc009e223e095a3b12e2b48 (diff)
parentcb1012e608a57e0873b58fb3e24cceabe43e1231 (diff)
downloadi3-f517b5aa57216a6c55fc00053dfaad378d9392fa.tar.gz
i3-f517b5aa57216a6c55fc00053dfaad378d9392fa.zip
Merge pull request #3918 from orestisfl/fno-common
Fix fno-common problems with gcc10
-rw-r--r--.travis.yml2
-rw-r--r--i3-config-wizard/main.c1
-rw-r--r--i3-input/main.c5
-rw-r--r--i3-nagbar/main.c5
-rw-r--r--i3bar/include/common.h6
-rw-r--r--i3bar/include/configuration.h2
-rw-r--r--i3bar/include/outputs.h2
-rw-r--r--i3bar/include/xcb.h2
-rw-r--r--i3bar/src/config.c1
-rw-r--r--i3bar/src/main.c2
-rw-r--r--i3bar/src/outputs.c1
-rw-r--r--i3bar/src/xcb.c3
-rw-r--r--include/xcb.h2
-rw-r--r--libi3/draw_util.c2
-rw-r--r--src/main.c5
-rw-r--r--src/x.c2
16 files changed, 28 insertions, 15 deletions
diff --git a/.travis.yml b/.travis.yml
index 0133fc71..b56bf684 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -31,7 +31,7 @@ install:
script:
- docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/check-safe-wrappers.sh
- docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/check-formatting.sh
- - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} /bin/sh -c 'autoreconf -fi && mkdir -p build && cd build && (../configure || (cat config.log; false)) && make -j CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Werror"'
+ - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} /bin/sh -c 'autoreconf -fi && mkdir -p build && cd build && (../configure || (cat config.log; false)) && make -j CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Werror -fno-common"'
- docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/check-spelling.pl
- docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} ./travis/run-tests.sh
- ./travis/skip-pkg.sh || docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/debian-build.sh deb/debian-amd64/DIST
diff --git a/i3-config-wizard/main.c b/i3-config-wizard/main.c
index 7c1f00a3..f999de30 100644
--- a/i3-config-wizard/main.c
+++ b/i3-config-wizard/main.c
@@ -68,6 +68,7 @@
} while (0)
#include "xcb.h"
+xcb_visualtype_t *visual_type = NULL;
#include "libi3.h"
#define TEXT_PADDING logical_px(4)
diff --git a/i3-input/main.c b/i3-input/main.c
index f15a74ab..e495fe10 100644
--- a/i3-input/main.c
+++ b/i3-input/main.c
@@ -8,8 +8,6 @@
* to i3.
*
*/
-#include "libi3.h"
-
#include <stdio.h>
#include <sys/types.h>
#include <stdlib.h>
@@ -27,6 +25,9 @@
#include <xcb/xcb_event.h>
#include <xcb/xcb_keysyms.h>
+xcb_visualtype_t *visual_type = NULL;
+#include "libi3.h"
+
#include <X11/keysym.h>
#include "keysym2ucs.h"
diff --git a/i3-nagbar/main.c b/i3-nagbar/main.c
index c7b23da5..5099cf54 100644
--- a/i3-nagbar/main.c
+++ b/i3-nagbar/main.c
@@ -8,8 +8,6 @@
* when the user has an error in their configuration file.
*
*/
-#include "libi3.h"
-
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -32,6 +30,9 @@
#include <xcb/randr.h>
#include <xcb/xcb_cursor.h>
+xcb_visualtype_t *visual_type = NULL;
+#include "libi3.h"
+
#define SN_API_NOT_YET_FROZEN 1
#include <libsn/sn-launchee.h>
diff --git a/i3bar/include/common.h b/i3bar/include/common.h
index fe7444a3..222f42dd 100644
--- a/i3bar/include/common.h
+++ b/i3bar/include/common.h
@@ -17,7 +17,7 @@
typedef struct rect_t rect;
-struct ev_loop *main_loop;
+extern struct ev_loop *main_loop;
struct rect_t {
int x;
@@ -82,8 +82,8 @@ struct status_block {
blocks;
};
-TAILQ_HEAD(statusline_head, status_block)
-statusline_head;
+extern TAILQ_HEAD(statusline_head, status_block)
+ statusline_head;
#include "child.h"
#include "ipc.h"
diff --git a/i3bar/include/configuration.h b/i3bar/include/configuration.h
index aeb7db19..70167247 100644
--- a/i3bar/include/configuration.h
+++ b/i3bar/include/configuration.h
@@ -74,7 +74,7 @@ typedef struct config_t {
S_SHOW = 1 } hidden_state;
} config_t;
-config_t config;
+extern config_t config;
/**
* Start parsing the received bar configuration JSON string
diff --git a/i3bar/include/outputs.h b/i3bar/include/outputs.h
index 29a7bcd3..5bb19c40 100644
--- a/i3bar/include/outputs.h
+++ b/i3bar/include/outputs.h
@@ -19,7 +19,7 @@
typedef struct i3_output i3_output;
SLIST_HEAD(outputs_head, i3_output);
-struct outputs_head* outputs;
+extern struct outputs_head* outputs;
/*
* Start parsing the received JSON string
diff --git a/i3bar/include/xcb.h b/i3bar/include/xcb.h
index 760ebcdb..0e3ca22d 100644
--- a/i3bar/include/xcb.h
+++ b/i3bar/include/xcb.h
@@ -53,7 +53,7 @@ struct xcb_color_strings_t {
typedef struct xcb_colors_t xcb_colors_t;
/* Cached width of the custom separator if one was set */
-int separator_symbol_width;
+extern int separator_symbol_width;
/*
* Early initialization of the connection to X11: Everything which does not
diff --git a/i3bar/src/config.c b/i3bar/src/config.c
index 26004071..29b0908b 100644
--- a/i3bar/src/config.c
+++ b/i3bar/src/config.c
@@ -19,6 +19,7 @@
#include <X11/Xlib.h>
+config_t config;
static char *cur_key;
static bool parsing_bindings;
static bool parsing_tray_outputs;
diff --git a/i3bar/src/main.c b/i3bar/src/main.c
index aa6bdbea..65cb00ff 100644
--- a/i3bar/src/main.c
+++ b/i3bar/src/main.c
@@ -17,6 +17,8 @@
#include <getopt.h>
#include <glob.h>
+struct ev_loop *main_loop;
+
/*
* Having verboselog(), errorlog() and debuglog() is necessary when using libi3.
*
diff --git a/i3bar/src/outputs.c b/i3bar/src/outputs.c
index 4c9ce651..2fa3195c 100644
--- a/i3bar/src/outputs.c
+++ b/i3bar/src/outputs.c
@@ -252,6 +252,7 @@ static yajl_callbacks outputs_callbacks = {
.yajl_end_map = outputs_end_map_cb,
};
+struct outputs_head *outputs;
/*
* Initiate the outputs list
*
diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c
index 6b135e44..7b97beea 100644
--- a/i3bar/src/xcb.c
+++ b/i3bar/src/xcb.c
@@ -140,6 +140,9 @@ static const int tray_loff_px = 2;
/* Vertical offset between the bar and a separator */
static const int sep_voff_px = 4;
+/* Cached width of the custom separator if one was set */
+int separator_symbol_width;
+
int _xcb_request_failed(xcb_void_cookie_t cookie, char *err_msg, int line) {
xcb_generic_error_t *err;
if ((err = xcb_request_check(xcb_connection, cookie)) != NULL) {
diff --git a/include/xcb.h b/include/xcb.h
index 53c932bf..32110c7d 100644
--- a/include/xcb.h
+++ b/include/xcb.h
@@ -56,7 +56,7 @@
XCB_EVENT_MASK_FOCUS_CHANGE | \
XCB_EVENT_MASK_ENTER_WINDOW)
-#define xmacro(atom) xcb_atom_t A_##atom;
+#define xmacro(atom) extern xcb_atom_t A_##atom;
#include "atoms.xmacro"
#undef xmacro
diff --git a/libi3/draw_util.c b/libi3/draw_util.c
index f88360dc..092ac967 100644
--- a/libi3/draw_util.c
+++ b/libi3/draw_util.c
@@ -16,7 +16,7 @@
#include <cairo/cairo-xcb.h>
/* The default visual_type to use if none is specified when creating the surface. Must be defined globally. */
-xcb_visualtype_t *visual_type;
+extern xcb_visualtype_t *visual_type;
/* Forward declarations */
static void draw_util_set_source_color(surface_t *surface, color_t color);
diff --git a/src/main.c b/src/main.c
index 42d15735..e4c6b2c9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -93,6 +93,11 @@ bool shape_supported = true;
bool force_xinerama = false;
+/* Define all atoms as global variables */
+#define xmacro(atom) xcb_atom_t A_##atom;
+#include "atoms.xmacro"
+#undef xmacro
+
/*
* This callback is only a dummy, see xcb_prepare_cb.
* See also man libev(3): "ev_prepare" and "ev_check" - customise your event loop
diff --git a/src/x.c b/src/x.c
index 43824bbc..8d89eafd 100644
--- a/src/x.c
+++ b/src/x.c
@@ -14,8 +14,6 @@
#define MAX(x, y) ((x) > (y) ? (x) : (y))
#endif
-xcb_window_t ewmh_window;
-
/* Stores the X11 window ID of the currently focused window */
xcb_window_t focused_id = XCB_NONE;