Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Thomas Jahns
PPM
Commits
e8e8461e
Commit
e8e8461e
authored
Mar 02, 2021
by
Thomas Jahns
🤸
Browse files
Factor out and simplify size computation.
* pgcc 20 cannot handle this steaming hot C99 material.
parent
c0301d89
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/test_combinatorics_c.c
View file @
e8e8461e
...
...
@@ -72,13 +72,14 @@ main()
uint32_t
(
*
occCount
)[
n
];
list
=
xmalloc
(
sizeof
(
list
[
0
])
*
n
);
occCount
=
xmalloc
(
sizeof
(
occCount
[
0
])
*
n
*
n
);
size_t
occCountSize
=
sizeof
(
uint32_t
)
*
n
*
n
;
occCount
=
xmalloc
(
occCountSize
);
size_t
failures
;
for
(
size_t
repeats
=
0
;
repeats
<
(
sizeof
(
numRunsList
)
/
sizeof
(
numRunsList
[
0
]));
++
repeats
)
{
memset
(
occCount
,
0
,
sizeof
(
occCount
[
0
])
*
n
*
n
);
memset
(
occCount
,
0
,
occCountSize
);
uint32_t
numRuns
=
numRunsList
[
repeats
];
for
(
uint32_t
j
=
0
;
j
<
numRuns
;
++
j
)
{
...
...
@@ -111,6 +112,8 @@ main()
}
}
}
free
(
list
);
free
(
occCount
);
return
failures
?
EXIT_FAILURE
:
EXIT_SUCCESS
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment