From 0b526d533dc6e3d0d11b2c50d7c13a813379e7d6 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 2 Nov 2002 15:52:07 +0000 Subject: [PATCH] wrong database field --- src/Makefile | 42 ++++++++++++++++++++++++++++++------- src/common/gamecode/laws.c | 2 +- src/common/kernel/eressea.c | 2 +- src/eressea/main.c | 2 +- 4 files changed, 37 insertions(+), 11 deletions(-) diff --git a/src/Makefile b/src/Makefile index 482691a93..5a303cbbc 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,12 +1,38 @@ -TARGETS = subdirs +MODULES := common eressea common/triggers common/items common/spells common/races common/attributes common/gamecode common/kernel common/util common/modules -SUBDIRS = \ - common \ - eressea \ - mapper +CC = gcc +CFLAGS += -Wall -Wwrite-strings -Wstrict-prototypes \ + -Werror-implicit-function-declaration \ + -Wno-char-subscripts -# askalon +# look for include files in +# each of the modules +CFLAGS += -I/cygwin/usr/include +CFLAGS += -I. +CFLAGS += $(patsubst %,-I%,$(MODULES)) +# extra libraries if required +LIBS := +# each module will add to this +SRC := -include Makefile.include +# include the description for +# each module +include $(patsubst %,%/module.mk,$(MODULES)) +# determine the object files +OBJ := $(patsubst %.c,%.o, $(filter %.c,$(SRC))) \ + $(patsubst %.y,%.o, $(filter %.y,$(SRC))) +# link the program +eressea: $(OBJ) + $(CC) -o $@ $(OBJ) $(LIBS) -## more definitions +%.o: %.c + @echo Compiling $@ + @$(CC) $(CFLAGS) -c -o $@ $< + +# include the C include +# dependencies +include $(OBJ:.o=.d) +# calculate C include +# dependencies +%.d: %.c + gcc -MM -MG $(CFLAGS) $< > $@ diff --git a/src/common/gamecode/laws.c b/src/common/gamecode/laws.c index 673acc8b7..061ed939e 100644 --- a/src/common/gamecode/laws.c +++ b/src/common/gamecode/laws.c @@ -2624,7 +2624,7 @@ renumber_factions(void) a_remove(&f->attribs, rp->attrib); if (updatelog) fprintf(updatelog, "renum %s %s\n", itoa36(f->no), itoa36(rp->want)); if (f->subscription) fprintf(sqlstream, "UPDATE subscriptions set faction='%s' where " - "subscription=%u;\n", itoa36(rp->want), + "id=%u;\n", itoa36(rp->want), f->subscription); f->no = rp->want; register_faction_id(rp->want); diff --git a/src/common/kernel/eressea.c b/src/common/kernel/eressea.c index 9e10cec68..19bc4de6b 100644 --- a/src/common/kernel/eressea.c +++ b/src/common/kernel/eressea.c @@ -2400,7 +2400,7 @@ remove_empty_factions(boolean writedropouts) } } if (f->subscription) fprintf(sqlstream, "UPDATE subscriptions set status='DEAD' where " - "subscription=%u\n;", f->subscription); + "id=%u\n;", f->subscription); *fp = f->next; /* stripfaction(f); diff --git a/src/eressea/main.c b/src/eressea/main.c index 2010c30c2..ed6718c88 100644 --- a/src/eressea/main.c +++ b/src/eressea/main.c @@ -587,7 +587,7 @@ confirm_newbies(void) while (f) { if (!fval(f, FFL_DBENTRY)) { if (f->subscription) { - fprintf(sqlstream, "UPDATE subscriptions SET status='ACTIVE', faction='%s' WHERE subscription=%u;\n", itoa36(f->no), f->subscription); + fprintf(sqlstream, "UPDATE subscriptions SET status='ACTIVE', faction='%s' WHERE id=%u;\n", itoa36(f->no), f->subscription); fset(f, FFL_DBENTRY); } }