Skip to content

Commit

Permalink
Fix broken C89 support in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lindstro committed Jul 26, 2021
1 parent 45c9e82 commit 83d572f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions tests/src/decode/zfpDecodeBlockBase.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ struct setupVars {
static void
populateInitialArray(Scalar** dataArrPtr)
{
size_t i;
*dataArrPtr = malloc(sizeof(Scalar) * BLOCK_SIZE);
assert_non_null(*dataArrPtr);

for (int i = 0; i < BLOCK_SIZE; i++) {
for (i = 0; i < BLOCK_SIZE; i++) {
#ifdef FL_PT_DATA
(*dataArrPtr)[i] = nextSignedRandFlPt();
#else
Expand Down Expand Up @@ -65,8 +66,8 @@ populateInitialArraySpecial(Scalar* dataArr, int index)
UINT64C(0x7ff4000000000000), // sNaN
};
#endif

size_t i;

for (i = 0; i < BLOCK_SIZE; i++) {
#ifdef FL_PT_DATA
// generate special values
Expand Down
6 changes: 4 additions & 2 deletions tests/src/encode/zfpEncodeBlockBase.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ struct setupVars {
static void
populateInitialArray(Scalar** dataArrPtr)
{
size_t i;
*dataArrPtr = malloc(sizeof(Scalar) * BLOCK_SIZE);
assert_non_null(*dataArrPtr);

for (int i = 0; i < BLOCK_SIZE; i++) {
for (i = 0; i < BLOCK_SIZE; i++) {
#ifdef FL_PT_DATA
(*dataArrPtr)[i] = nextSignedRandFlPt();
#else
Expand Down Expand Up @@ -64,8 +65,9 @@ populateInitialArraySpecial(Scalar* dataArr, int index)
UINT64C(0x7ff4000000000000), // sNaN
};
#endif
size_t i;

for (size_t i = 0; i < BLOCK_SIZE; i++) {
for (i = 0; i < BLOCK_SIZE; i++) {
#ifdef FL_PT_DATA
// generate special values
if ((i & 3u) == 0) {
Expand Down

0 comments on commit 83d572f

Please sign in to comment.