char *filename = NULL;
int maxnbrecords = 0;
int scale = 2;
+int dohash = 0;
int xoffset = 1;
int yoffset = 1;
endwin ();
+ if (dohash) {
+ printf ("hash: 0x%08x\n", computehash (board->tab));
+ }
+
if (nbrecords) {
int i;
printf ("records: ");
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
free (cache);
}
+uint32_t computehash (char *key)
+{
+ uint32_t hash = 3323198485ul;
+ for (;*key;++key) {
+ hash ^= *key;
+ hash *= 0x5bd1e995;
+ hash ^= hash >> 15;
+ }
+ return hash;
+}
+
/* vim: set ts=4 sw=4 et: */
#ifndef __FUNCTION_H__
#define __FUNCTION_H__
+#include <stdint.h>
+
#include "type.h"
#define CHECKALLOC(ptr) \
void freecache (cache_t *cache);
+uint32_t computehash (char *key);
+
#endif /* __FUNCTION_H__ */
/* vim: set ts=4 sw=4 et: */
rm -f wipe $(wildcard *.gcda *.gcno *.gcov *.glog)
$(call PASS, SUCCESS)
-tests: all
+tests: test.o
+ -rm -f $(ALLEXE)
+ LDFLAGS="$$LDFLAGS test.o" $(MAKE) all
$(MAKE) $(addprefix test_,$(ALLEXE))
## Main rules
--- /dev/null
+void __attribute__((constructor)) _checker (void)
+{
+ extern int dohash;
+ dohash = 1;
+}
+
+/* vim: set ts=4 sw=4 et: */