diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/.gitignore | 8 | ||||
-rw-r--r-- | tools/Makefile | 8 | ||||
-rw-r--r-- | tools/lzcomp.c | 6 |
3 files changed, 17 insertions, 5 deletions
diff --git a/tools/.gitignore b/tools/.gitignore new file mode 100644 index 000000000..6fc2134d5 --- /dev/null +++ b/tools/.gitignore @@ -0,0 +1,8 @@ +gfx +lzcomp +md5 +palette +png_dimensions +pokemon_animation +pokemon_animation_graphics +scan_includes diff --git a/tools/Makefile b/tools/Makefile index 202961c3e..752658b06 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,8 +1,8 @@ -.PHONY: all +.PHONY: all clean CFLAGS := -std=c99 -all: \ +tools := \ lzcomp \ png_dimensions \ scan_includes \ @@ -11,7 +11,11 @@ all: \ pokemon_animation_graphics \ gfx \ md5 +all: $(tools) @: +clean: + rm -f $(tools) + %: %.c $(CC) $(CFLAGS) -o $@ $< diff --git a/tools/lzcomp.c b/tools/lzcomp.c index 1b7b32a5d..c3fae1001 100644 --- a/tools/lzcomp.c +++ b/tools/lzcomp.c @@ -177,11 +177,11 @@ struct command find_best_copy (const unsigned char * data, unsigned short positi struct command simple = {.command = 7}; struct command flipped = simple, backwards = simple; short count, offset; - if (count = scan_forwards(data + position, length - position, data, position, &offset)) + if ((count = scan_forwards(data + position, length - position, data, position, &offset))) simple = (struct command) {.command = 4, .count = count, .value = offset}; - if (count = scan_forwards(data + position, length - position, bitflipped, position, &offset)) + if ((count = scan_forwards(data + position, length - position, bitflipped, position, &offset))) flipped = (struct command) {.command = 5, .count = count, .value = offset}; - if (count = scan_backwards(data, length - position, position, &offset)) + if ((count = scan_backwards(data, length - position, position, &offset))) backwards = (struct command) {.command = 6, .count = count, .value = offset}; struct command command; switch (flags / 24) { |