diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-06-06 15:05:35 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-06-06 15:05:35 -0400 |
| commit | e9abf8a370b0256f96108048eec95b68ef92effc (patch) | |
| tree | 5987fc28bc90605a7f6e6fa57fbc9da3b1d8deac /builtins/integers.c | |
| parent | b4dc8587946d5300ae983c9c3cfc2d03f76ed746 (diff) | |
Prefer 'sizeof(t[n])' over 'sizeof(t)*n'
Diffstat (limited to 'builtins/integers.c')
| -rw-r--r-- | builtins/integers.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtins/integers.c b/builtins/integers.c index ac8e5069..ef9b5df4 100644 --- a/builtins/integers.c +++ b/builtins/integers.c @@ -43,7 +43,7 @@ return CORD_asprintf(octal_fmt, (int)digits, (uint64_t)i); \ } \ public array_t KindOfInt ## $bits(c_type x) { \ - array_t bit_array = (array_t){.data=GC_MALLOC_ATOMIC(sizeof(bool)*8*sizeof(c_type)), .atomic=1, .stride=sizeof(bool), .length=8*sizeof(c_type)}; \ + array_t bit_array = (array_t){.data=GC_MALLOC_ATOMIC(sizeof(bool[8*sizeof(c_type)])), .atomic=1, .stride=sizeof(bool), .length=8*sizeof(c_type)}; \ bool *bits = bit_array.data + sizeof(c_type)*8; \ for (size_t i = 0; i < 8*sizeof(c_type); i++) { \ *(bits--) = x & 1; \ |
