remove remaining warnings
This commit is contained in:
parent
612dd81b51
commit
dd1a5bfd32
4
Makefile
4
Makefile
@ -1,13 +1,13 @@
|
|||||||
CFILES=xcwd.c
|
CFILES=xcwd.c
|
||||||
CC=gcc
|
CC=gcc
|
||||||
CFLAGS=-Wall -Werror -std=gnu99
|
CFLAGS=-Wall -Werror -Wextra -pedantic -std=gnu99 -O2
|
||||||
LDFLAGS=-lX11
|
LDFLAGS=-lX11
|
||||||
EXE="xcwd"
|
EXE="xcwd"
|
||||||
O=${CFILES:.c=.o}
|
O=${CFILES:.c=.o}
|
||||||
prefix=/usr/
|
prefix=/usr/
|
||||||
|
|
||||||
${EXE}: clean ${O}
|
${EXE}: clean ${O}
|
||||||
${CC} -o $@ ${O} ${CFLAGS} ${LDFLAGS}
|
${CC} -o $@ ${O} ${CFLAGS} ${LDFLAGS}
|
||||||
|
|
||||||
.SUFFIXES: .c .o
|
.SUFFIXES: .c .o
|
||||||
.c.o:
|
.c.o:
|
||||||
|
9
xcwd.c
9
xcwd.c
@ -7,6 +7,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <strings.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <glob.h>
|
#include <glob.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@ -102,7 +103,7 @@ static char* windowStrings(Window focuswin, size_t *size, char* hint)
|
|||||||
Atom nameAtom = XInternAtom(dpy, hint, 1);
|
Atom nameAtom = XInternAtom(dpy, hint, 1);
|
||||||
Atom type;
|
Atom type;
|
||||||
int format;
|
int format;
|
||||||
int i;
|
unsigned int i;
|
||||||
unsigned long after;
|
unsigned long after;
|
||||||
unsigned char *data = 0;
|
unsigned char *data = 0;
|
||||||
char *ret = NULL;
|
char *ret = NULL;
|
||||||
@ -195,6 +196,9 @@ static void readPath(long pid)
|
|||||||
|
|
||||||
int main(int argc, const char *argv[])
|
int main(int argc, const char *argv[])
|
||||||
{
|
{
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
|
|
||||||
processes_t p;
|
processes_t p;
|
||||||
long pid;
|
long pid;
|
||||||
Window w = focusedWindow();
|
Window w = focusedWindow();
|
||||||
@ -211,8 +215,9 @@ int main(int argc, const char *argv[])
|
|||||||
else {
|
else {
|
||||||
size_t size;
|
size_t size;
|
||||||
char* strings;
|
char* strings;
|
||||||
int i;
|
unsigned int i;
|
||||||
struct proc_s *res = NULL, key;
|
struct proc_s *res = NULL, key;
|
||||||
|
|
||||||
qsort(p->ps, p->n, sizeof(struct proc_s), nameCmp);
|
qsort(p->ps, p->n, sizeof(struct proc_s), nameCmp);
|
||||||
strings = windowStrings(w, &size, "WM_CLASS");
|
strings = windowStrings(w, &size, "WM_CLASS");
|
||||||
for(i = 0; i < size; i += strlen(strings + i) + 1) {
|
for(i = 0; i < size; i += strlen(strings + i) + 1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user