From 042e3fde77d85b0f0be8e1e13d674632fe5750a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Mon, 3 Nov 2014 10:46:19 +0100 Subject: [PATCH 1/3] Add basic gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8f5ca8b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/2048* From dfcc1f56347160be2ef4553e3bc4bfa1752d8716 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Mon, 3 Nov 2014 10:21:31 +0100 Subject: [PATCH 2/3] Makefile should obey LDFLAGS from $ENV --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 92c2ff5..dc28d95 100644 --- a/Makefile +++ b/Makefile @@ -5,10 +5,10 @@ LIBS = -lcurses all: 2048 2048: src/2048.c src/2048.h src/highscore_file.c - $(CC) $(CFLAGS) src/2048.c src/highscore_file.c -o 2048 $(LIBS) + $(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) src/2048.c src/highscore_file.c -o 2048 2048nc: src/2048_no_curses.c src/2048.h src/highscore_file.c - $(CC) $(CFLAGS) src/2048_no_curses.c src/highscore_file.c -o 2048nc + $(CC) $(CFLAGS) $(LDFLAGS) src/2048_no_curses.c src/highscore_file.c -o 2048nc clean: rm -f 2048 2048nc From 27fd8b32186317aa76f40d5f9e13540bfa7a343a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Mon, 3 Nov 2014 10:45:21 +0100 Subject: [PATCH 3/3] Fix compiler warnings about unused result --- src/2048.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/2048.c b/src/2048.c index 4f18260..d1c8f1c 100644 --- a/src/2048.c +++ b/src/2048.c @@ -163,7 +163,7 @@ int get_score_high() { if (fd == NULL) fd = fopen(HISCORE_FILE, "w+"); - fscanf(fd, "%d", &s); + if (fscanf(fd, "%d", &s) == 1) {}; fclose(fd); return s; }