aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2026-04-06 14:48:54 +0100
committerSebastiano Tronto <sebastiano@tronto.net>2026-04-06 14:48:54 +0100
commita1ad0db8a6d829eddf1478cee44ae976bbcd325f (patch)
treea6e62232e05e7779034c5f9d1bf743b6f1c198e3 /src/utils
parent0d4fa9ebbfcadfff4baf8fc3cd32a63dcfd7dd43 (diff)
downloadnissy-core-c-portability.tar.gz
nissy-core-c-portability.zip
Fix integer conversions in code, tests and some toolsc-portability
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/math.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils/math.h b/src/utils/math.h
index f2176b6..0c56861 100644
--- a/src/utils/math.h
+++ b/src/utils/math.h
@@ -73,10 +73,10 @@ indextoperm(uint64_t p, size_t n, uint8_t *r)
73 73
74 /* Find k-th unused number */ 74 /* Find k-th unused number */
75 for (j = 0, c = 0; c <= k; j++) 75 for (j = 0, c = 0; c <= k; j++)
76 c += 1 - ((used & (1<<j)) >> j); 76 c += UINT64_C(1) - ((used & (UINT64_C(1)<<j)) >> j);
77 77
78 r[i] = j-1; 78 r[i] = (uint8_t)(j-1);
79 used |= 1 << (j-1); 79 used |= UINT64_C(1) << (j-1);
80 p %= factorial[n-i-1]; 80 p %= factorial[n-i-1];
81 } 81 }
82 82

Generated with cgit - Back to sebastiano.tronto.net