aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/solvers/h48/gendata_h48.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/solvers/h48/gendata_h48.h b/src/solvers/h48/gendata_h48.h
index 890aad8..15b7589 100644
--- a/src/solvers/h48/gendata_h48.h
+++ b/src/solvers/h48/gendata_h48.h
@@ -507,8 +507,7 @@ get_h48_pval(const unsigned char *table, uint64_t i)
507STATIC_INLINE uint8_t 507STATIC_INLINE uint8_t
508get_h48_pvalmin(const unsigned char *table, uint64_t i) 508get_h48_pvalmin(const unsigned char *table, uint64_t i)
509{ 509{
510 return (get_h48_pval(table, i) << UINT8_C(2)) + 510 return table[H48_INDEX(i)] >> UINT8_C(4);
511 get_h48_pval(table, i+UINT64_C(1));
512} 511}
513 512
514STATIC_INLINE void 513STATIC_INLINE void
@@ -521,9 +520,9 @@ set_h48_pval(unsigned char *table, uint64_t i, uint8_t val)
521STATIC_INLINE void 520STATIC_INLINE void
522set_h48_pvalmin(unsigned char *table, uint64_t i, uint8_t val) 521set_h48_pvalmin(unsigned char *table, uint64_t i, uint8_t val)
523{ 522{
524 uint8_t v; 523 uint8_t t, v;
525 524
526 v = MIN(val, get_h48_pvalmin(table, i)); 525 v = MIN(val, get_h48_pvalmin(table, i));
527 set_h48_pval(table, i, v >> UINT8_C(2)); 526 t = table[H48_INDEX(i)];
528 set_h48_pval(table, i+UINT64_C(1), v % UINT8_C(4)); 527 table[H48_INDEX(i)] = (t & UINT8_C(0xF)) | (v << UINT8_C(4));
529} 528}

Generated with cgit - Back to sebastiano.tronto.net