aboutsummaryrefslogtreecommitdiff
path: root/tools/tool.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/tool.h')
-rw-r--r--tools/tool.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/tools/tool.h b/tools/tool.h
index 58721a2..77cdf34 100644
--- a/tools/tool.h
+++ b/tools/tool.h
@@ -11,12 +11,12 @@
11 11
12static void log_stderr(const char *, void *); 12static void log_stderr(const char *, void *);
13static double timerun(void (*)(void)); 13static double timerun(void (*)(void));
14static void writetable(const char *, int64_t, const char *); 14static void writetable(const unsigned char *, int64_t, const char *);
15static long long int generatetable(const char *, char **, 15static long long int generatetable(const char *, unsigned char **,
16 char [static NISSY_SIZE_DATAID]); 16 char [static NISSY_SIZE_DATAID]);
17static long long int derivetable( 17static long long int derivetable(
18 const char *, const char *, const char *, char **); 18 const char *, const char *, const char *, unsigned char **);
19static int getdata(const char *, char **, const char *); 19static int getdata(const char *, unsigned char **, const char *);
20static void gendata_run(const char *, uint64_t[static 21]); 20static void gendata_run(const char *, uint64_t[static 21]);
21static void derivedata_run( 21static void derivedata_run(
22 const char *, const char *, const char *, const char *); 22 const char *, const char *, const char *, const char *);
@@ -57,7 +57,7 @@ timerun(void (*run)(void))
57} 57}
58 58
59static void 59static void
60writetable(const char *buf, int64_t size, const char *filename) 60writetable(const unsigned char *buf, int64_t size, const char *filename)
61{ 61{
62 FILE *f; 62 FILE *f;
63 63
@@ -74,7 +74,7 @@ writetable(const char *buf, int64_t size, const char *filename)
74static long long int 74static long long int
75generatetable( 75generatetable(
76 const char *solver, 76 const char *solver,
77 char **buf, 77 unsigned char **buf,
78 char dataid[static NISSY_SIZE_DATAID] 78 char dataid[static NISSY_SIZE_DATAID]
79) 79)
80{ 80{
@@ -105,12 +105,13 @@ derivetable(
105 const char *solver_large, 105 const char *solver_large,
106 const char *solver_small, 106 const char *solver_small,
107 const char *filename_large, 107 const char *filename_large,
108 char **buf 108 unsigned char **buf
109) 109)
110{ 110{
111 uint8_t h, k; 111 uint8_t h, k;
112 long long int size, gensize; 112 long long int size, gensize;
113 char *fulltable, dataid[NISSY_SIZE_DATAID]; 113 char dataid[NISSY_SIZE_DATAID];
114 unsigned char *fulltable;
114 115
115 if (getdata(solver_large, &fulltable, filename_large) != 0) { 116 if (getdata(solver_large, &fulltable, filename_large) != 0) {
116 printf("Error reading full table.\n"); 117 printf("Error reading full table.\n");
@@ -149,7 +150,7 @@ derivetable_error_nofree:
149static int 150static int
150getdata( 151getdata(
151 const char *solver, 152 const char *solver,
152 char **buf, 153 unsigned char **buf,
153 const char *filename 154 const char *filename
154) { 155) {
155 long long int size, sizeread; 156 long long int size, sizeread;
@@ -194,7 +195,8 @@ gendata_run(
194 uint64_t expected[static 21] 195 uint64_t expected[static 21]
195) { 196) {
196 long long int size; 197 long long int size;
197 char *buf, filename[1024], dataid[NISSY_SIZE_DATAID]; 198 char filename[1024], dataid[NISSY_SIZE_DATAID];
199 unsigned char *buf;
198 200
199 size = generatetable(solver, &buf, dataid); 201 size = generatetable(solver, &buf, dataid);
200 sprintf(filename, "tables/%s", dataid); 202 sprintf(filename, "tables/%s", dataid);
@@ -227,7 +229,7 @@ derivedata_run(
227) 229)
228{ 230{
229 long long int size; 231 long long int size;
230 char *buf; 232 unsigned char *buf;
231 233
232 buf = NULL; 234 buf = NULL;
233 size = derivetable(solver_large, solver_small, filename_large, &buf); 235 size = derivetable(solver_large, solver_small, filename_large, &buf);

Generated with cgit - Back to sebastiano.tronto.net