diff --git a/Makefile b/Makefile index b6bc895..5fe9eef 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ ARCH32 = -m32 -mtune=generic ARCH64 = -march=x86-64 -mtune=generic ARCH = ${ARCH64} # General compiler flags -COMPILE_FLAGS = ${CFLAGS} ${PRELINKERFLAGS} -DXINERAMA -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L +COMPILE_FLAGS = ${CCFLAGS} ${PRELINKERFLAGS} -DXINERAMA -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L # Additional release-specific flags RCOMPILE_FLAGS = -DNDEBUG ${RELEASES} # Additional debug-specific flags @@ -81,8 +81,8 @@ INSTALL_DATA = $(INSTALL) -m 644 # Append pkg-config specific libraries if need be ifneq ($(LIBRARIES),) - COMPILE_FLAGS += $(shell pkg-config --cflags $(LIBRARIES)) - LINK_FLAGS += $(shell pkg-config --libs $(LIBRARIES)) + COMPILE_FLAGS += `pkg-config --cflags $(LIBRARIES)` + LINK_FLAGS += `pkg-config --libs $(LIBRARIES)` endif # Verbose option, to output compile and link commands @@ -243,7 +243,7 @@ $(BIN_PATH)/$(BIN_NAME): $(OBJECTS) # After the first compilation they will be joined with the rules from the # dependency files to provide header dependencies $(BUILD_PATH)/%.o: $(SRC_PATH)/%.$(SRC_EXT) - @echo "Building: $< -> $@" +# @echo "Building: $< -> $@" # @$(START_TIME) $(CMD_PREFIX)$(CC) $(CFLAGS) $(INCLUDES) -MP -MMD -c $< -o $@ # @echo -en "\t Compile time: " diff --git a/config.mk b/config.mk index 442879d..97cb899 100644 --- a/config.mk +++ b/config.mk @@ -12,13 +12,14 @@ MANPREFIX = ${PREFIX}/share/man # grep -r xcb # fallback -XCB_INCS_PKG = `pkg-config --cflags --libs xcb xcb-util xcb-aux xcb-xinerama xcb-event xcb-keysyms xcb-xinput xcb-image` -XCB_INCS = -Ixcb -Ixcb-util -Ixcb-aux -Ixcb-xinerama -Ixcb-event -Ixcb-keysyms -Ixcb-xinput -Ixcb-image -TOOLS = -Itools -INCLUDE_INCS = -Iinclude -INCS = ${XCB_INCS} ${INCLUDE_INCS} ${TOOLS} + +INCLUDE_LIST = tools include -Ixcb -Ixcb-util -Ixcb-aux -Ixcb-xinerama -Ixcb-event -Ixcb-keysyms -Ixcb-xinput -Ixcb-image +INCS = $(foreach dir, ${INCLUDE_LIST}, -I${dir}) +#${INCLUDE_INCS} ${TOOLS} #-lxcb-util -lxcb-icccm -lxcb-keysyms -LIBS = ${XCB_INCS_PKG} -lX11 +LIBS = xcb xcb-util xcb-aux xcb-xinerama xcb-event xcb-keysyms xcb-xinput xcb-image +#x11 xcb xcb-util xcb-aux xcb-xinerama xcb-event xcb-keysyms xcb-xinput xcb-image +#${XCB_INCS} x11 CCVERSION = -std=c99 XNATIVE = -march=native -mtune=native @@ -40,11 +41,11 @@ ifeq ($(CC), clang) LINKTIMEOPTIMIZATIONS = endif -PRELINKERFLAGS = -fstack-protector-strong -fstack-clash-protection -fpie ${LINKTIMEOPTIMIZATIONS} ${SECTIONCODE} ${LINKMODE} +PRELINKERFLAGS = -fstack-protector-strong -fstack-clash-protection -fpie ${LINKTIMEOPTIMIZATIONS} ${SECTIONCODE} # can set higher but function overhead is pretty small so meh INLINELIMIT = 15 -LINKERFLAGS = ${LINKMODE} -Wl,--gc-sections,--as-needed,--relax,-z,relro,-z,now,-z,noexecstack,-z,defs,-pie -finline-limit=${INLINELIMIT} ${LINKTIMEOPTIMIZATIONS} +LINKFLAGS = ${LINKMODE} -Wl,--gc-sections,--as-needed,--relax,-z,relro,-z,now,-z,noexecstack,-z,defs,-pie -finline-limit=${INLINELIMIT} ${LINKTIMEOPTIMIZATIONS} BINARY = ${X64} CPPFLAGS = -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_C_SOURCE=200809L ${XINERAMAFLAGS} @@ -68,6 +69,6 @@ RELEASES= ${RELEASEFLAGS} -O3 BUILDSELF = ${RELEASEFLAGS} ${XNATIVE} -O3 # Linker flags -LDFLAGS = ${LIBS} ${LINKERFLAGS} ${BINARY} +LINKERFLAGS = ${LINKFLAGS} ${BINARY} # Solaris #CFLAGS = -fast ${INCS} -DVERSION=\"${VERSION}\" diff --git a/include/client.h b/include/client.h index 5a59284..33d03d5 100644 --- a/include/client.h +++ b/include/client.h @@ -1,7 +1,7 @@ #ifndef _WM_CLIENT_H #define _WM_CLIENT_H -#include "XCB-TRL/xcb_trl.h" +#include "../tools/XCB-TRL/xcb_trl.h" #include "decorations.h" #include diff --git a/include/decorations.h b/include/decorations.h index ce72e7f..5ff88ea 100644 --- a/include/decorations.h +++ b/include/decorations.h @@ -2,7 +2,7 @@ #define _WM_DECORATIONS_H_ -#include "XCB-TRL/xcb_trl.h" +#include "../tools/XCB-TRL/xcb_trl.h" typedef struct Decoration Decoration; diff --git a/include/getprop.h b/include/getprop.h index b82bbb9..796d71f 100644 --- a/include/getprop.h +++ b/include/getprop.h @@ -27,7 +27,7 @@ enum PropertyType PropLAST, }; -void PropInit(); +void PropInit(void); void PropDestroy(void); void PropListen(XCBDisplay *display, XCBWindow win, enum PropertyType type); diff --git a/include/hashing.h b/include/hashing.h index e67c464..b227e49 100644 --- a/include/hashing.h +++ b/include/hashing.h @@ -1,7 +1,7 @@ #ifndef _HASHING_HELPER_H #define _HASHING_HELPER_H -#include "XCB-TRL/xcb_trl.h" +#include "../tools/XCB-TRL/xcb_trl.h" struct Client; diff --git a/include/main.h b/include/main.h index 16169d3..5c6867f 100644 --- a/include/main.h +++ b/include/main.h @@ -10,11 +10,7 @@ #include "desktop.h" #include "monitor.h" #include "x.h" -#include "util.h" -#include "XCB-TRL/xcb_trl.h" -#include "XCB-TRL/xcb_winutil.h" -#include "XCB-TRL/xcb_gtk.h" -#include "XCB-TRL/xcb_xembed.h" +#include "../tools/util.h" #ifndef VERSION diff --git a/include/x.h b/include/x.h index 0a98e9e..583fbc1 100644 --- a/include/x.h +++ b/include/x.h @@ -6,7 +6,10 @@ #include -#include "XCB-TRL/xcb_trl.h" +#include "../tools/XCB-TRL/xcb_trl.h" +#include "../tools/XCB-TRL/xcb_winutil.h" +#include "../tools/XCB-TRL/xcb_gtk.h" +#include "../tools/XCB-TRL/xcb_xembed.h" diff --git a/src/client.c b/src/client.c index 4bd4849..3382e0a 100644 --- a/src/client.c +++ b/src/client.c @@ -1,12 +1,7 @@ #include /* fabsf() */ -#include "client.h" - -#include "desktop.h" - #include "main.h" #include "keybinds.h" -#include "util.h" #include "hashing.h" #include diff --git a/src/desktop.c b/src/desktop.c index c68b45f..59329ac 100644 --- a/src/desktop.c +++ b/src/desktop.c @@ -159,6 +159,8 @@ attachfocusbefore(Client *start, Client *after) Desktop *desk = start->desktop; detachfocus(after); __attach_before(start, after, fnext, fprev, desk->focus, desk->slast, attachfocus); + /* block 'unused' variable warnings */ + (void)desk; } void diff --git a/src/events.c b/src/events.c index 11919d9..26ddecb 100644 --- a/src/events.c +++ b/src/events.c @@ -1095,6 +1095,8 @@ visibilitynotify(XCBGenericEvent *event) const XCBWindow win = ev->window; const u8 state = ev->state; + (void)win; + switch(state) { case XCB_VISIBILITY_UNOBSCURED: diff --git a/src/getprop.c b/src/getprop.c index 88668b9..6d82c82 100644 --- a/src/getprop.c +++ b/src/getprop.c @@ -101,7 +101,7 @@ static PropHandler __prop_handler[PropLAST] = static void -LockMainThread() +LockMainThread(void) { if(__threads.use_threads) { pthread_mutex_lock(&_wm.mutex); @@ -109,7 +109,7 @@ LockMainThread() } static void -UnlockMainThread() +UnlockMainThread(void) { if(__threads.use_threads) { pthread_mutex_unlock(&_wm.mutex); @@ -481,7 +481,6 @@ static void PropCreateWorkers(uint32_t threads) { int32_t i; - pthread_t id = 0; for(i = 0; i < threads; ++i) { CreateWorker(&__threads.threads[i]); } diff --git a/src/gtk.c b/src/gtk.c index e12967e..adb1050 100644 --- a/src/gtk.c +++ b/src/gtk.c @@ -26,7 +26,7 @@ X11GTKSetUseCSD( } void -X11GTK( +X11GTK(void ) { } diff --git a/src/parser.c b/src/parser.c index 792e306..c7b6941 100644 --- a/src/parser.c +++ b/src/parser.c @@ -601,7 +601,6 @@ SCParserNewVar( } } - SCItem *items = parser->items; SCItem *item = parser->items + parser->index; if(_optional_type == SCTypeSTRING) diff --git a/src/toggle.c b/src/toggle.c index 079d55f..74d3985 100644 --- a/src/toggle.c +++ b/src/toggle.c @@ -30,7 +30,7 @@ extern void (*handler[XCBLASTEvent]) (XCBGenericEvent *); extern WM _wm; extern XCBCursor cursors[CurLast]; -static const char * +const char const* GET_BOOL(i64 x) { if(x) diff --git a/tests/ssname.c b/tests/ssname.c index eab46d8..b1732ab 100644 --- a/tests/ssname.c +++ b/tests/ssname.c @@ -7,7 +7,7 @@ void -func() +func(void) { /* TODO, without this XServer sends way too many requests way too fast causing the window manager to hang till the event queue is clear. * A malicious app could hang the window manager. @@ -23,11 +23,13 @@ func() * What shouldnt happen is the window manager crashes, (adress sanatizer) due to buffer overrun. */ int -back() +back(void) { Display *dpy = XOpenDisplay(NULL); int screen = DefaultScreen(dpy); + (void)screen; + Window root = DefaultRootWindow(dpy); Window win = XCreateSimpleWindow(dpy, root, 0, 0, 1, 1, 0, 0, 0); diff --git a/tools/XCB-TRL/xcb_trl.c b/tools/XCB-TRL/xcb_trl.c index 27502d2..1b3574b 100644 --- a/tools/XCB-TRL/xcb_trl.c +++ b/tools/XCB-TRL/xcb_trl.c @@ -255,7 +255,7 @@ XCBBreakPoint(void) #endif char * -XCBDebugGetCallStack() +XCBDebugGetCallStack(void) { char *stack = NULL; #ifdef DBG @@ -285,7 +285,7 @@ XCBDebugGetCallStack() } char * -XCBDebugGetLastCall() +XCBDebugGetLastCall(void) { const char *lastcall = NULL; #ifdef DBG @@ -300,7 +300,7 @@ XCBDebugGetLastCall() } char * -XCBDebugGetFirstCall() +XCBDebugGetFirstCall(void) { char *firstcall = NULL; #if DBG