aboutsummaryrefslogtreecommitdiff
path: root/src/solve_h48.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/solve_h48.h')
-rw-r--r--src/solve_h48.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/solve_h48.h b/src/solve_h48.h
index 8691d49..8be67b6 100644
--- a/src/solve_h48.h
+++ b/src/solve_h48.h
@@ -129,6 +129,9 @@ gendata_cocsep(void *buf, uint64_t *selfsim, cube_t *rep)
129 uint8_t i, j, visited[COCSEP_VISITEDSIZE]; 129 uint8_t i, j, visited[COCSEP_VISITEDSIZE];
130 dfsarg_cocsep_t arg; 130 dfsarg_cocsep_t arg;
131 131
132 if (buf == NULL)
133 goto gendata_cocsep_return_size;
134
132 buf32 = (uint32_t *)buf; 135 buf32 = (uint32_t *)buf;
133 info = buf32 + COCSEP_TABLESIZE; 136 info = buf32 + COCSEP_TABLESIZE;
134 memset(buf32, 0xFF, sizeof(uint32_t) * COCSEP_TABLESIZE); 137 memset(buf32, 0xFF, sizeof(uint32_t) * COCSEP_TABLESIZE);
@@ -165,6 +168,7 @@ gendata_cocsep(void *buf, uint64_t *selfsim, cube_t *rep)
165 for (j = 0; j < 10; j++) 168 for (j = 0; j < 10; j++)
166 DBG_LOG("%" PRIu8 ":\t%" PRIu32 "\n", j, info[j+2]); 169 DBG_LOG("%" PRIu8 ":\t%" PRIu32 "\n", j, info[j+2]);
167 170
171gendata_cocsep_return_size:
168 return COCSEP_FULLSIZE; 172 return COCSEP_FULLSIZE;
169} 173}
170 174
@@ -234,8 +238,12 @@ gendata_h48(void *buf, uint8_t h, uint8_t maxdepth)
234 cube_t crep[COCSEP_CLASSES]; 238 cube_t crep[COCSEP_CLASSES];
235 size_t cocsepsize, infosize; 239 size_t cocsepsize, infosize;
236 240
237 esep_max = (int64_t)ESEP_MAX(h); 241 infosize = 4 * maxdepth;
238 cocsepsize = gendata_cocsep(buf, selfsim, crep); 242 cocsepsize = gendata_cocsep(buf, selfsim, crep);
243 if (buf == NULL)
244 goto gendata_h48_return_size;
245
246 esep_max = (int64_t)ESEP_MAX(h);
239 cocsepdata = (uint32_t *)buf; 247 cocsepdata = (uint32_t *)buf;
240 buf32 = cocsepdata + cocsepsize / 4; 248 buf32 = cocsepdata + cocsepsize / 4;
241 info = buf32 + (ESEP_TABLESIZE(h, k) / sizeof(uint32_t)); 249 info = buf32 + (ESEP_TABLESIZE(h, k) / sizeof(uint32_t));
@@ -272,6 +280,7 @@ gendata_h48(void *buf, uint8_t h, uint8_t maxdepth)
272 for (j = 0; j <= info[0]; j++) 280 for (j = 0; j <= info[0]; j++)
273 DBG_LOG("%" PRIu8 ":\t%" PRIu32 "\n", j, info[j+1]); 281 DBG_LOG("%" PRIu8 ":\t%" PRIu32 "\n", j, info[j+1]);
274 282
283gendata_h48_return_size:
275 return cocsepsize + ESEP_TABLESIZE(h, k) + infosize; 284 return cocsepsize + ESEP_TABLESIZE(h, k) + infosize;
276} 285}
277 286

Generated with cgit - Back to sebastiano.tronto.net