generic changes

master
Nicholas Hope 2022-10-06 18:11:26 -04:00
parent a200e3a1a2
commit e8cf287ebe
3 changed files with 12 additions and 11 deletions

View File

@ -21,16 +21,17 @@ find_one ?= 0
fancy ?= 0
free ?= 0
# note: setting deleted to 0 doesn't get any extra words,
# but does just about triple the execution time.
# I do not recommend setting it to false.
delete ?= 1
CC := clang
MACROS := -DPRINT_INTERMEDIATES=$(printing) -DTIME_SECTIONS=$(timing) -DASSUME_SAFE=$(assume) -DFIND_ONE=$(find_one) -DDELETE=$(delete) -DFANCYPRINT=$(fancy) -DFREE=$(free)
ifdef asm
override asm = -S
else
override asm =
endif
FLAGS := -Ofast -Wall -Werror
MACROS := -DPRINT_INTERMEDIATES=$(printing) -DTIME_SECTIONS=$(timing) -DASSUME_SAFE=$(assume) -DFIND_ONE=$(find_one) -DFANCYPRINT=$(fancy) -DFREE=$(free) $(asm)
FLAGS := -Wall -Werror -Ofast
OUTPUT := -o bw
bw: solvedle.o boilerplate.o
@ -52,9 +53,9 @@ run: bw wordleWords.txt
.PHONY: fast
fast: solvedle.c boilerplate.c
$(CC) $(FLAGS) -DPRINT_INTERMEDIATES=0 -DTIME_SECTIONS=0 -DASSUME_SAFE=1 -DFIND_ONE=1 -DDELETE=1 -DFANCYPRINT=0 -DFREE=0 -c $^
$(CC) $(FLAGS) -DPRINT_INTERMEDIATES=0 -DTIME_SECTIONS=0 -DASSUME_SAFE=1 -DFIND_ONE=1 -DFANCYPRINT=0 -DFREE=0 -c $^
make bw
.PHONY: clean
clean:
rm *.o bw
rm *.o *.s bw

View File

@ -48,7 +48,7 @@ signature* makeArray(FILE * f, uint32_t* arrlen) {
uint32_t s = getsig(word);
if (s != 0) {
// no duplicate word letters in word
sigs[i].word = strndup(word, 5);
memcpy(sigs[i].word, word, 5);
sigs[i].sign = s;
i++;
}

View File

@ -57,7 +57,7 @@ uint32_t rawWC = 0;
/* </defines> */
typedef struct signature {
char * word;
char word[5];
uint32_t sign;
} signature;