aboutsummaryrefslogtreecommitdiff
path: root/src/solvers/h48/gendata_eoesep.h
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2025-04-21 14:33:01 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2025-04-21 14:44:07 +0200
commit510a7471348788fccba6b7c4b9f7b7cc9aee6ba9 (patch)
tree58df7791242d9a4f52e80da93ad3af20ed5e3528 /src/solvers/h48/gendata_eoesep.h
parent1d9b8acfeece68c4f55d2499d8aed127f98a383c (diff)
downloadnissy-core-510a7471348788fccba6b7c4b9f7b7cc9aee6ba9.tar.gz
nissy-core-510a7471348788fccba6b7c4b9f7b7cc9aee6ba9.zip
Always use unsigned char * for data buffers
Before this commit I was inconsistently using one of void *, char * and uint8_t *.
Diffstat (limited to 'src/solvers/h48/gendata_eoesep.h')
-rw-r--r--src/solvers/h48/gendata_eoesep.h21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/solvers/h48/gendata_eoesep.h b/src/solvers/h48/gendata_eoesep.h
index 4bf5a84..f1e3d4c 100644
--- a/src/solvers/h48/gendata_eoesep.h
+++ b/src/solvers/h48/gendata_eoesep.h
@@ -1,7 +1,7 @@
1STATIC int64_t coord_eoesep_sym(cube_t, const uint32_t [static ESEP_MAX]); 1STATIC int64_t coord_eoesep_sym(cube_t, const uint32_t [static ESEP_MAX]);
2STATIC size_t gendata_esep_classes( 2STATIC size_t gendata_esep_classes(
3 uint32_t [static ESEP_MAX], uint16_t [static ESEP_CLASSES]); 3 uint32_t [static ESEP_MAX], uint16_t [static ESEP_CLASSES]);
4STATIC size_t gendata_eoesep(char *, uint8_t); 4STATIC size_t gendata_eoesep(unsigned char *, uint8_t);
5STATIC uint32_t gendata_eoesep_bfs(uint8_t, uint8_t [static EOESEP_BUF], 5STATIC uint32_t gendata_eoesep_bfs(uint8_t, uint8_t [static EOESEP_BUF],
6 uint32_t [static ESEP_MAX], uint16_t [static ESEP_CLASSES]); 6 uint32_t [static ESEP_MAX], uint16_t [static ESEP_CLASSES]);
7STATIC uint32_t gendata_eoesep_fromnew(uint8_t, uint8_t [static EOESEP_BUF], 7STATIC uint32_t gendata_eoesep_fromnew(uint8_t, uint8_t [static EOESEP_BUF],
@@ -14,7 +14,7 @@ STATIC bool gendata_eoesep_next(cube_t, uint8_t,
14 uint8_t [static EOESEP_BUF], uint32_t [static ESEP_MAX]); 14 uint8_t [static EOESEP_BUF], uint32_t [static ESEP_MAX]);
15STATIC uint8_t get_eoesep_pval( 15STATIC uint8_t get_eoesep_pval(
16 const uint8_t [static DIV_ROUND_UP(EOESEP_TABLESIZE, 2)], int64_t); 16 const uint8_t [static DIV_ROUND_UP(EOESEP_TABLESIZE, 2)], int64_t);
17STATIC uint8_t get_eoesep_pval_cube(const void *, cube_t); 17STATIC uint8_t get_eoesep_pval_cube(const unsigned char *, cube_t);
18STATIC void set_eoesep_pval( 18STATIC void set_eoesep_pval(
19 uint8_t [static DIV_ROUND_UP(EOESEP_TABLESIZE, 2)], int64_t, uint8_t); 19 uint8_t [static DIV_ROUND_UP(EOESEP_TABLESIZE, 2)], int64_t, uint8_t);
20 20
@@ -67,9 +67,10 @@ gendata_esep_classes(
67} 67}
68 68
69STATIC size_t 69STATIC size_t
70gendata_eoesep(char *buf, uint8_t maxdepth) 70gendata_eoesep(unsigned char *buf, uint8_t maxdepth)
71{ 71{
72 uint8_t *buf8, d; 72 uint8_t d;
73 unsigned char *buf8;
73 uint16_t rep[ESEP_CLASSES]; 74 uint16_t rep[ESEP_CLASSES];
74 uint32_t *esep_classes, done, level; 75 uint32_t *esep_classes, done, level;
75 int64_t coord; 76 int64_t coord;
@@ -81,7 +82,7 @@ gendata_eoesep(char *buf, uint8_t maxdepth)
81 LOG("Computing eoesep data\n"); 82 LOG("Computing eoesep data\n");
82 memset(buf, 0xFF, EOESEP_FULLSIZE); 83 memset(buf, 0xFF, EOESEP_FULLSIZE);
83 esep_classes = (uint32_t *)(buf + INFOSIZE); 84 esep_classes = (uint32_t *)(buf + INFOSIZE);
84 buf8 = (uint8_t *)(buf + INFOSIZE + 4*ESEP_MAX); 85 buf8 = buf + INFOSIZE + 4*ESEP_MAX;
85 gendata_esep_classes(esep_classes, rep); 86 gendata_esep_classes(esep_classes, rep);
86 87
87 info = (tableinfo_t) { 88 info = (tableinfo_t) {
@@ -258,17 +259,13 @@ get_eoesep_pval(
258} 259}
259 260
260STATIC uint8_t 261STATIC uint8_t
261get_eoesep_pval_cube(const void *data, cube_t c) 262get_eoesep_pval_cube(const unsigned char *data, cube_t c)
262{ 263{
263 int64_t coord; 264 int64_t coord;
264 const uint8_t *table;
265 const uint32_t *esep_classes;
266 265
267 esep_classes = (const uint32_t *)data; 266 coord = coord_eoesep_sym(c, (const uint32_t *)data);
268 table = (const uint8_t *)data + 4*ESEP_MAX;
269 coord = coord_eoesep_sym(c, esep_classes);
270 267
271 return get_eoesep_pval(table, coord); 268 return get_eoesep_pval(data + 4*ESEP_MAX, coord);
272} 269}
273 270
274STATIC void 271STATIC void

Generated with cgit - Back to sebastiano.tronto.net