Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

Commit

Permalink
Merge pull request #3918 from orestisfl/fno-common
Browse files Browse the repository at this point in the history
Fix fno-common problems with gcc10
  • Loading branch information
stapelberg authored Feb 15, 2020
2 parents c3bf728 + cb1012e commit f517b5a
Show file tree
Hide file tree
Showing 16 changed files with 28 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions i3-config-wizard/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
} while (0)

#include "xcb.h"
xcb_visualtype_t *visual_type = NULL;
#include "libi3.h"

#define TEXT_PADDING logical_px(4)
Expand Down
5 changes: 3 additions & 2 deletions i3-input/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
* to i3.
*
*/
#include "libi3.h"

#include <stdio.h>
#include <sys/types.h>
#include <stdlib.h>
Expand All @@ -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"
Expand Down
5 changes: 3 additions & 2 deletions i3-nagbar/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>

Expand Down
6 changes: 3 additions & 3 deletions i3bar/include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion i3bar/include/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion i3bar/include/outputs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion i3bar/include/xcb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions i3bar/src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <X11/Xlib.h>

config_t config;
static char *cur_key;
static bool parsing_bindings;
static bool parsing_tray_outputs;
Expand Down
2 changes: 2 additions & 0 deletions i3bar/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
1 change: 1 addition & 0 deletions i3bar/src/outputs.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ static yajl_callbacks outputs_callbacks = {
.yajl_end_map = outputs_end_map_cb,
};

struct outputs_head *outputs;
/*
* Initiate the outputs list
*
Expand Down
3 changes: 3 additions & 0 deletions i3bar/src/xcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion include/xcb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion libi3/draw_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f517b5a

Please sign in to comment.