Skip to content

Commit

Permalink
Fixed the only -Wsometimes-uninitialized warning
Browse files Browse the repository at this point in the history
Moved the logging into the `if`, which I think is what the author probably intended.
  • Loading branch information
seanm committed Jun 15, 2023
1 parent 1397808 commit 76d0026
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions c++/examples/h5tutr_extend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ main(void)
// ---------------------------------------

int rdata[10][3];
int i, j, rank, rank_chunk;
int i, j, rank;
hsize_t chunk_dimsr[2], dimsr[2];

// Open the file and dataset.
Expand All @@ -114,10 +114,10 @@ main(void)
rank = filespace->getSimpleExtentNdims();
(void)filespace->getSimpleExtentDims(dimsr);

if (H5D_CHUNKED == prop.getLayout())
rank_chunk = prop.getChunk(rank, chunk_dimsr);
cout << "rank chunk = " << rank_chunk << endl;
;
if (H5D_CHUNKED == prop.getLayout()) {
int rank_chunk = prop.getChunk(rank, chunk_dimsr);
cout << "rank chunk = " << rank_chunk << endl;
}

memspace = new DataSpace(rank, dimsr, NULL);
dataset->read(rdata, PredType::NATIVE_INT, *memspace, *filespace);
Expand Down

0 comments on commit 76d0026

Please sign in to comment.