Skip to content

Commit f3dc2f7

Browse files
committed
Fix compiler warning
1 parent 74114e9 commit f3dc2f7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/stack.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ STACK_CLASS(StackClass)
1919

2020
static inline StackClass*
2121
FNAME(alloc)(size_t sz) {
22-
StackClass *ans = calloc(sizeof(StackClass), 1);
22+
StackClass *ans = calloc(1, sizeof(StackClass));
2323
if (ans) {
2424
ans->items = (StackItemClass*)malloc(sizeof(StackItemClass) * sz);
2525
if (ans->items) ans->capacity = sz;

test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
#include <Python.h>
99

10-
int
10+
int
1111
main(int argc, char **argv) {
1212
#if PY_MAJOR_VERSION >= 3
1313
wchar_t *argw[1024] = {0};
1414
int i;
1515
for (i = 0; i < argc; i++) {
16-
argw[i] = (wchar_t*)calloc(sizeof(wchar_t), 1024);
16+
argw[i] = (wchar_t*)calloc(1024, sizeof(wchar_t));
1717
swprintf(argw[i], 1024, L"%hs", argv[i]);
1818
}
1919
return Py_Main(argc, argw);

0 commit comments

Comments
 (0)