From ac35a296f50e79aa248f6eb3303e531ed83da58a Mon Sep 17 00:00:00 2001 From: sECuRE Date: Tue, 23 Oct 2007 14:01:25 +0000 Subject: [PATCH] fix time.c/h, fix test.c git-svn-id: https://shell.noname-ev.de/svn/kasse/c128@53 af93e077-1a23-4f1e-9cbe-9382a9d578f5 --- Makefile | 16 ++++++++++------ include/{time.h => c128time.h} | 0 src/{time.c => c128time.c} | 0 src/kasse.c | 2 +- test/test.c | 18 +++++++++++------- 5 files changed, 22 insertions(+), 14 deletions(-) rename include/{time.h => c128time.h} (100%) rename src/{time.c => c128time.c} (100%) diff --git a/Makefile b/Makefile index 9224028..6b88441 100644 --- a/Makefile +++ b/Makefile @@ -8,13 +8,17 @@ CL=~/customSoftware/cc65-2.11.0/src/cl65/cl65 # CL=cl65 src/%.o: src/%.c include/%.h - ${CC} -I include -t c128 $< + ${CC} -O -I include -t c128 $< ${CA} -I include -t c128 src/$$(basename $< .c).s -all: src/config.o src/kasse.o src/general.o src/credit_manager.o src/time.o +test/%.o: test/%.c + ${CC} -O -I include -t c128 $< + ${CA} -I include -t c128 test/$$(basename $< .c).s + +all: src/config.o src/kasse.o src/general.o src/credit_manager.o src/c128time.o # See above, please just kill the PATH-definition cp /tmp/cc65/lib/c128* . - PATH=${PATH}:~/customSoftware/cc65-2.11.0/src/ld65:/tmp/cc65/lib ${CL} -t c128 -O src/*.o -o kasse + PATH=${PATH}:~/customSoftware/cc65-2.11.0/src/ld65:/tmp/cc65/lib ${CL} -t c128 src/*.o -o kasse package: all c1541 -attach kasse.d64 -delete state || exit 0 @@ -24,8 +28,8 @@ package: all c1541 -attach kasse.d64 -write state || exit 0 c1541 -attach kasse.d64 -write items || exit 0 -test: config.o test.o general.o - ${CL} -t c128 config.o test.o general.o -o test +test: src/config.o test/test.o src/general.o + ${CL} -t c128 src/config.o test/test.o src/general.o -o test test-package: test c1541 -attach test.d64 -delete state || exit 0 @@ -36,7 +40,7 @@ test-package: test c1541 -attach test.d64 -write items || exit 0 clean: - rm -rf src/*.o src/*.s + rm -rf src/*.o src/*.s test/*.o test/*.s dist-clean: clean rm kasse test diff --git a/include/time.h b/include/c128time.h similarity index 100% rename from include/time.h rename to include/c128time.h diff --git a/src/time.c b/src/c128time.c similarity index 100% rename from src/time.c rename to src/c128time.c diff --git a/src/kasse.c b/src/kasse.c index 46d17bd..b000ed4 100644 --- a/src/kasse.c +++ b/src/kasse.c @@ -8,7 +8,7 @@ #include "config.h" #include "kasse.h" #include "credit_manager.h" -#include "time.h" +#include "c128time.h" // drucker 4 oder 5 // graphic 4,0,10 diff --git a/test/test.c b/test/test.c index ea603ed..4873d87 100644 --- a/test/test.c +++ b/test/test.c @@ -13,18 +13,22 @@ int main(){ char euro[10]; load_items(); load_state(); - for (i=0; i < num_items; ++i) { - cprintf("%x: %s (%s, %d mal)\n", i, status[i].item_name, format_euro(euro, 9, status[i].price), status[i].times_sold); - status[i].times_sold+=10; + for (i=0; i < status.num_items; ++i) { + cprintf("%x: %s (%s, %d mal)\n", + i, status.status[i].item_name, format_euro(euro, 9, status.status[i].price), + status.status[i].times_sold); + status.status[i].times_sold += 10; } save_state(); load_items(); load_state(); - for (i=0; i < num_items; ++i) { - cprintf("%x: %s (%s, %d mal)\n", i, status[i].item_name, format_euro(euro, 9, status[i].price), status[i].times_sold); + for (i=0; i < status.num_items; ++i) { + cprintf("%x: %s (%s, %d mal)\n", + i, status.status[i].item_name, format_euro(euro, 9, status.status[i].price), + status.status[i].times_sold); } - cprintf("strlen(%s)==%d\n", status[1].item_name, strlen(status[1].item_name)); - cprintf("%d %d %d\n", status[1].item_name[0], '\r', '\n'); + cprintf("strlen(%s)==%d\n", status.status[1].item_name, strlen(status.status[1].item_name)); + cprintf("%d %d %d\n", status.status[1].item_name[0], '\r', '\n'); } -- 2.39.5