# HG changeset patch # User mikael # Date 1112006207 0 # Node ID 0cd8025eebeed907542c43b066749074e0d8d81e # Parent 77e6bd2ccde6f79c41eebf2d7a993f0dcc4e645e [/trunk] Changeset 44 by mikael * Some more fixes. * We can now build with GNU99 gcc extensions. diff -r 77e6bd2ccde6 -r 0cd8025eebee mcabber/src/Makefile --- a/mcabber/src/Makefile Mon Mar 28 09:18:01 2005 +0000 +++ b/mcabber/src/Makefile Mon Mar 28 10:36:47 2005 +0000 @@ -11,6 +11,8 @@ # default = pentium # DEBUG=1 disable optimizations and build for debug # default = no +# GNU99=1 use GNU99 extensions +# default = no # # Targets: # all: build executable @@ -26,10 +28,11 @@ CPU ?= i386 JCLIENT = mcabber - +ifndef CC CC = gcc +endif CFLAGS = -Wall -W -pedantic -LD = gcc +LD = $(CC) LDLIBS = -lncurses -lpanel ifeq ($(DEBUG),1) @@ -39,6 +42,10 @@ LDFLAGS = -s endif +ifeq ($(GNU99),1) +CFLAGS += -std=gnu99 -D_GNU_SOURCE +endif + CP = cp -f SOURCES = \ @@ -72,7 +79,7 @@ -$(RM) $(JCLIENT) install: all - $(CP) $(JCLIENT) /usr/bin/$(JCLIENT) + $(CP) $(JCLIENT) /usr/local/bin/$(JCLIENT) #dep: $(SOURCES) # makedepend -f- -Ylydialog -- $(CFLAGS) -- $(SOURCES) > depend diff -r 77e6bd2ccde6 -r 0cd8025eebee mcabber/src/lang.c --- a/mcabber/src/lang.c Mon Mar 28 09:18:01 2005 +0000 +++ b/mcabber/src/lang.c Mon Mar 28 10:36:47 2005 +0000 @@ -4,7 +4,6 @@ #include #include - #include "utils.h" char Lang[100]; diff -r 77e6bd2ccde6 -r 0cd8025eebee mcabber/src/list.h --- a/mcabber/src/list.h Mon Mar 28 09:18:01 2005 +0000 +++ b/mcabber/src/list.h Mon Mar 28 10:36:47 2005 +0000 @@ -84,7 +84,8 @@ /** * list_del - deletes entry from list. * @entry: the element to delete from the list. - * Note: list_empty on entry does not return true after this, the entry is in an undefined state. + * Note: list_empty on entry does not return true after this, the entry is + * in an undefined state. */ static inline void list_del(struct list_head *entry) { @@ -128,7 +129,7 @@ } /** - * list_empty - tests whether a list is empty + * list_empty - test whether a list is empty * @head: the list to test. */ static inline int list_empty(struct list_head *head) @@ -188,7 +189,7 @@ ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) /** - * list_for_each_safe - iterate over a list safe against removal of list entry + * list_for_each_safe - iterate over a list safe against removal of list entry * @pos: the &struct list_head to use as a loop counter. * @n: another &struct list_head to use as temporary storage * @head: the head for your list. @@ -198,7 +199,8 @@ pos = n, n = pos->next) /** - * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry + * list_for_each_entry_safe - iterate over list of given type safe against + * removal of list entry * @pos: the type * to use as a loop counter. * @n: another type * to use as temporary storage * @head: the head for your list. diff -r 77e6bd2ccde6 -r 0cd8025eebee mcabber/src/main.c --- a/mcabber/src/main.c Mon Mar 28 09:18:01 2005 +0000 +++ b/mcabber/src/main.c Mon Mar 28 10:36:47 2005 +0000 @@ -4,6 +4,7 @@ #include #include #include +#include #include "utils.h" #include "screen.h" @@ -42,18 +43,18 @@ int nread; /* Turn echoing off and fail if we can't. */ - if (tcgetattr(fileno (stdin), &orig) != 0) + if (tcgetattr(fileno(stdin), &orig) != 0) return -1; new = orig; new.c_lflag &= ~ECHO; - if (tcsetattr(fileno (stdin), TCSAFLUSH, &new) != 0) + if (tcsetattr(fileno(stdin), TCSAFLUSH, &new) != 0) return -1; /* Read the password. */ nread = getline(passstr, n, stdin); /* Restore terminal. */ - (void) tcsetattr(fileno (stdin), TCSAFLUSH, &orig); + (void) tcsetattr(fileno(stdin), TCSAFLUSH, &orig); return (ssize_t)nread; } diff -r 77e6bd2ccde6 -r 0cd8025eebee mcabber/src/parsecfg.c --- a/mcabber/src/parsecfg.c Mon Mar 28 09:18:01 2005 +0000 +++ b/mcabber/src/parsecfg.c Mon Mar 28 10:36:47 2005 +0000 @@ -4,10 +4,8 @@ #include #include - #include "list.h" -/* Definicion de tipos */ #define MAX_LENGHT_INPUT 1024 #define cfg_entry(n) list_entry(n, cfg_entry_t, list) diff -r 77e6bd2ccde6 -r 0cd8025eebee mcabber/src/screen.c --- a/mcabber/src/screen.c Mon Mar 28 09:18:01 2005 +0000 +++ b/mcabber/src/screen.c Mon Mar 28 10:36:47 2005 +0000 @@ -15,7 +15,6 @@ #include "server.h" #include "list.h" -/* Definicion de tipos */ #define window_entry(n) list_entry(n, window_entry_t, list) LIST_HEAD(window_list); diff -r 77e6bd2ccde6 -r 0cd8025eebee mcabber/src/server.c --- a/mcabber/src/server.c Mon Mar 28 09:18:01 2005 +0000 +++ b/mcabber/src/server.c Mon Mar 28 10:36:47 2005 +0000 @@ -4,6 +4,9 @@ #include #include #include +#include +#include +#include #include "list.h" #include "parsecfg.h" @@ -17,7 +20,6 @@ #define JABBERPORT 5222 - /* Desc: poll data from server * * In : socket diff -r 77e6bd2ccde6 -r 0cd8025eebee mcabber/src/socket.c --- a/mcabber/src/socket.c Mon Mar 28 09:18:01 2005 +0000 +++ b/mcabber/src/socket.c Mon Mar 28 10:36:47 2005 +0000 @@ -3,12 +3,11 @@ #include #include #include -#include "utils.h" - -#include "socket.h" #include -#include "screen.h" // FIXME to be removed +#include "utils.h" +#include "socket.h" +#include "screen.h" /* Desc: create socket connection *