diff --git a/Makefile b/Makefile index 16ee700..ae53b01 100644 --- a/Makefile +++ b/Makefile @@ -109,7 +109,7 @@ TUNE8DBS_EXE = tune8dbs # --- Libraries -LDFLAGS = -static -lm -lz +LDFLAGS = -lm -lz -Wl,--wrap=time #LDFLAGS = -static -lm -lz -Wl,-Map,map.out @@ -125,7 +125,7 @@ CXX = g++ DEFS = -DINCLUDE_BOOKTOOL -DTEXT_BASED -DZLIB_STATIC WARNINGS = -Wall -Wcast-align -Wwrite-strings -Wstrict-prototypes -Winline -OPTS = -O4 -s -fomit-frame-pointer -falign-functions=32 +OPTS = -O4 -g -fsanitize=address,undefined -static-libasan -fno-omit-frame-pointer #OPTS = -O4 -s -fomit-frame-pointer -mtune=core2 -falign-functions=32 CFLAGS = $(OPTS) $(WARNINGS) $(DEFS) diff --git a/booktool.c b/booktool.c index 4274df1..1ce09b4 100644 --- a/booktool.c +++ b/booktool.c @@ -11,6 +11,7 @@ */ +#include "wrap_time.h" #include #include diff --git a/enddev.c b/enddev.c index 0f7994d..0444b02 100644 --- a/enddev.c +++ b/enddev.c @@ -10,6 +10,7 @@ Contents: */ +#include "wrap_time.h" #include diff --git a/practice.c b/practice.c index 2d42cb4..22aebe2 100644 --- a/practice.c +++ b/practice.c @@ -10,7 +10,7 @@ Contents: A small utility which enables the user to browse an opening book file. */ - +#include "wrap_time.h" #include #include diff --git a/tune8dbs.c b/tune8dbs.c index 49532c9..49a8477 100644 --- a/tune8dbs.c +++ b/tune8dbs.c @@ -13,6 +13,7 @@ errors. */ +#include "wrap_time.h" #include #include @@ -1146,7 +1147,7 @@ void pattern_setup( void ) { int pos; int pattern, mirror_pattern; int power3; - int flip8[6561], flip5[81], flip3[27]; + int flip8[6561], flip5[243], flip3[27]; int row[10]; /* The inverse patterns */ @@ -1887,7 +1888,7 @@ int main(int argc, char *argv[]) { if ( USE_PARITY ) parity.gradient = 0.0; if ( USE_A_FILE2X ) - for ( i = 0; i < 59059; i++ ) + for ( i = 0; i < 59049; i++ ) afile2x[i].gradient = 0.0; if ( USE_CORNER52 ) for ( i = 0; i < 59049; i++ ) diff --git a/wrap_time.h b/wrap_time.h new file mode 100644 index 0000000..9e0d28e --- /dev/null +++ b/wrap_time.h @@ -0,0 +1,14 @@ +#ifndef WRAP_TIME_H +#define WRAP_TIME_H + +long __wrap_time(long *__timer) { + static long time = 100; + time += 1; + long result = time / 100; + if (__timer != 0) { + *__timer = result; + } + return result; +} + +#endif // WRAP_TIME_H diff --git a/zebra.c b/zebra.c index 7874bcd..97e7536 100644 --- a/zebra.c +++ b/zebra.c @@ -12,6 +12,7 @@ +#include "wrap_time.h" #include #include #include