diff options
Diffstat (limited to '')
| -rw-r--r-- | src/utils/math.h | 6 |
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 | ||
