Skip to content

Commit 48b2adc

Browse files
authored
Fix calloc-transposed-args warning (#520)
``` ntt.h: In function ‘ntt_multiply’: ntt.h:136:41: warning: ‘ruby_xcalloc’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Wcalloc-transposed-args] 136 | uint32_t *mem = ruby_xcalloc(sizeof(uint32_t), ntt_size * 9); | ^~~~~~~~ ntt.h:136:41: note: earlier argument should specify number of elements, later size of each element ```
1 parent b66add1 commit 48b2adc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/bigdecimal/ntt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ ntt_multiply(size_t a_size, size_t b_size, uint32_t *a, uint32_t *b, uint32_t *c
133133
uint32_t batch_size = ntt_size - (uint32_t)b_size;
134134
uint32_t batch_count = (uint32_t)((a_size + batch_size - 1) / batch_size);
135135

136-
uint32_t *mem = ruby_xcalloc(sizeof(uint32_t), ntt_size * 9);
136+
uint32_t *mem = ruby_xcalloc(ntt_size * 9, sizeof(uint32_t));
137137
uint32_t *ntt1 = mem;
138138
uint32_t *ntt2 = mem + ntt_size;
139139
uint32_t *ntt3 = mem + ntt_size * 2;

0 commit comments

Comments
 (0)