Skip to content

Commit

Permalink
Fixes an array issue flagged by PGI in a C++ test (#763)
Browse files Browse the repository at this point in the history
  • Loading branch information
derobins authored Jun 17, 2021
1 parent 16e9b69 commit 73ad914
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions c++/test/ttypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,11 @@ test_named()

// It should be possible to define an attribute for the named type
Attribute attr1 = itype.createAttribute("attr1", PredType::NATIVE_UCHAR, space);
for (i = 0; i < ds_size[0] * ds_size[1]; i++)
attr_data[0][i] = (int)i; /*tricky*/
for (hsize_t i = 0; i < ds_size[0]; i++) {
for (hsize_t j = 0; j < ds_size[1]; j++) {
attr_data[i][j] = static_cast<unsigned>(i * ds_size[1] + j);
}
}
attr1.write(PredType::NATIVE_UINT, attr_data);
attr1.close();

Expand Down

0 comments on commit 73ad914

Please sign in to comment.