Skip to content

Commit

Permalink
Fixed various -Wunused-variable warnings
Browse files Browse the repository at this point in the history
Some of these the compiler is now able to identify thanks to the previous fixes of -Wmissing-variable-declarations warnings, making the variables static.

Others are variables that look useful to inspect in the debugger, and so I just cast to void to suppress the warnings.
  • Loading branch information
seanm committed Jun 14, 2023
1 parent b69d4df commit dc23d6f
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions c++/examples/h5tutr_extend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ main(void)
// Get information to obtain memory dataspace.
rank = filespace->getSimpleExtentNdims();
herr_t status_n = filespace->getSimpleExtentDims(dimsr);
(void)status_n;

if (H5D_CHUNKED == prop.getLayout())
rank_chunk = prop.getChunk(rank, chunk_dimsr);
Expand Down
2 changes: 2 additions & 0 deletions c++/examples/readdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ main(void)
*/
H5std_string order_string;
H5T_order_t order = intype.getOrder(order_string);
(void)order;
cout << order_string << endl;

/*
Expand All @@ -110,6 +111,7 @@ main(void)
*/
hsize_t dims_out[2];
int ndims = dataspace.getSimpleExtentDims(dims_out, NULL);
(void)ndims;
cout << "rank " << rank << ", dimensions " << (unsigned long)(dims_out[0]) << " x "
<< (unsigned long)(dims_out[1]) << endl;

Expand Down
2 changes: 1 addition & 1 deletion examples/h5_vds-exc.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ main(void)
kdims[3] = {KDIM0, KDIM1, KDIM2}, kdims_max[3] = {H5S_UNLIMITED, KDIM1, KDIM2},
ndims[3] = {NDIM0, NDIM1, NDIM2}, ndims_max[3] = {H5S_UNLIMITED, NDIM1, NDIM2},
start[3], /* Hyperslab parameters */
stride[3], count[3], block[3];
count[3], block[3];
hsize_t start_out[3], stride_out[3], count_out[3], block_out[3];
int k = 2;
int n = 3;
Expand Down
2 changes: 1 addition & 1 deletion examples/h5_vds-exclim.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ main(void)
herr_t status;
hsize_t vdsdims[3] = {VDSDIM0, VDSDIM1, VDSDIM2}, kdims[3] = {KDIM0, KDIM1, KDIM2},
ndims[3] = {NDIM0, NDIM1, NDIM2}, start[3], /* Hyperslab parameters */
stride[3], count[3], block[3];
count[3], block[3];
hsize_t start_out[3], stride_out[3], count_out[3], block_out[3];
int k = 2;
int n = 3;
Expand Down
2 changes: 1 addition & 1 deletion examples/h5_vds.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ main(void)
hsize_t vdsdims[2] = {VDSDIM0, VDSDIM1}, /* Virtual datasets dimension */
dims[1] = {DIM0}, /* Source datasets dimensions */
start[2], /* Hyperslab parameters */
stride[2], count[2], block[2];
count[2], block[2];
hsize_t start_out[2], stride_out[2], count_out[2], block_out[2];
int wdata[DIM0], /* Write buffer for source dataset */
rdata[VDSDIM0][VDSDIM1], /* Read buffer for virtual dataset */
Expand Down
2 changes: 1 addition & 1 deletion test/mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static const char *FILENAME[] = {"mount_1", "mount_2", "mount_3", "mount_4", "mo
#define NX 4
#define NY 5
#define NAME_BUF_SIZE 40
static int bm[NX][NY], bm_out[NX][NY]; /* Data buffers */
static int bm[NX][NY]; /* Data buffers */

/*-------------------------------------------------------------------------
* Function: setup
Expand Down
1 change: 0 additions & 1 deletion tools/lib/h5tools.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ int region_output; /* region output */
int oid_output; /* oid output */
int data_output; /* data output */
int attr_data_output; /* attribute data output */
static int compound_data;

unsigned packed_bits_num; /* number of packed bits to display */
unsigned packed_data_offset; /* offset of packed bits to display */
Expand Down

0 comments on commit dc23d6f

Please sign in to comment.