aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano.tronto@gmail.com>2021-11-17 00:16:39 +0100
committerSebastiano Tronto <sebastiano.tronto@gmail.com>2021-11-17 00:16:39 +0100
commit0df4f6f98101bb3be192ce892aa1452f2c6de1a4 (patch)
tree8bd047e4e247812495b1fdb489e2e37c2cf14224
parent20ac0e60d7174114965d4419af0bb3028db8e447 (diff)
downloadnissy-0df4f6f98101bb3be192ce892aa1452f2c6de1a4.tar.gz
nissy-0df4f6f98101bb3be192ce892aa1452f2c6de1a4.zip
Use inttypes.h macros to print uint64_t variables (this requires -std=c99). Added a couple of TODOs
Diffstat (limited to '')
-rw-r--r--Makefile4
-rw-r--r--TODO.md6
-rw-r--r--nissy-2.0beta2.tar.gzbin51308 -> 51606 bytes
-rw-r--r--src/cubetypes.h2
-rw-r--r--src/pruning.c16
-rw-r--r--src/symcoord.c2
6 files changed, 17 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 1e4d1c6..cb7b898 100644
--- a/Makefile
+++ b/Makefile
@@ -6,8 +6,8 @@ PREFIX = /usr/local
6MANPREFIX = ${PREFIX}/share/man 6MANPREFIX = ${PREFIX}/share/man
7 7
8CPPFLAGS = -DVERSION=\"${VERSION}\" 8CPPFLAGS = -DVERSION=\"${VERSION}\"
9CFLAGS = -pedantic -Wall -Wextra -Wno-unused-parameter -O3 ${CPPFLAGS} 9CFLAGS = -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter -O3 ${CPPFLAGS}
10DBGFLAGS = -pedantic -Wall -Wextra -Wno-unused-parameter -g ${CPPFLAGS} 10DBGFLAGS = -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter -g ${CPPFLAGS}
11 11
12CC = cc 12CC = cc
13 13
diff --git a/TODO.md b/TODO.md
index 4ccce22..0172dd8 100644
--- a/TODO.md
+++ b/TODO.md
@@ -34,12 +34,18 @@ It's more of a personal reminder than anything else.
34 34
35* make env.c compatible with Windows (and check that it works with 35* make env.c compatible with Windows (and check that it works with
36 BSD/MacOS) 36 BSD/MacOS)
37* default to current directory for tables; this will work on any OS, up to
38 using the correct #ifdef guards to avoid checking for posix directories
39 in non-posix systems
37* better internal help page for each command (take it from man page) 40* better internal help page for each command (take it from man page)
38* better man page 41* better man page
39* find a better way to distribute the large tables, especially khuge 42* find a better way to distribute the large tables, especially khuge
40 43
41## Technical stuff 44## Technical stuff
42 45
46### Small fixes
47* printf with stdint.h: use proper macros instead of %llu
48
43### Better pruning tables 49### Better pruning tables
44* Use pruning values mod 4 instead of mod 16 50* Use pruning values mod 4 instead of mod 16
45 51
diff --git a/nissy-2.0beta2.tar.gz b/nissy-2.0beta2.tar.gz
index 8143d58..9865c19 100644
--- a/nissy-2.0beta2.tar.gz
+++ b/nissy-2.0beta2.tar.gz
Binary files differ
diff --git a/src/cubetypes.h b/src/cubetypes.h
index 4997f3a..334662c 100644
--- a/src/cubetypes.h
+++ b/src/cubetypes.h
@@ -2,7 +2,7 @@
2#define CUBETYPES_H 2#define CUBETYPES_H
3 3
4#include <stdbool.h> 4#include <stdbool.h>
5#include <stdint.h> 5#include <inttypes.h>
6 6
7#define NMOVES 55 /* Actually 55, but one is NULLMOVE */ 7#define NMOVES 55 /* Actually 55, but one is NULLMOVE */
8#define NTRANS 48 8#define NTRANS 48
diff --git a/src/pruning.c b/src/pruning.c
index 11705c5..1369892 100644
--- a/src/pruning.c
+++ b/src/pruning.c
@@ -127,7 +127,8 @@ genptable(PruneData *pd)
127 for (j = 0; j < pd->coord->max; j++) 127 for (j = 0; j < pd->coord->max; j++)
128 dfs_set_visited_index(&dd, j, false); 128 dfs_set_visited_index(&dd, j, false);
129 genptable_dfs((Cube){0}, pd, &dd); 129 genptable_dfs((Cube){0}, pd, &dd);
130 fprintf(stderr, "Depth %d done, generated %lu\t(%lu/%lu)\n", 130 fprintf(stderr, "Depth %d done, generated %"
131 PRIu64 "\t(%" PRIu64 "/%" PRIu64 ")\n",
131 dd.d+1, pd->n - oldn, pd->n, pd->coord->max); 132 dd.d+1, pd->n - oldn, pd->n, pd->coord->max);
132 oldn = pd->n; 133 oldn = pd->n;
133 } 134 }
@@ -169,12 +170,14 @@ genptable(PruneData *pd)
169 ptable_update(pd, (Cube){0}, 0); 170 ptable_update(pd, (Cube){0}, 0);
170 pd->n = 1; 171 pd->n = 1;
171 oldn = 0; 172 oldn = 0;
172 fprintf(stderr, "Depth %d done, generated %lu\t(%lu/%lu)\n", 173 fprintf(stderr, "Depth %d done, generated %"
174 PRIu64 "\t(%" PRIu64 "/%" PRIu64 ")\n",
173 0, pd->n - oldn, pd->n, pd->coord->max); 175 0, pd->n - oldn, pd->n, pd->coord->max);
174 oldn = 1; 176 oldn = 1;
175 for (d = 0; d < 15 && pd->n < pd->coord->max; d++) { 177 for (d = 0; d < 15 && pd->n < pd->coord->max; d++) {
176 genptable_bfs(pd, d, ms); 178 genptable_bfs(pd, d, ms);
177 fprintf(stderr, "Depth %d done, generated %lu\t(%lu/%lu)\n", 179 fprintf(stderr, "Depth %d done, generated %"
180 PRIu64 "\t(%" PRIu64 "/%" PRIu64 ")\n",
178 d+1, pd->n - oldn, pd->n, pd->coord->max); 181 d+1, pd->n - oldn, pd->n, pd->coord->max);
179 oldn = pd->n; 182 oldn = pd->n;
180 } 183 }
@@ -193,11 +196,6 @@ genptable_dfs(Cube c, PruneData *pd, DfsData *dd)
193 Move mm; 196 Move mm;
194 Cube cc; 197 Cube cc;
195 198
196 if (pd->coord->index(c) > 2*ptablesize(pd)) {
197 printf("error! %lu > %lu\n", pd->coord->index(c), 2*ptablesize(pd));
198 print_cube(c);
199 exit(1);
200 }
201 pv = ptableval(pd, c); 199 pv = ptableval(pd, c);
202 200
203 if (pv < dd->m || dd->m > dd->d) 201 if (pv < dd->m || dd->m > dd->d)
@@ -303,7 +301,7 @@ print_ptable(PruneData *pd)
303 301
304 fprintf(stderr, "Values for table %s\n", pd->filename); 302 fprintf(stderr, "Values for table %s\n", pd->filename);
305 for (i = 0; i < 16; i++) 303 for (i = 0; i < 16; i++)
306 printf("%2lu\t%10lu\n", i, a[i]); 304 printf("%2" PRIu64 "\t%10" PRIu64 "\n", i, a[i]);
307} 305}
308 306
309uint64_t 307uint64_t
diff --git a/src/symcoord.c b/src/symcoord.c
index e9374d7..798a946 100644
--- a/src/symcoord.c
+++ b/src/symcoord.c
@@ -286,7 +286,7 @@ gensym(SymData *sd)
286 sd->rep = realloc(sd->rep, nreps * sizeof(Cube)); 286 sd->rep = realloc(sd->rep, nreps * sizeof(Cube));
287 sd->generated = true; 287 sd->generated = true;
288 288
289 fprintf(stderr, "Found %lu classes\n", nreps); 289 fprintf(stderr, "Found %" PRIu64 " classes\n", nreps);
290 290
291 if (!write_symdata_file(sd)) 291 if (!write_symdata_file(sd))
292 fprintf(stderr, "Error writing SymData file\n"); 292 fprintf(stderr, "Error writing SymData file\n");

Generated with cgit - Back to sebastiano.tronto.net