From 66feaab027142b014c01c68921213e8b4f4249ef Mon Sep 17 00:00:00 2001 From: Ole Morud Date: Fri, 19 Dec 2025 04:19:00 +0100 Subject: [PATCH] rename base.h -> engine.h and fix bugs in codegen --- Makefile | 2 +- codegen.c | 8 +++++--- base.h => engine.h | 0 libc-lite.h | 2 ++ tests.c | 2 +- wasm-compat.c | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) rename base.h => engine.h (100%) diff --git a/Makefile b/Makefile index 5d5eef4..679ff8b 100644 --- a/Makefile +++ b/Makefile @@ -30,5 +30,5 @@ mbb_rook.h: codegen mbb_bishop.h: codegen ./codegen -tests: tests.c mbb_rook.h mbb_bishop.h base.h +tests: tests.c mbb_rook.h mbb_bishop.h engine.h $(CC) -o $@ $(CFLAGS) tests.c diff --git a/codegen.c b/codegen.c index 8859586..dcaf1ea 100644 --- a/codegen.c +++ b/codegen.c @@ -1,5 +1,7 @@ #define CODEGEN -#include "base.h" +#include "engine.h" +#include "libc-lite.h" +#include "board_print.h" #include #include @@ -64,7 +66,7 @@ int main() /* brute force the magic number */ for (;;) { - bitboard magic = rand64() & rand64() & rand64(); + bitboard magic = my_rand64() & my_rand64() & my_rand64(); bitboard atk = 0ULL; for (bitboard test = 0; test < (1ULL< #include #include diff --git a/tests.c b/tests.c index d23deb0..2bb2d86 100644 --- a/tests.c +++ b/tests.c @@ -2,7 +2,7 @@ #define _XOPEN_SOURCE 500 #include /* usleep */ -#include "base.h" +#include "engine.h" #include "board_print.h" #include diff --git a/wasm-compat.c b/wasm-compat.c index 07e819a..8b36033 100644 --- a/wasm-compat.c +++ b/wasm-compat.c @@ -1,5 +1,5 @@ -#include "base.h" +#include "engine.h" #include