From 00e4e9975e078ed2be27c5a6c3676dee4d11fd24 Mon Sep 17 00:00:00 2001 From: Raphael Khaiat Date: Tue, 6 Jul 2010 23:03:40 +0200 Subject: [PATCH 01/14] Fix a bug that printed the tag previous count instead of the new one when using the tag_add with the name_count = true --- src/tag.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/tag.c b/src/tag.c index 160a44c..2188efd 100644 --- a/src/tag.c +++ b/src/tag.c @@ -479,7 +479,16 @@ tag_new(int s, char *name) { char * displayedName; - if((!name || strlen(name) == 0)) + if(conf.ntag[s] + 1 > MAXTAG) + { + warnx("Too many tag: Can't create new tag"); + + return; + } + + ++conf.ntag[s]; + + if(!name || strlen(name) == 0) { if(conf.tagnamecount) { @@ -498,17 +507,8 @@ tag_new(int s, char *name) conf.default_tag.barpos, conf.default_tag.layout, 0, NULL, 0 }; - if(conf.ntag[s] + 1 > MAXTAG) - { - warnx("Too many tag: Can't create new tag"); - - return; - } - - ++conf.ntag[s]; tags[s][conf.ntag[s]] = t; -/* tags[s][conf.ntag[s]].name = _strdup(displayedName);*/ infobar_update_taglist(s); infobar_draw(s); From 103c86db03133d05ab52c13e4014e9de96701aaa Mon Sep 17 00:00:00 2001 From: Philippe Pepiot Date: Sun, 14 Nov 2010 15:19:36 +0100 Subject: [PATCH 02/14] BuildSystem: small stuffs move VERSION to common.mk Remove obscure {C|LD}_FLAGS OPTIONS with optional libs and LIBS = ${REQUIRED} ${OPTIONS} --- BSDmakefile | 12 ++++++++++-- Makefile | 30 ++++++++++++++---------------- common.mk | 8 ++++++-- config.mk | 11 ++--------- 4 files changed, 32 insertions(+), 29 deletions(-) diff --git a/BSDmakefile b/BSDmakefile index aced1b8..01af54c 100644 --- a/BSDmakefile +++ b/BSDmakefile @@ -25,6 +25,13 @@ LDFLAGS_LIBS!= pkg-config --libs ${LIBS} CFLAGS+= ${CFLAGS_LIBS} LDADD+= ${LDFLAGS_LIBS} -lpthread +options: + @echo wmfs compile with ${LIBS} + @echo - CFLAGS ${CFLAGS} + @echo - LDFLAGS ${LDFLAGS} + @echo - OUTPUT ${.OBJDIR} + + install: all @echo installing executable file to ${DESTDIR}${PREFIX}/bin @mkdir -p ${DESTDIR}${PREFIX}/bin @@ -49,10 +56,11 @@ uninstall: @echo removing config file from ${DESTDIR}${XDG_CONFIG_DIR} @rm -f ${DESTDIR}${XDG_CONFIG_DIR}/wmfsrc +all: options .include .c.o: config.mk @if [ ! -d `dirname ${.TARGET}` ]; then mkdir -p `dirname ${.TARGET}`; fi - @echo CC ${.IMPSRC} - @${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + diff --git a/Makefile b/Makefile index 508bb71..3fd56d0 100644 --- a/Makefile +++ b/Makefile @@ -33,8 +33,7 @@ ${O}/wmfs.1.gz: wmfs.1 ${O}/%.o: %.c config.mk @if [ ! -d `dirname ${O}/$<` ]; then mkdir -p `dirname ${O}/$<`; fi - @echo CC $< - @${CC} -c ${CFLAGS} $< -o $@ + ${CC} -c ${CFLAGS} $< -o $@ options: @echo wmfs compile with ${LIBS} @@ -45,35 +44,34 @@ options: @if [ ! -d ${O} ]; then mkdir -p ${O}; fi ${O}/wmfs: ${OBJ} config.mk src/structs.h src/wmfs.h src/parse/parse.h - @echo CC -o $@ - @${CC} -o $@ ${OBJ} ${LDFLAGS} + ${CC} -o $@ ${OBJ} ${LDFLAGS} clean: @rm -f ${OBJ} ${O}/wmfs ${O}/wmfs.1.gz install: all @echo installing executable file to ${DESTDIR}${PREFIX}/bin - @mkdir -p ${DESTDIR}${PREFIX}/bin - @install ${O}/wmfs ${DESTDIR}${PREFIX}/bin + mkdir -p ${DESTDIR}${PREFIX}/bin + install ${O}/wmfs ${DESTDIR}${PREFIX}/bin @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1 - @mkdir -p ${DESTDIR}${MANPREFIX}/man1 - @install -m 644 ${O}/wmfs.1.gz ${DESTDIR}${MANPREFIX}/man1/ + mkdir -p ${DESTDIR}${MANPREFIX}/man1 + install -m 644 ${O}/wmfs.1.gz ${DESTDIR}${MANPREFIX}/man1/ @echo installing xsession file to ${DESTDIR}${PREFIX}/share/xsessions - @mkdir -p ${DESTDIR}${PREFIX}/share/xsessions - @install -m 644 wmfs.desktop ${DESTDIR}${PREFIX}/share/xsessions/ + mkdir -p ${DESTDIR}${PREFIX}/share/xsessions + install -m 644 wmfs.desktop ${DESTDIR}${PREFIX}/share/xsessions/ @echo installing default config file to ${DESTDIR}${XDG_CONFIG_DIR} - @mkdir -p ${DESTDIR}${XDG_CONFIG_DIR} - @install -m 444 wmfsrc ${DESTDIR}${XDG_CONFIG_DIR} + mkdir -p ${DESTDIR}${XDG_CONFIG_DIR} + install -m 444 wmfsrc ${DESTDIR}${XDG_CONFIG_DIR} uninstall: @echo removing executable file from ${DESTDIR}${PREFIX}/bin - @rm -f ${DESTDIR}${PREFIX}/bin/wmfs + rm -f ${DESTDIR}${PREFIX}/bin/wmfs @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1 - @rm -f ${DESTDIR}${MANPREFIX}/man1/wmfs.1.gz + rm -f ${DESTDIR}${MANPREFIX}/man1/wmfs.1.gz @echo removing xsession file from ${DESTDIR}${PREFIX}/share/xsessions - @rm -f ${DESTDIR}${PREFIX}/share/xsessions/wmfs.desktop + rm -f ${DESTDIR}${PREFIX}/share/xsessions/wmfs.desktop @echo removing config file from ${DESTDIR}${XDG_CONFIG_DIR} - @rm -f ${DESTDIR}${XDG_CONFIG_DIR}/wmfsrc + rm -f ${DESTDIR}${XDG_CONFIG_DIR}/wmfsrc diff --git a/common.mk b/common.mk index 3799f9f..8c82390 100644 --- a/common.mk +++ b/common.mk @@ -1,3 +1,6 @@ +# wmfs version +VERSION= 201011 + SRCS= \ src/barwin.c \ src/client.c \ @@ -23,11 +26,12 @@ src/util.c \ src/viwmfs.c \ src/wmfs.c +# Used libs +LIBS= x11 xft freetype2 ${OPTIONS} + # flags -CFLAGS+= ${C_FLAGS} CFLAGS+= -DXDG_CONFIG_DIR=\"${XDG_CONFIG_DIR}\" CFLAGS+= -DWMFS_VERSION=\"${VERSION}\" -LDFLAGS+= ${LD_FLAGS} # build directory O?= build diff --git a/config.mk b/config.mk index 739dfdb..dc7b600 100644 --- a/config.mk +++ b/config.mk @@ -1,10 +1,6 @@ -# wmfs version -VERSION= 201011 - # Customize below to fit your system # x11 xft and freetype2 are REQUIRED, others are optionals -LIBS= x11 xft freetype2 xrandr xinerama imlib2 - +OPTIONS= xrandr xinerama imlib2 # If theses variables are defined, make will not call pkg-config # @@ -21,7 +17,4 @@ PREFIX= /usr/local MANPREFIX= ${PREFIX}/man XDG_CONFIG_DIR= /usr/local/etc/xdg/wmfs - -# CFLAGS LDFLAGS can be customised here -C_FLAGS= -Wall -LD_FLAGS= +CFLAGS= -Wall From 7096101651b269b5ddea9923d9889390d27b64e3 Mon Sep 17 00:00:00 2001 From: Philippe Pepiot Date: Sun, 14 Nov 2010 15:29:08 +0100 Subject: [PATCH 03/14] Update README --- README | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/README b/README index 5245f86..7d620ca 100644 --- a/README +++ b/README @@ -4,33 +4,34 @@ WMFS Window Manager. A highly configurable and manageable tiling Window Manager created from scratch -AUTHORS : - Martin Duquesnoy +AUTHORS : (in order of commits and > 5 commits) + - Martin Duquesnoy + - Philippe Pepiot + - Marc Lagrange + - OldMan + - Raphael Khaiat + - Tomáš Chvátal + - David Delassus + LICENSE : BSD REQUIREMENT : - freetype2 + - libxft + - libx11 - libxinerama (optional) - libxrandr (optional) - imlib2 (optional) - - libxft - - libx11 - - CMake >= 2.6 OS : - GNU/Linux : Supported. - - FreeBSD : Supported. + - FreeBSD/OpenBSD/NetBSD : Supported. INSTALL : - - mkdir build - - cd build - - cmake .. - - make - - sudo make install - - sudo make uninstall # if you would to remove it. - -If you have doxygen installed you can generate doxygen documentation via custom target 'make doc' in the build dir. +$EDITOR config.mk +make +sudo make install DISTROS : - wmfs port for FreeBSD at x11-wm/wmfs From d8e2d54d8ebb04a6269bbd9975ce6b7063bd7f46 Mon Sep 17 00:00:00 2001 From: Philippe Pepiot Date: Sun, 14 Nov 2010 19:23:41 +0100 Subject: [PATCH 04/14] BuildSystem: fix install target on OpenBSD --- BSDmakefile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/BSDmakefile b/BSDmakefile index 01af54c..eb70925 100644 --- a/BSDmakefile +++ b/BSDmakefile @@ -4,6 +4,8 @@ PROG= wmfs MAN1= wmfs.1 +MANDIR= ${MANPREFIX}/man + .for lib in xrandr xinerama .if !empty(LIBS:M${lib}) CFLAGS+= -DHAVE_${lib:U} @@ -32,13 +34,10 @@ options: @echo - OUTPUT ${.OBJDIR} -install: all +install: all maninstall @echo installing executable file to ${DESTDIR}${PREFIX}/bin @mkdir -p ${DESTDIR}${PREFIX}/bin @install ${.OBJDIR}/wmfs ${DESTDIR}${PREFIX}/bin - @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1 - @mkdir -p ${DESTDIR}${MANPREFIX}/man1 - @install -m 644 ${.OBJDIR}/wmfs.1.gz ${DESTDIR}${MANPREFIX}/man1/ @echo installing xsession file to ${DESTDIR}${PREFIX}/share/xsessions @mkdir -p ${DESTDIR}${PREFIX}/share/xsessions @install -m 644 ${.CURDIR}/wmfs.desktop ${DESTDIR}${PREFIX}/share/xsessions/ From bfc56f8c37284570a9473073e6dcb359e6367f4d Mon Sep 17 00:00:00 2001 From: Philippe Pepiot Date: Sun, 14 Nov 2010 19:32:12 +0100 Subject: [PATCH 05/14] BuildSystem: default {C|LD}FLAGS for OpenBSD --- config.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config.mk b/config.mk index dc7b600..ea7264f 100644 --- a/config.mk +++ b/config.mk @@ -11,6 +11,10 @@ OPTIONS= xrandr xinerama imlib2 # FreeBSD example # CFLAGS_LIBS= -I/usr/local/include -I/usr/local/include/freetype2 # LDFLAGS_LIBS= -L/usr/local/lib -lXft -lXrender -lfontconfig -lX11 -lfreetype -lXrandr -lXinerama -lImlib2 +# +# OpenBSD example +# CFLAGS_LIBS= -I/usr/X11R6/include -I/usr/X11R6/include/freetype2 -I/usr/local/include +# LDFLAGS_LIBS= -L/usr/X11R6/lib -L/usr/local/lib -lXft -lfontconfig -lexpat -lXrandr -lXrender -lXinerama -lxcb -lpthread-subs -lXau -lXdmcp -lImlib2 -lfreetype -lz -lX11 -lXext -lm # paths PREFIX= /usr/local From 2d9baf78c5458708417172e89b674ce9606a5ae2 Mon Sep 17 00:00:00 2001 From: Raphael Khaiat Date: Tue, 16 Nov 2010 01:09:35 +0100 Subject: [PATCH 06/14] Starting wmfs with an alternate wmfs was possible with wmfs -C otherWmfsrc but only $HOME/.config/wmfsrc was read when reloading wmfs. Now, if you start wmfs with -C and a different file, this file will be reloaded. --- src/wmfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wmfs.c b/src/wmfs.c index b614b21..cdbb923 100644 --- a/src/wmfs.c +++ b/src/wmfs.c @@ -282,7 +282,8 @@ uicb_reload(uicb_t cmd) for(; argv_global[0] && argv_global[0] == ' '; ++argv_global); - execlp(argv_global, argv_global, NULL); + // add -C to always load the same config file + execlp(argv_global, argv_global, "-C", conf.confpath, NULL); return; } From 6bd0175db04b44f27caa75df4a48fbff6492a74b Mon Sep 17 00:00:00 2001 From: Philippe Pepiot Date: Tue, 16 Nov 2010 13:09:40 +0100 Subject: [PATCH 07/14] BuildSystem: complete rewrite Should compile properly on Linux, FreeBSD, OpenBSD and NetBSD --- .gitignore | 2 +- BSDmakefile | 65 -------------------------------- Makefile | 85 +++++++++++++++++++++++------------------- Makefile.in | 79 +++++++++++++++++++++++++++++++++++++++ README | 2 +- common.mk | 37 ------------------ config.mk | 24 ------------ configure | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 232 insertions(+), 167 deletions(-) delete mode 100644 BSDmakefile create mode 100644 Makefile.in delete mode 100644 common.mk delete mode 100644 config.mk create mode 100755 configure diff --git a/.gitignore b/.gitignore index a3eabb8..2c83f39 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ wmfs #* \#* -build +Makefile diff --git a/BSDmakefile b/BSDmakefile deleted file mode 100644 index eb70925..0000000 --- a/BSDmakefile +++ /dev/null @@ -1,65 +0,0 @@ -.include "config.mk" -.include "common.mk" - -PROG= wmfs -MAN1= wmfs.1 - -MANDIR= ${MANPREFIX}/man - -.for lib in xrandr xinerama -.if !empty(LIBS:M${lib}) -CFLAGS+= -DHAVE_${lib:U} -.endif -.endfor - -.if !empty(LIBS:Mimlib2) -CFLAGS+= -DHAVE_IMLIB -.endif - -.if !defined(CFLAGS_LIBS) -CFLAGS_LIBS!= pkg-config --cflags-only-I ${LIBS} -.endif - -.if !defined(LDFLAGS_LIBS) -LDFLAGS_LIBS!= pkg-config --libs ${LIBS} -.endif - -CFLAGS+= ${CFLAGS_LIBS} -LDADD+= ${LDFLAGS_LIBS} -lpthread - -options: - @echo wmfs compile with ${LIBS} - @echo - CFLAGS ${CFLAGS} - @echo - LDFLAGS ${LDFLAGS} - @echo - OUTPUT ${.OBJDIR} - - -install: all maninstall - @echo installing executable file to ${DESTDIR}${PREFIX}/bin - @mkdir -p ${DESTDIR}${PREFIX}/bin - @install ${.OBJDIR}/wmfs ${DESTDIR}${PREFIX}/bin - @echo installing xsession file to ${DESTDIR}${PREFIX}/share/xsessions - @mkdir -p ${DESTDIR}${PREFIX}/share/xsessions - @install -m 644 ${.CURDIR}/wmfs.desktop ${DESTDIR}${PREFIX}/share/xsessions/ - @echo installing default config file to ${DESTDIR}${XDG_CONFIG_DIR} - @mkdir -p ${DESTDIR}${XDG_CONFIG_DIR} - @install -m 444 ${.CURDIR}/wmfsrc ${DESTDIR}${XDG_CONFIG_DIR} - -uninstall: - @echo removing executable file from ${DESTDIR}${PREFIX}/bin - @rm -f ${DESTDIR}${PREFIX}/bin/wmfs - @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1 - @rm -f ${DESTDIR}${MANPREFIX}/man1/wmfs.1.gz - @echo removing xsession file from ${DESTDIR}${PREFIX}/share/xsessions/ - @rm -f ${DESTDIR}${PREFIX}/share/xsessions/wmfs.desktop - @echo removing config file from ${DESTDIR}${XDG_CONFIG_DIR} - @rm -f ${DESTDIR}${XDG_CONFIG_DIR}/wmfsrc - -all: options - -.include - -.c.o: config.mk - @if [ ! -d `dirname ${.TARGET}` ]; then mkdir -p `dirname ${.TARGET}`; fi - ${CC} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} - diff --git a/Makefile b/Makefile index 3fd56d0..d255df5 100644 --- a/Makefile +++ b/Makefile @@ -1,61 +1,68 @@ -include config.mk -include common.mk +PREFIX=/usr/local +XDG_CONFIG_DIR=/usr/local/etc/xdg/wmfs +MANPREFIX=/usr/local/man -OBJ = ${patsubst %.c,${O}/%.o,${SRCS}} +CFLAGS=-I/usr/include/freetype2 -DHAVE_XINERAMA -DHAVE_XRANDR -DHAVE_IMLIB2 +LDFLAGS=-lX11 -lXft -lfreetype -lXinerama -lXrandr -lImlib2 -lpthread -ifneq ($(findstring xrandr, ${LIBS}),) -CFLAGS+= -DHAVE_XRANDR -endif +PROG=wmfs +MAN=wmfs.1 -ifneq ($(findstring xinerama, ${LIBS}),) -CFLAGS+= -DHAVE_XINERAMA -endif +# wmfs version +VERSION= 201011 -ifneq ($(findstring imlib2, ${LIBS}),) -CFLAGS+= -DHAVE_IMLIB -endif +SRCS= \ +src/barwin.c \ +src/client.c \ +src/config.c \ +src/draw.c \ +src/event.c \ +src/ewmh.c \ +src/frame.c \ +src/getinfo.c \ +src/infobar.c \ +src/init.c \ +src/launcher.c \ +src/layout.c \ +src/menu.c \ +src/mouse.c \ +src/parse/api.c \ +src/parse/parse.c \ +src/screen.c \ +src/status.c \ +src/systray.c \ +src/tag.c \ +src/util.c \ +src/viwmfs.c \ +src/wmfs.c -ifndef CFLAGS_LIBS -CFLAGS_LIBS= $(shell pkg-config --cflags-only-I ${LIBS}) -endif +# flags +CFLAGS+= -DXDG_CONFIG_DIR=\"${XDG_CONFIG_DIR}\" +CFLAGS+= -DWMFS_VERSION=\"${VERSION}\" -ifndef LDFLAGS_LIBS -LDFLAGS_LIBS= $(shell pkg-config --libs ${LIBS}) -endif +OBJS= ${SRCS:.c=.o} -CFLAGS+= ${CFLAGS_LIBS} -LDFLAGS+= ${LDFLAGS_LIBS} -lpthread +all: ${PROG} ${MAN}.gz -all: options ${O}/wmfs ${O}/wmfs.1.gz +${PROG}: ${OBJS} src/structs.h src/wmfs.h src/parse/parse.h + ${CC} -o $@ ${OBJS} ${LDFLAGS} -${O}/wmfs.1.gz: wmfs.1 - gzip -cn -9 $< > $@ +${MAN}.gz: ${MAN} + gzip -cn -9 ${MAN} > $@ -${O}/%.o: %.c config.mk - @if [ ! -d `dirname ${O}/$<` ]; then mkdir -p `dirname ${O}/$<`; fi +.c.o: ${CC} -c ${CFLAGS} $< -o $@ -options: - @echo wmfs compile with ${LIBS} - @echo - CFLAGS ${CFLAGS} - @echo - LDFLAGS ${LDFLAGS} - @echo - OUTPUT ${O} - - @if [ ! -d ${O} ]; then mkdir -p ${O}; fi - -${O}/wmfs: ${OBJ} config.mk src/structs.h src/wmfs.h src/parse/parse.h - ${CC} -o $@ ${OBJ} ${LDFLAGS} - clean: - @rm -f ${OBJ} ${O}/wmfs ${O}/wmfs.1.gz + rm -f ${OBJS} wmfs ${MAN}.gz install: all @echo installing executable file to ${DESTDIR}${PREFIX}/bin mkdir -p ${DESTDIR}${PREFIX}/bin - install ${O}/wmfs ${DESTDIR}${PREFIX}/bin + install ${PROG} ${DESTDIR}${PREFIX}/bin @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1 mkdir -p ${DESTDIR}${MANPREFIX}/man1 - install -m 644 ${O}/wmfs.1.gz ${DESTDIR}${MANPREFIX}/man1/ + install -m 644 ${MAN}.gz ${DESTDIR}${MANPREFIX}/man1/ @echo installing xsession file to ${DESTDIR}${PREFIX}/share/xsessions mkdir -p ${DESTDIR}${PREFIX}/share/xsessions install -m 644 wmfs.desktop ${DESTDIR}${PREFIX}/share/xsessions/ diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..0d69de7 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,79 @@ +PROG=wmfs +MAN=wmfs.1 + +# wmfs version +VERSION= 201011 + +SRCS= \ +src/barwin.c \ +src/client.c \ +src/config.c \ +src/draw.c \ +src/event.c \ +src/ewmh.c \ +src/frame.c \ +src/getinfo.c \ +src/infobar.c \ +src/init.c \ +src/launcher.c \ +src/layout.c \ +src/menu.c \ +src/mouse.c \ +src/parse/api.c \ +src/parse/parse.c \ +src/screen.c \ +src/status.c \ +src/systray.c \ +src/tag.c \ +src/util.c \ +src/viwmfs.c \ +src/wmfs.c + +# flags +CFLAGS+= -DXDG_CONFIG_DIR=\"${XDG_CONFIG_DIR}\" +CFLAGS+= -DWMFS_VERSION=\"${VERSION}\" + +OBJS= ${SRCS:.c=.o} + +all: ${PROG} ${MAN}.gz + +${PROG}: ${OBJS} src/structs.h src/wmfs.h src/parse/parse.h + ${CC} -o $@ ${OBJS} ${LDFLAGS} + +${MAN}.gz: ${MAN} + gzip -cn -9 ${MAN} > $@ + +.c.o: + ${CC} -c ${CFLAGS} $< -o $@ + +clean: + rm -f ${OBJS} wmfs ${MAN}.gz + +install: all + @echo installing executable file to ${DESTDIR}${PREFIX}/bin + mkdir -p ${DESTDIR}${PREFIX}/bin + install ${PROG} ${DESTDIR}${PREFIX}/bin + @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1 + mkdir -p ${DESTDIR}${MANPREFIX}/man1 + install -m 644 ${MAN}.gz ${DESTDIR}${MANPREFIX}/man1/ + @echo installing xsession file to ${DESTDIR}${PREFIX}/share/xsessions + mkdir -p ${DESTDIR}${PREFIX}/share/xsessions + install -m 644 wmfs.desktop ${DESTDIR}${PREFIX}/share/xsessions/ + @echo installing default config file to ${DESTDIR}${XDG_CONFIG_DIR} + mkdir -p ${DESTDIR}${XDG_CONFIG_DIR} + install -m 444 wmfsrc ${DESTDIR}${XDG_CONFIG_DIR} + +uninstall: + @echo removing executable file from ${DESTDIR}${PREFIX}/bin + rm -f ${DESTDIR}${PREFIX}/bin/wmfs + @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1 + rm -f ${DESTDIR}${MANPREFIX}/man1/wmfs.1.gz + @echo removing xsession file from ${DESTDIR}${PREFIX}/share/xsessions + rm -f ${DESTDIR}${PREFIX}/share/xsessions/wmfs.desktop + @echo removing config file from ${DESTDIR}${XDG_CONFIG_DIR} + rm -f ${DESTDIR}${XDG_CONFIG_DIR}/wmfsrc + + + +.PHONY: all clean install uninstall + diff --git a/README b/README index 7d620ca..1f5bf8a 100644 --- a/README +++ b/README @@ -29,7 +29,7 @@ OS : - FreeBSD/OpenBSD/NetBSD : Supported. INSTALL : -$EDITOR config.mk +./configure [--without-imlib2|--without-xrandr|--without-xinerama] (./configure -h) make sudo make install diff --git a/common.mk b/common.mk deleted file mode 100644 index 8c82390..0000000 --- a/common.mk +++ /dev/null @@ -1,37 +0,0 @@ -# wmfs version -VERSION= 201011 - -SRCS= \ -src/barwin.c \ -src/client.c \ -src/config.c \ -src/draw.c \ -src/event.c \ -src/ewmh.c \ -src/frame.c \ -src/getinfo.c \ -src/infobar.c \ -src/init.c \ -src/launcher.c \ -src/layout.c \ -src/menu.c \ -src/mouse.c \ -src/parse/api.c \ -src/parse/parse.c \ -src/screen.c \ -src/status.c \ -src/systray.c \ -src/tag.c \ -src/util.c \ -src/viwmfs.c \ -src/wmfs.c - -# Used libs -LIBS= x11 xft freetype2 ${OPTIONS} - -# flags -CFLAGS+= -DXDG_CONFIG_DIR=\"${XDG_CONFIG_DIR}\" -CFLAGS+= -DWMFS_VERSION=\"${VERSION}\" - -# build directory -O?= build diff --git a/config.mk b/config.mk deleted file mode 100644 index ea7264f..0000000 --- a/config.mk +++ /dev/null @@ -1,24 +0,0 @@ -# Customize below to fit your system -# x11 xft and freetype2 are REQUIRED, others are optionals -OPTIONS= xrandr xinerama imlib2 - -# If theses variables are defined, make will not call pkg-config -# -# Linux example -# CFLAGS_LIBS= -I/usr/include/freetype2 -# LDFLAGS_LIBS= -lX11 -lXft -lfreetype -lXrandr -lXinerama -lImlib2 -# -# FreeBSD example -# CFLAGS_LIBS= -I/usr/local/include -I/usr/local/include/freetype2 -# LDFLAGS_LIBS= -L/usr/local/lib -lXft -lXrender -lfontconfig -lX11 -lfreetype -lXrandr -lXinerama -lImlib2 -# -# OpenBSD example -# CFLAGS_LIBS= -I/usr/X11R6/include -I/usr/X11R6/include/freetype2 -I/usr/local/include -# LDFLAGS_LIBS= -L/usr/X11R6/lib -L/usr/local/lib -lXft -lfontconfig -lexpat -lXrandr -lXrender -lXinerama -lxcb -lpthread-subs -lXau -lXdmcp -lImlib2 -lfreetype -lz -lX11 -lXext -lm - -# paths -PREFIX= /usr/local -MANPREFIX= ${PREFIX}/man -XDG_CONFIG_DIR= /usr/local/etc/xdg/wmfs - -CFLAGS= -Wall diff --git a/configure b/configure new file mode 100755 index 0000000..0dbbbb7 --- /dev/null +++ b/configure @@ -0,0 +1,105 @@ +#!/bin/sh + +LIBS="x11 xft freetype2" +USE_XINERAMA="xinerama" +USE_XRANDR="xrandr" +USE_IMLIB2="imlib2" +OS=`uname -s` +PREFIX=/usr/local +MANPREFIX="$PREFIX/man" +XDG_CONFIG_DIR="$PREFIX/etc/xdg/wmfs" + +while true; do + case "$1" in + --without-xinerama) + USE_XINERAMA=""; shift;; + --without-xrandr) + USE_XRANDR=""; shift;; + --without-imlib2) + USE_IMLIB2=""; shift;; + --prefix) + [ -z "$2" ] && echo "Missing argument" && exit 1 + PREFIX=$2; shift 2;; + --xdg-config-dir) + [ -z "$2" ] && echo "Missing argument" && exit 1 + XDG_CONFIG_DIR=$2; shift 2;; + --man-prefix) + [ -z "$2" ] && echo "Missing argument" && exit 1 + MANPREFIX=$2; shift 2;; + --help|-h) + echo "Usage: ./configure [options] + --without-imlib2 : compile without imlib2 support + --without-xrandr : compile without xrandr support + --without-xinerama : compile without xinerama support + --prefix DIRECTORY : install binary with specified prefix (default $PREFIX) + --xdg-config-dir DIRECTORY : install configuration to specified directory (default $XDG_CONFIG_DIR) + --man-prefix DIRECTORY : install man page to specified prefix (default $MANPREFIX)" + exit 0;; + *) break;; + esac +done + +LIBS="$LIBS $USE_XINERAMA $USE_XRANDR $USE_IMLIB2" + +which pkg-config >/dev/null 2>&1 + +if [ $? -eq 0 ]; +then + CFLAGS=`pkg-config --cflags-only-I $LIBS` + LDFLAGS=`pkg-config --libs $LIBS` +else + # Try to use some known paths + case $OS in + FreeBSD) + CFLAGS="-I/usr/local/include -I/usr/local/include/freetype2" + LDFLAGS="-L/usr/local/lib";; + OpenBSD) + CFLAGS="-I/usr/X11R6/include -I/usr/X11R6/include/freetype2 -I/usr/local/include" + LDFLAGS="-L/usr/X11R6/lib -L/usr/local/lib";; + NetBSD) + CFLAGS="-I/usr/X11R7/include -I/usr/X11R7/include/freetype2 -I/usr/local/include" + LDFLAGS="-L/usr/X11R7/lib -L/usr/local/lib";; + Linux) + CFLAGS="-I/usr/include/freetype2" + LDFLAGS="" + ;; + *) + echo "No default CFLAGS and LDFLAGS found for your OS, feel free to contribute or install pkg-config :)" + exit 1;; + esac + + LDFLAGS="$LDFLAGS -lX11 -lXft -lfreetype" + + [ -n "$USE_XINERAMA" ] && LDFLAGS="$LDFLAGS -lXinerama" + [ -n "$USE_XRANDR" ] && LDFLAGS="$LDFLAGS -lXrandr" + [ -n "$USE_IMLIB2" ] && LDFLAGS="$LDFLAGS -lImlib2" +fi + +[ -n "$USE_XINERAMA" ] && CFLAGS="$CFLAGS -DHAVE_XINERAMA" +[ -n "$USE_XRANDR" ] && CFLAGS="$CFLAGS -DHAVE_XRANDR" +[ -n "$USE_IMLIB2" ] && CFLAGS="$CFLAGS -DHAVE_IMLIB2" + +LDFLAGS="$LDFLAGS -lpthread" + +cat > Makefile << EOF +PREFIX=$PREFIX +XDG_CONFIG_DIR=$XDG_CONFIG_DIR +MANPREFIX=$MANPREFIX + +CFLAGS=$CFLAGS +LDFLAGS=$LDFLAGS + +EOF + +cat Makefile.in >> Makefile + +echo "Compilation resume: +OS=$OS +CFLAGS=$CFLAGS +LDFLAGS=$LDFLAGS +PREFIX=$PREFIX +MANPREFIX=$MANPREFIX +XDG_CONFIG_DIR=$XDG_CONFIG_DIR + +You can run 'make' now :-) +" From 1294d7e35c5058c04af3829a5202d31a11582497 Mon Sep 17 00:00:00 2001 From: Philippe Pepiot Date: Tue, 16 Nov 2010 13:15:06 +0100 Subject: [PATCH 08/14] BuildSystem: remove Makefile --- Makefile | 86 -------------------------------------------------------- 1 file changed, 86 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index d255df5..0000000 --- a/Makefile +++ /dev/null @@ -1,86 +0,0 @@ -PREFIX=/usr/local -XDG_CONFIG_DIR=/usr/local/etc/xdg/wmfs -MANPREFIX=/usr/local/man - -CFLAGS=-I/usr/include/freetype2 -DHAVE_XINERAMA -DHAVE_XRANDR -DHAVE_IMLIB2 -LDFLAGS=-lX11 -lXft -lfreetype -lXinerama -lXrandr -lImlib2 -lpthread - -PROG=wmfs -MAN=wmfs.1 - -# wmfs version -VERSION= 201011 - -SRCS= \ -src/barwin.c \ -src/client.c \ -src/config.c \ -src/draw.c \ -src/event.c \ -src/ewmh.c \ -src/frame.c \ -src/getinfo.c \ -src/infobar.c \ -src/init.c \ -src/launcher.c \ -src/layout.c \ -src/menu.c \ -src/mouse.c \ -src/parse/api.c \ -src/parse/parse.c \ -src/screen.c \ -src/status.c \ -src/systray.c \ -src/tag.c \ -src/util.c \ -src/viwmfs.c \ -src/wmfs.c - -# flags -CFLAGS+= -DXDG_CONFIG_DIR=\"${XDG_CONFIG_DIR}\" -CFLAGS+= -DWMFS_VERSION=\"${VERSION}\" - -OBJS= ${SRCS:.c=.o} - -all: ${PROG} ${MAN}.gz - -${PROG}: ${OBJS} src/structs.h src/wmfs.h src/parse/parse.h - ${CC} -o $@ ${OBJS} ${LDFLAGS} - -${MAN}.gz: ${MAN} - gzip -cn -9 ${MAN} > $@ - -.c.o: - ${CC} -c ${CFLAGS} $< -o $@ - -clean: - rm -f ${OBJS} wmfs ${MAN}.gz - -install: all - @echo installing executable file to ${DESTDIR}${PREFIX}/bin - mkdir -p ${DESTDIR}${PREFIX}/bin - install ${PROG} ${DESTDIR}${PREFIX}/bin - @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1 - mkdir -p ${DESTDIR}${MANPREFIX}/man1 - install -m 644 ${MAN}.gz ${DESTDIR}${MANPREFIX}/man1/ - @echo installing xsession file to ${DESTDIR}${PREFIX}/share/xsessions - mkdir -p ${DESTDIR}${PREFIX}/share/xsessions - install -m 644 wmfs.desktop ${DESTDIR}${PREFIX}/share/xsessions/ - @echo installing default config file to ${DESTDIR}${XDG_CONFIG_DIR} - mkdir -p ${DESTDIR}${XDG_CONFIG_DIR} - install -m 444 wmfsrc ${DESTDIR}${XDG_CONFIG_DIR} - -uninstall: - @echo removing executable file from ${DESTDIR}${PREFIX}/bin - rm -f ${DESTDIR}${PREFIX}/bin/wmfs - @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1 - rm -f ${DESTDIR}${MANPREFIX}/man1/wmfs.1.gz - @echo removing xsession file from ${DESTDIR}${PREFIX}/share/xsessions - rm -f ${DESTDIR}${PREFIX}/share/xsessions/wmfs.desktop - @echo removing config file from ${DESTDIR}${XDG_CONFIG_DIR} - rm -f ${DESTDIR}${XDG_CONFIG_DIR}/wmfsrc - - - -.PHONY: all clean install uninstall - From 6912599c720ee808c67eede26ae731adf3466aea Mon Sep 17 00:00:00 2001 From: Philippe Pepiot Date: Tue, 16 Nov 2010 19:15:39 +0100 Subject: [PATCH 09/14] BuildSystem: fix configure erase {C|LD}FLAGS --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 0dbbbb7..5a25878 100755 --- a/configure +++ b/configure @@ -86,8 +86,8 @@ PREFIX=$PREFIX XDG_CONFIG_DIR=$XDG_CONFIG_DIR MANPREFIX=$MANPREFIX -CFLAGS=$CFLAGS -LDFLAGS=$LDFLAGS +CFLAGS+=$CFLAGS +LDFLAGS+=$LDFLAGS EOF From 3d3dbf589f9ae907e0cfb96cf1c15bfa6ac942c7 Mon Sep 17 00:00:00 2001 From: Philippe Pepiot Date: Tue, 16 Nov 2010 21:28:51 +0100 Subject: [PATCH 10/14] BuildSystem: s/IMLIB2/IMLIB :> (thx to Erus) --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 5a25878..a6184a9 100755 --- a/configure +++ b/configure @@ -77,7 +77,7 @@ fi [ -n "$USE_XINERAMA" ] && CFLAGS="$CFLAGS -DHAVE_XINERAMA" [ -n "$USE_XRANDR" ] && CFLAGS="$CFLAGS -DHAVE_XRANDR" -[ -n "$USE_IMLIB2" ] && CFLAGS="$CFLAGS -DHAVE_IMLIB2" +[ -n "$USE_IMLIB2" ] && CFLAGS="$CFLAGS -DHAVE_IMLIB" LDFLAGS="$LDFLAGS -lpthread" From 3d6f8da805b93e02c6632c5b70ca955b56bd8229 Mon Sep 17 00:00:00 2001 From: Philippe Pepiot Date: Wed, 17 Nov 2010 01:24:57 +0100 Subject: [PATCH 11/14] Declare func_list const --- src/config.c | 6 +----- src/wmfs.c | 1 - src/wmfs.h | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/config.c b/src/config.c index 1e2b38e..0fe43a6 100644 --- a/src/config.c +++ b/src/config.c @@ -32,7 +32,7 @@ #include "wmfs.h" -func_name_list_t tmp_func_list[] = +const func_name_list_t func_list[] = { {"spawn", uicb_spawn }, {"client_kill", uicb_client_kill }, @@ -777,10 +777,6 @@ init_conf(void) } - /* Set func_list */ - func_list = emalloc(LEN(tmp_func_list), sizeof(func_name_list_t)); - memcpy(func_list, tmp_func_list, LEN(tmp_func_list) * sizeof(func_name_list_t)); - conf_misc_section(); conf_bar_section(); conf_root_section(); diff --git a/src/wmfs.c b/src/wmfs.c index cdbb923..422777c 100644 --- a/src/wmfs.c +++ b/src/wmfs.c @@ -104,7 +104,6 @@ quit(void) IFREE(spgeo); IFREE(infobar); IFREE(keys); - IFREE(func_list); IFREE(net_atom); /* Clean conf alloced thing */ diff --git a/src/wmfs.h b/src/wmfs.h index d6c88b9..bf54280 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -469,7 +469,7 @@ Client *clients; Client *sel; /* Other */ -func_name_list_t *func_list; +extern const func_name_list_t func_list[]; extern const func_name_list_t layout_list[]; uint numlockmask; Systray *trayicons; From 14f12edf258dcd9a62d277cc6eb1b783fee93d67 Mon Sep 17 00:00:00 2001 From: Philippe Pepiot Date: Wed, 17 Nov 2010 01:30:12 +0100 Subject: [PATCH 12/14] Remove non ansi comments --- src/wmfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wmfs.c b/src/wmfs.c index 422777c..95c809b 100644 --- a/src/wmfs.c +++ b/src/wmfs.c @@ -281,7 +281,7 @@ uicb_reload(uicb_t cmd) for(; argv_global[0] && argv_global[0] == ' '; ++argv_global); - // add -C to always load the same config file + /* add -C to always load the same config file */ execlp(argv_global, argv_global, "-C", conf.confpath, NULL); return; From b6c557a8ee06f5312371e77bcf0596c2d16d4161 Mon Sep 17 00:00:00 2001 From: Philippe Pepiot Date: Wed, 17 Nov 2010 01:30:35 +0100 Subject: [PATCH 13/14] Declare _POSIX_SOURCE for glib to define kill() --- src/wmfs.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wmfs.h b/src/wmfs.h index bf54280..a7ca2e3 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -33,7 +33,9 @@ #ifndef WMFS_H #define WMFS_H +/* glibc stuff */ #define _BSD_SOURCE /* vsnprintf */ +#define _POSIX_SOURCE /* kill() */ /* Lib headers */ #include From c2664e8e85349cf1a591ff76eaa85aa8bf1a227e Mon Sep 17 00:00:00 2001 From: Philippe Pepiot Date: Wed, 17 Nov 2010 02:27:15 +0100 Subject: [PATCH 14/14] wmfs compile with -W -Wall -Wextra (TODO: fix types !!) --- Makefile.in | 1 + src/barwin.c | 2 +- src/client.c | 37 ++++++++++++++++++++++++++++--------- src/config.c | 3 ++- src/draw.c | 3 ++- src/event.c | 7 ++++--- src/ewmh.c | 10 +++++----- src/infobar.c | 10 ++++++---- src/launcher.c | 4 ++-- src/layout.c | 33 +++++++++++++++++++++++++-------- src/menu.c | 2 ++ src/mouse.c | 4 +++- src/screen.c | 3 +++ src/status.c | 12 ++++++------ src/tag.c | 27 ++++++++++++++++++++------- src/util.c | 5 +++-- src/viwmfs.c | 6 +++--- src/wmfs.c | 16 +++++++++++----- 18 files changed, 127 insertions(+), 58 deletions(-) diff --git a/Makefile.in b/Makefile.in index 0d69de7..1b18832 100644 --- a/Makefile.in +++ b/Makefile.in @@ -32,6 +32,7 @@ src/wmfs.c # flags CFLAGS+= -DXDG_CONFIG_DIR=\"${XDG_CONFIG_DIR}\" CFLAGS+= -DWMFS_VERSION=\"${VERSION}\" +CFLAGS+= -W -Wall -Wextra -ansi OBJS= ${SRCS:.c=.o} diff --git a/src/barwin.c b/src/barwin.c index 7cdd641..b2170fe 100644 --- a/src/barwin.c +++ b/src/barwin.c @@ -293,7 +293,7 @@ barwin_refresh_color(BarWindow *bw) if(bw->stipple) { - XSetForeground(dpy, gc_stipple, ((bw->stipple_color != -1) ? bw->stipple_color : getcolor(bw->fg))); + XSetForeground(dpy, gc_stipple, ((bw->stipple_color != (uint)-1) ? (long)bw->stipple_color : getcolor(bw->fg))); XFillRectangle(dpy, bw->dr, gc_stipple, 3, 2, bw->geo.width - 6, bw->geo.height - 4); } diff --git a/src/client.c b/src/client.c index 904b008..23d7fbd 100644 --- a/src/client.c +++ b/src/client.c @@ -181,6 +181,7 @@ void uicb_client_prev(uicb_t cmd) { Client *c; + (void)cmd; if((c = client_get_prev())) { @@ -198,6 +199,7 @@ void uicb_client_next(uicb_t cmd) { Client *c; + (void)cmd; if((c = client_get_next())) { @@ -215,6 +217,7 @@ void uicb_client_swap_next(uicb_t cmd) { Client *c; + (void)cmd; if((c = client_get_next())) { @@ -232,6 +235,7 @@ void uicb_client_swap_prev(uicb_t cmd) { Client *c; + (void)cmd; if((c = client_get_prev())) { @@ -249,6 +253,7 @@ void uicb_client_focus_right(uicb_t cmd) { Client *c; + (void)cmd; if((c = client_get_next_with_direction(Right))) { @@ -267,6 +272,7 @@ void uicb_client_focus_left(uicb_t cmd) { Client *c; + (void)cmd; if((c = client_get_next_with_direction(Left))) { @@ -284,6 +290,7 @@ void uicb_client_focus_top(uicb_t cmd) { Client *c; + (void)cmd; if((c = client_get_next_with_direction(Top))) { @@ -301,6 +308,7 @@ void uicb_client_focus_bottom(uicb_t cmd) { Client *c; + (void)cmd; if((c = client_get_next_with_direction(Bottom))) { @@ -317,7 +325,9 @@ uicb_client_focus_bottom(uicb_t cmd) void client_above(Client *c) { - XRectangle geo = { 0 }; + XRectangle geo; + + memset(&geo, 0, sizeof(geo)); if(c->flags & AboveFlag) return; @@ -373,7 +383,7 @@ client_focus(Client *c) /* Set focusontag option */ for(cc = clients; cc; cc = cc->next) - if(cc->focusontag == c->tag) + if(cc->focusontag == (int)c->tag) cc->focusontag = -1; c->focusontag = seltag[selscreen]; @@ -559,7 +569,7 @@ client_hide(Client *c) Bool ishide(Client *c, int screen) { - if(((c->tag == seltag[screen] || c->tag == MAXTAG + 1) && c->screen == screen) + if(((c->tag == (uint)seltag[screen] || c->tag == MAXTAG + 1) && c->screen == screen) || tags[screen][seltag[screen]].tagad & TagFlag(c->tag)) return False; @@ -614,6 +624,7 @@ client_kill(Client *c) void uicb_client_kill(uicb_t cmd) { + (void)cmd; CHECK(sel); client_kill(sel); @@ -990,13 +1001,15 @@ client_swap(Client *c1, Client *c2) void client_set_rules(Client *c) { - XClassHint xch = { 0 }; + XClassHint xch; int i, j, k, f; Atom rf; ulong n, il; uchar *data = NULL; char wwrole[256] = { 0 }; + memset(&xch, 0, sizeof(xch)); + if(conf.ignore_next_client_rules) { conf.ignore_next_client_rules = False; @@ -1040,7 +1053,7 @@ client_set_rules(Client *c) c->screen = i; c->tag = j; - if(c->tag != seltag[selscreen]) + if(c->tag != (uint)seltag[selscreen]) { tags[c->screen][c->tag].request_update = True; client_focus(NULL); @@ -1074,7 +1087,7 @@ client_set_rules(Client *c) c->flags |= MaxFlag; } - if(c->tag != seltag[selscreen]) + if(c->tag != (uint)seltag[selscreen]) { tags[c->screen][c->tag].request_update = True; client_focus(NULL); @@ -1131,6 +1144,7 @@ client_raise(Client *c) void uicb_client_raise(uicb_t cmd) { + (void)cmd; CHECK(sel); client_raise(sel); @@ -1167,7 +1181,7 @@ client_focus_next(Client *c) && c_next->screen != c->screen; c_next = c_next->next); - if(c_next && c_next->tag == seltag[selscreen] + if(c_next && c_next->tag == (uint)seltag[selscreen] && c_next->screen == selscreen) client_focus(c_next); @@ -1204,7 +1218,7 @@ client_unmanage(Client *c) /* Arrange */ for(i = 0; i < screen_count() && !b; ++i) - if(c->tag == seltag[i] || tags[i][seltag[i]].tagad & TagFlag(c->tag)) + if(c->tag == (uint)seltag[i] || tags[i][seltag[i]].tagad & TagFlag(c->tag)) b = True; if(b) @@ -1299,6 +1313,7 @@ client_set_screen(Client *c, int s) void uicb_client_screen_next(uicb_t cmd) { + (void)cmd; CHECK(sel); client_set_screen(sel, (sel->screen + 1 > screen_count() - 1) ? 0 : sel->screen + 1); @@ -1312,6 +1327,7 @@ uicb_client_screen_next(uicb_t cmd) void uicb_client_screen_prev(uicb_t cmd) { + (void)cmd; CHECK(sel); client_set_screen(sel, (sel->screen - 1 < 0) ? screen_count() - 1 : sel->screen - 1); @@ -1384,6 +1400,7 @@ uicb_client_resize(uicb_t cmd) void uicb_ignore_next_client_rules(uicb_t cmd) { + (void)cmd; conf.ignore_next_client_rules = !conf.ignore_next_client_rules; return; @@ -1465,7 +1482,7 @@ uicb_client_select(uicb_t cmd) if(clist_index[i].client->screen != selscreen) screen_set_sel(clist_index[i].client->screen); - if(clist_index[i].client->tag != seltag[clist_index[i].client->screen]) + if(clist_index[i].client->tag != (uint)seltag[clist_index[i].client->screen]) tag_set(clist_index[i].client->tag); client_focus(clist_index[i].client); @@ -1487,6 +1504,7 @@ uicb_client_select(uicb_t cmd) Bool uicb_checkclist(uicb_t cmd) { + (void)cmd; return True; } @@ -1496,6 +1514,7 @@ uicb_checkclist(uicb_t cmd) void uicb_client_ignore_tag(uicb_t cmd) { + (void)cmd; CHECK(sel); screen_get_sel(); diff --git a/src/config.c b/src/config.c index 0fe43a6..6c1535e 100644 --- a/src/config.c +++ b/src/config.c @@ -725,7 +725,8 @@ conf_launcher_section(void) void conf_keybind_section(void) { - int i, j; + int i; + size_t j; struct conf_sec *sec, **ks; struct opt_type *opt; diff --git a/src/draw.c b/src/draw.c index 9ee9680..d163c0f 100644 --- a/src/draw.c +++ b/src/draw.c @@ -51,6 +51,7 @@ draw_image_ofset_text(Drawable d, int x, int y, char* fg, int pad, char *str, in { XftColor xftcolor; XftDraw *xftd; + (void)pad; if(!str) return; @@ -130,7 +131,7 @@ draw_rectangle(Drawable dr, int x, int y, uint w, uint h, uint color) void draw_graph(Drawable dr, int x, int y, uint w, uint h, uint color, char *data) { - int i; + uint i; XSetForeground(dpy, gc, color); diff --git a/src/event.c b/src/event.c index d7da88e..708b5a1 100644 --- a/src/event.c +++ b/src/event.c @@ -236,7 +236,7 @@ clientmessageevent(XClientMessageEvent *ev) /* Manage _NET_WM_DESKTOP */ if(mess_t == net_wm_desktop) - if((c = client_gb_win(ev->window)) && ev->data.l[0] != 0xFFFFFFFF) + if((c = client_gb_win(ev->window)) && ev->data.l[0] != (long)0xFFFFFFFF) tag_transfert(c, ev->data.l[0]); /* Manage _WMFS_STATUSTEXT_x */ @@ -446,7 +446,7 @@ focusin(XFocusChangeEvent *ev) void grabkeys(void) { - uint i; + int i; KeyCode code; XUngrabKey(dpy, AnyKey, AnyModifier, ROOT); @@ -468,7 +468,7 @@ grabkeys(void) void keypress(XKeyPressedEvent *ev) { - uint i; + int i; KeySym keysym; keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0); @@ -607,6 +607,7 @@ propertynotify(XPropertyEvent *ev) void reparentnotify(XReparentEvent *ev) { + (void)ev; return; } diff --git a/src/ewmh.c b/src/ewmh.c index eae2d50..f83fff3 100644 --- a/src/ewmh.c +++ b/src/ewmh.c @@ -357,7 +357,7 @@ void ewmh_manage_net_wm_state(long data_l[], Client *c) { /* Manage _NET_WM_STATE_FULLSCREEN */ - if(data_l[1] == net_atom[net_wm_state_fullscreen]) + if(data_l[1] == (long)net_atom[net_wm_state_fullscreen]) { if(data_l[0] == _NET_WM_STATE_ADD && !(c->flags & FSSFlag)) { @@ -392,14 +392,14 @@ ewmh_manage_net_wm_state(long data_l[], Client *c) } } /* Manage _NET_WM_STATE_STICKY */ - else if(data_l[1] == net_atom[net_wm_state_sticky]) + else if(data_l[1] == (long)net_atom[net_wm_state_sticky]) { /* == client_ignore_tag */ c->tag = MAXTAG + 1; arrange(c->screen, True); } /* Manage _NET_WM_STATE_DEMANDS_ATTENTION */ - else if(data_l[1] == net_atom[net_wm_state_demands_attention]) + else if(data_l[1] == (long)net_atom[net_wm_state_demands_attention]) { if(data_l[0] == _NET_WM_STATE_ADD) client_focus(c); @@ -419,8 +419,8 @@ void ewmh_manage_window_type(Client *c) { Atom *atom, rf; - int i, f; - ulong n, il; + int f; + ulong n, il, i; uchar *data = NULL; long ldata[5] = { 0 }; diff --git a/src/infobar.c b/src/infobar.c index 42678da..e6a255c 100644 --- a/src/infobar.c +++ b/src/infobar.c @@ -95,7 +95,7 @@ infobar_init(void) /* Create layout switch barwindow */ infobar[sc].layout_button = barwin_create(infobar[sc].bar->win, ((conf.layout_placement) ? 0 : (j + PAD / 2)), 0, - ((conf.layout_button_width > 0) ? conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)), + ((conf.layout_button_width > 0) ? (uint)conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)), infobar[sc].geo.height, conf.colors.layout_bg, conf.colors.layout_fg, False, False, conf.border.layout); @@ -159,7 +159,7 @@ infobar_draw_layout(int sc) if(!conf.layout_placement) barwin_move(infobar[sc].layout_button, infobar[sc].tags_board->geo.width + PAD / 2, 0); - barwin_resize(infobar[sc].layout_button, ((conf.layout_button_width > 0) ? conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)), infobar[sc].geo.height); + barwin_resize(infobar[sc].layout_button, ((conf.layout_button_width > 0) ? (uint)conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)), infobar[sc].geo.height); barwin_refresh_color(infobar[sc].layout_button); if(tags[sc][seltag[sc]].layout.symbol) @@ -193,7 +193,7 @@ infobar_draw_selbar(int sc) str = emalloc(conf.selbar.maxlength + 4, sizeof(char)); strncpy(str, sel->title, conf.selbar.maxlength); - if(strlen(sel->title) > conf.selbar.maxlength) + if(strlen(sel->title) > (size_t)conf.selbar.maxlength) strcat(str, "..."); } @@ -225,7 +225,7 @@ infobar_draw_taglist(int sc) Bool is_occupied[MAXTAG + 1]; if(conf.layout_placement) - barwin_move(infobar[sc].tags_board, ((conf.layout_button_width > 0) ? conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)) + PAD / 2, 0); + barwin_move(infobar[sc].tags_board, ((conf.layout_button_width > 0) ? (uint)conf.layout_button_width : (textw(tags[sc][seltag[sc]].layout.symbol) + PAD)) + PAD / 2, 0); for(i = 0; i < MAXTAG; i++) is_occupied[i] = False; @@ -393,6 +393,7 @@ infobar_set_position(int pos) void uicb_infobar_togglepos(uicb_t cmd) { + (void)cmd; screen_get_sel(); infobar_set_position((tags[selscreen][seltag[selscreen]].barpos @@ -410,6 +411,7 @@ void uicb_toggle_tagautohide(uicb_t cmd) { int i, x; + (void)cmd; screen_get_sel(); conf.tagautohide = !conf.tagautohide; diff --git a/src/launcher.c b/src/launcher.c index e2191f8..c34df81 100644 --- a/src/launcher.c +++ b/src/launcher.c @@ -108,14 +108,14 @@ launcher_execute(Launcher *launcher) case XK_Up: if(launcher->nhisto) { - if(histpos >= launcher->nhisto) + if(histpos >= (int)launcher->nhisto) histpos = 0; strncpy(buf, launcher->histo[launcher->nhisto - ++histpos], sizeof(buf)); pos = strlen(buf); } break; case XK_Down: - if(launcher->nhisto && histpos > 0 && histpos < launcher->nhisto) + if(launcher->nhisto && histpos > 0 && histpos < (int)launcher->nhisto) { strncpy(buf, launcher->histo[launcher->nhisto - --histpos], sizeof(buf)); pos = strlen(buf); diff --git a/src/layout.c b/src/layout.c index db75a91..cfa5061 100644 --- a/src/layout.c +++ b/src/layout.c @@ -65,6 +65,7 @@ void freelayout(int screen) { Client *c; + (void)screen; for(c = clients; c; c = c->next) if(!ishide(c, selscreen) @@ -92,7 +93,7 @@ layoutswitch(Bool b) screen_get_sel(); if(tags[selscreen][seltag[selscreen]].layout.func == freelayout) - for(c = clients; c && (c->tag != seltag[selscreen] && c->screen != selscreen); c = c->next) + for(c = clients; c && (c->tag != (uint)seltag[selscreen] && c->screen != selscreen); c = c->next) { c->ogeo = c->geo; c->free_geo = c->geo; @@ -124,6 +125,7 @@ layoutswitch(Bool b) void uicb_layout_next(uicb_t cmd) { + (void)cmd; layoutswitch(True); return; @@ -135,6 +137,7 @@ uicb_layout_next(uicb_t cmd) void uicb_layout_prev(uicb_t cmd) { + (void)cmd; layoutswitch(False); return; @@ -321,15 +324,15 @@ multi_tile(int screen, Position type) if(type == Top || type == Bottom) { if(type == Top) - mastergeo.y = (n <= nmaster) ? sg.y : sg.y + (sg.height - mwfact) - BORDH; + mastergeo.y = (n <= nmaster) ? (uint)sg.y : sg.y + (sg.height - mwfact) - BORDH; mastergeo.width = (sg.width / nmaster) - (BORDH * 4); - mastergeo.height = (n <= nmaster) ? sg.height - BORDH : mwfact; + mastergeo.height = (n <= nmaster) ? (uint)(sg.height - BORDH) : mwfact; } else { if(type == Left) - mastergeo.x = (n <= nmaster) ? sg.x : (sg.x + sg.width) - mwfact - (BORDH * 2); - mastergeo.width = (n <= nmaster) ? sg.width - (BORDH * 2) : mwfact; + mastergeo.x = (n <= nmaster) ? (uint)sg.x : (sg.x + sg.width) - mwfact - (BORDH * 2); + mastergeo.width = (n <= nmaster) ? (uint)(sg.width - (BORDH * 2)) : mwfact; mastergeo.height = (sg.height / nmaster) - BORDH; } @@ -434,12 +437,15 @@ mirror(int screen, Bool horizontal) XRectangle sg = sgeo[screen]; XRectangle mastergeo = {sg.x, sg.y, sg.width, sg.height}; XRectangle cgeo = {sg.x, sg.y , sg.width, sg.height}; - XRectangle nextg[2] = { {0} }; + XRectangle nextg[2]; uint i, n, tilesize = 0, mwfact; uint nmaster = tags[screen][seltag[screen]].nmaster; int pa, imp; Bool isp = 0; + memset(&nextg[0], 0, sizeof(nextg[0])); + memset(&nextg[1], 0, sizeof(nextg[2])); + for(n = 0, c = tiled_client(screen, clients); c; c = tiled_client(screen, c->next), ++n); CHECK(n); @@ -687,6 +693,7 @@ grid_vertical(int screen) void uicb_tile_switch(uicb_t cmd) { + (void)cmd; layout_set_client_master (sel); return; } @@ -697,6 +704,8 @@ uicb_tile_switch(uicb_t cmd) void uicb_togglefree(uicb_t cmd) { + (void)cmd; + if(!sel || sel->screen != screen_get_sel() || (sel->flags & FSSFlag)) return; @@ -728,6 +737,8 @@ uicb_togglefree(uicb_t cmd) void uicb_togglemax(uicb_t cmd) { + (void)cmd; + if(!sel || ishide(sel, selscreen) || (sel->flags & HintFlag)|| (sel->flags & FSSFlag)) return; @@ -759,6 +770,7 @@ void uicb_toggle_resizehint(uicb_t cmd) { screen_get_sel(); + (void)cmd; tags[selscreen][seltag[selscreen]].resizehint = !tags[selscreen][seltag[selscreen]].resizehint; @@ -774,6 +786,7 @@ void uicb_toggle_abovefc(uicb_t cmd) { Client *c; + (void)cmd; screen_get_sel(); @@ -782,7 +795,7 @@ uicb_toggle_abovefc(uicb_t cmd) for(c = clients; c; c = c->next) if(c->flags & AboveFlag && c->screen == selscreen - && c->tag == seltag[selscreen]) + && c->tag == (uint)seltag[selscreen]) { c->flags &= ~AboveFlag; break; @@ -802,7 +815,7 @@ uicb_toggle_abovefc(uicb_t cmd) void uicb_set_layout(uicb_t cmd) { - int i, j, n; + size_t i, j, n; screen_get_sel(); @@ -850,6 +863,8 @@ layout_set_client_master(Client *c) Bool uicb_checkmax(uicb_t cmd) { + (void)cmd; + if(!sel) return False; @@ -865,6 +880,8 @@ uicb_checkmax(uicb_t cmd) Bool uicb_checkfree(uicb_t cmd) { + (void)cmd; + if(!sel) return False; diff --git a/src/menu.c b/src/menu.c index ece0138..12c0a13 100644 --- a/src/menu.c +++ b/src/menu.c @@ -354,6 +354,8 @@ menu_clear(Menu *menu) Bool menu_get_checkstring_needed(MenuItem *mi, int nitem) { + (void)mi; + (void)nitem; return True; } diff --git a/src/mouse.c b/src/mouse.c index 6907541..3d75f1f 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -319,7 +319,7 @@ mouse_resize(Client *c) void mouse_grabbuttons(Client *c, Bool focused) { - int i; + size_t i; uint but[] = {Button1, Button2, Button3, Button4, Button5}; XUngrabButton(dpy, AnyButton, AnyModifier, c->win); @@ -348,6 +348,7 @@ mouse_grabbuttons(Client *c, Bool focused) void uicb_mouse_move(uicb_t cmd) { + (void)cmd; CHECK(sel); mouse_move(sel); @@ -361,6 +362,7 @@ uicb_mouse_move(uicb_t cmd) void uicb_mouse_resize(uicb_t cmd) { + (void)cmd; CHECK(sel); mouse_resize(sel); diff --git a/src/screen.c b/src/screen.c index 2798208..bcf46ac 100644 --- a/src/screen.c +++ b/src/screen.c @@ -237,6 +237,7 @@ uicb_screen_select(uicb_t cmd) void uicb_screen_next(uicb_t cmd) { + (void)cmd; screen_get_sel(); selscreen = (selscreen + 1 > screen_count() - 1) ? 0 : selscreen + 1; @@ -252,6 +253,7 @@ uicb_screen_next(uicb_t cmd) void uicb_screen_prev(uicb_t cmd) { + (void)cmd; screen_get_sel(); selscreen = (selscreen - 1 < 0) ? screen_count() - 1 : selscreen - 1; @@ -267,6 +269,7 @@ uicb_screen_prev(uicb_t cmd) void uicb_screen_prev_sel(uicb_t cmd) { + (void)cmd; screen_get_sel(); screen_set_sel(prevselscreen); diff --git a/src/status.c b/src/status.c index 1331654..963a321 100644 --- a/src/status.c +++ b/src/status.c @@ -44,7 +44,7 @@ statustext_rectangle(StatusRec *r, char *str) char as; int n, i, j, k; - for(i = j = n = 0; i < strlen(str); ++i, ++j) + for(i = j = n = 0; i < (int)strlen(str); ++i, ++j) if(sscanf(&str[i], "\\b[%d;%d;%d;%d;#%x]%c", &r[n].x, &r[n].y, &r[n].w, &r[n].h, &r[n].color, &as) == 6 && as == '\\') for(++n, ++i, --j; str[i] != as || str[i - 1] != ']'; ++i); @@ -68,7 +68,7 @@ statustext_graph(StatusGraph *g, char *str) char as, c, *p; int n, i, j, k, m, w; - for(i = j = n = 0; i < strlen(str); ++i, ++j) + for(i = j = n = 0; i < (int)strlen(str); ++i, ++j) if(sscanf(&str[i], "\\g[%d;%d;%d;%d;#%x;%512[^]]]%c", &g[n].x, &g[n].y, &g[n].w, &g[n].h, &g[n].color, g[n].data, &as) == 7 && as == '\\') @@ -84,7 +84,7 @@ statustext_graph(StatusGraph *g, char *str) /* height limits */ if(c < 0) c = 0; - if(c > g[n].h) + if(c > (char)g[n].h) c = g[n].h; g[n].data[m] = c; p = strtok(NULL, ";"); @@ -118,7 +118,7 @@ statustext_text(StatusText *s, char *str) char as; int n, i, j, k; - for(i = j = n = 0; i < strlen(str); ++i, ++j) + for(i = j = n = 0; i < (int)strlen(str); ++i, ++j) if(sscanf(&str[i], "\\s[%d;%d;%7[^;];%512[^]]]%c", &s[n].x, &s[n].y, s[n].color, s[n].text, &as) == 5 && as == '\\') for(++n, ++i, --j; str[i] != as || str[i - 1] != ']'; ++i); @@ -146,7 +146,7 @@ statustext_normal(int sc, char *str) if(sc == conf.systray.screen) sw = systray_get_width(); - for(i = j = n = 0; i < strlen(str); ++i, ++j) + for(i = j = n = 0; i < (int)strlen(str); ++i, ++j) if(str[i] == '\\' && str[i + 1] == '#' && str[i + 8] == '\\') { ++n; @@ -164,7 +164,7 @@ statustext_normal(int sc, char *str) { strcpy(buf, strwc); - for(i = k = 0; i < strlen(str); ++i, ++k) + for(i = k = 0; i < (int)strlen(str); ++i, ++k) if(str[i] == '\\' && str[i + 1] == '#' && str[i + 8] == '\\') { /* Store current color in col[] */ diff --git a/src/tag.c b/src/tag.c index f509368..a731ecd 100644 --- a/src/tag.c +++ b/src/tag.c @@ -114,7 +114,7 @@ tag_set(int tag) /* No focusontag option found on any client, try to find the first of the tag */ if(!c) for(c = clients; c; c = c->next) - if(c->tag == seltag[selscreen] && c->screen == selscreen) + if(c->tag == (uint)seltag[selscreen] && c->screen == selscreen) break; client_focus((c) ? c : NULL); @@ -175,6 +175,7 @@ uicb_tag(uicb_t cmd) void uicb_tag_next(uicb_t cmd) { + (void)cmd; screen_get_sel(); tag_set(seltag[selscreen] + 1); @@ -188,6 +189,7 @@ uicb_tag_next(uicb_t cmd) void uicb_tag_prev(uicb_t cmd) { + (void)cmd; screen_get_sel(); tag_set(seltag[selscreen] - 1); @@ -204,6 +206,7 @@ uicb_tag_next_visible(uicb_t cmd) int i, tag; Client *c; Bool is_occupied[MAXTAG]; + (void)cmd; screen_get_sel(); @@ -247,6 +250,7 @@ uicb_tag_prev_visible(uicb_t cmd) int i, tag; Client *c; Bool is_occupied[MAXTAG]; + (void)cmd; screen_get_sel(); @@ -301,6 +305,7 @@ uicb_tagtransfert(uicb_t cmd) void uicb_tag_prev_sel(uicb_t cmd) { + (void)cmd; screen_get_sel(); tag_set(prevseltag[selscreen]); @@ -316,6 +321,7 @@ uicb_tagtransfert_next(uicb_t cmd) { CHECK(sel); int tag = seltag[selscreen] + 1; + (void)cmd; if(tag > conf.ntag[selscreen]) { @@ -336,6 +342,7 @@ uicb_tagtransfert_prev(uicb_t cmd) { CHECK(sel); int tag = seltag[selscreen] - 1; + (void)cmd; if(tag <= 0) { @@ -357,6 +364,8 @@ uicb_tag_urgent(uicb_t cmd) Client *c; Bool b = False; + (void)cmd; + /* Check if there is a urgent client */ for(c = clients; c; c = c->next) if(c->flags & UrgentFlag) @@ -428,9 +437,9 @@ tag_swap(int s, int t1, int t2) for(c = clients; c; c = c->next) { - if(c->screen == s && c->tag == t1) + if(c->screen == s && c->tag == (uint)t1) c->tag = t2; - else if(c->screen == s && c->tag == t2) + else if(c->screen == s && c->tag == (uint)t2) c->tag = t1; } @@ -459,6 +468,7 @@ uicb_tag_swap(uicb_t cmd) void uicb_tag_swap_next(uicb_t cmd) { + (void)cmd; screen_get_sel(); tag_swap(selscreen, seltag[selscreen], seltag[selscreen] + 1); @@ -472,6 +482,7 @@ uicb_tag_swap_next(uicb_t cmd) void uicb_tag_swap_previous(uicb_t cmd) { + (void)cmd; screen_get_sel(); tag_swap(selscreen, seltag[selscreen], seltag[selscreen] - 1); @@ -546,15 +557,17 @@ uicb_tag_new(uicb_t cmd) void tag_delete(int s, int tag) { - Tag t = { 0 }; + Tag t; Client *c; - int i; + size_t i; + + memset(&t, 0, sizeof(t)); if(tag < 0 || tag > conf.ntag[s] || conf.ntag[s] == 1) return; for(c = clients; c; c = c->next) - if(c->screen == s && c->tag == tag) + if(c->screen == s && c->tag == (uint)tag) { warnx("Client(s) present in this tag, can't delete it"); @@ -566,7 +579,7 @@ tag_delete(int s, int tag) tags[s][tag] = t; infobar[s].tags[tag] = NULL; - for(i = tag; i < conf.ntag[s] + 1; ++i) + for(i = tag; i < (size_t)conf.ntag[s] + 1; ++i) { /* Set clients tag because of shift */ for(c = clients; c; c = c->next) diff --git a/src/util.c b/src/util.c index 31807ca..a68baa6 100644 --- a/src/util.c +++ b/src/util.c @@ -209,7 +209,8 @@ spawn(const char *format, ...) char cmd[512]; va_list ap; pid_t pid, ret; - int p[2], len; + int p[2]; + size_t len; va_start(ap, format); len = vsnprintf(cmd, sizeof(cmd), format, ap); @@ -307,7 +308,7 @@ parse_image_block(ImageAttr *im, char *str) char as; int n, i, j, k; - for(i = j = n = 0; i < strlen(str); ++i, ++j) + for(i = j = n = 0; i < (int)strlen(str); ++i, ++j) if(sscanf(&str[i], "\\i[%d;%d;%d;%d;%512[^]]]%c", &im[n].x, &im[n].y, &im[n].w, &im[n].h, im[n].name, &as) == 6 && as == '\\') for(++n, ++i, --j; str[i] != as || str[i - 1] != ']'; ++i); diff --git a/src/viwmfs.c b/src/viwmfs.c index dd83410..d47b247 100644 --- a/src/viwmfs.c +++ b/src/viwmfs.c @@ -65,7 +65,7 @@ vicmd_to_uicb vicmd[] = void viwmfs_help(void) { - int i; + size_t i; char s[20]; printf("ViWMFS commands list:\n"); @@ -85,7 +85,7 @@ viwmfs_help(void) void viwmfs(int argc, char **argv) { - int i; + size_t i; char *cmd, str[256] = { 0 }; Bool e; @@ -94,7 +94,7 @@ viwmfs(int argc, char **argv) if(argc > 3) { - for(i = 2; i < argc; ++i) + for(i = 2; i < (size_t)argc; ++i) { strcat(str, argv[i]); diff --git a/src/wmfs.c b/src/wmfs.c index 95c809b..42f61e8 100644 --- a/src/wmfs.c +++ b/src/wmfs.c @@ -68,6 +68,8 @@ errorhandler(Display *d, XErrorEvent *event) int errorhandlerdummy(Display *d, XErrorEvent *event) { + (void)d; + (void)event; return 0; } @@ -77,7 +79,7 @@ void quit(void) { Client *c; - int i; + size_t i, len; /* Set the silent error handler */ XSetErrorHandler(errorhandlerdummy); @@ -111,7 +113,8 @@ quit(void) if(conf.menu) { - for(i = 0; i < LEN(conf.menu); ++i) + len = LEN(conf.menu); + for(i = 0; i < len; ++i) IFREE(conf.menu[i].item); IFREE(conf.menu); } @@ -192,6 +195,7 @@ mainloop(void) void uicb_quit(uicb_t cmd) { + (void)cmd; exiting = True; return; @@ -203,11 +207,11 @@ uicb_quit(uicb_t cmd) void scan(void) { - uint i, n; + uint n; XWindowAttributes wa; Window usl, usl2, *w = NULL; Atom rt; - int s, rf, tag = -1, screen = -1, free = -1; + int s, rf, tag = -1, screen = -1, free = -1, i; ulong ir, il; uchar *ret; Client *c; @@ -258,7 +262,7 @@ scan(void) /* Set update layout request */ for(c = clients; c; c = c->next) { - if(c->tag > conf.ntag[c->screen]) + if(c->tag > (uint)conf.ntag[c->screen]) c->tag = conf.ntag[c->screen]; tags[c->screen][c->tag].request_update = True; } @@ -277,6 +281,7 @@ scan(void) void uicb_reload(uicb_t cmd) { + (void)cmd; quit(); for(; argv_global[0] && argv_global[0] == ' '; ++argv_global); @@ -398,6 +403,7 @@ update_status(void) void signal_handle(int sig) { + (void)sig; exiting = True; quit(); exit(EXIT_SUCCESS);