Skip to content

Commit

Permalink
Run clang-format-18 over entire tree
Browse files Browse the repository at this point in the history
Signed-off-by: Quincey Koziol <[email protected]>
  • Loading branch information
qkoziol committed May 7, 2024
1 parent 9ad5f7e commit ce362a6
Show file tree
Hide file tree
Showing 379 changed files with 2,889 additions and 2,971 deletions.
2 changes: 1 addition & 1 deletion HDF5Examples/C/H5T/h5ex_t_objref.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ main(void)
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
rdata = (H5R_ref_t *)malloc(dims[0] * sizeof(H5R_ref_t));
#else
rdata = (hobj_ref_t *)malloc(dims[0] * sizeof(hobj_ref_t));
rdata = (hobj_ref_t *)malloc(dims[0] * sizeof(hobj_ref_t));
#endif
/*
* Read the data.
Expand Down
2 changes: 1 addition & 1 deletion HDF5Examples/C/H5T/h5ex_t_objrefatt.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ main(void)
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
rdata = (H5R_ref_t *)malloc(dims[0] * sizeof(H5R_ref_t));
#else
rdata = (hobj_ref_t *)malloc(dims[0] * sizeof(hobj_ref_t));
rdata = (hobj_ref_t *)malloc(dims[0] * sizeof(hobj_ref_t));
#endif
/*
* Read the data.
Expand Down
2 changes: 1 addition & 1 deletion HDF5Examples/C/H5T/h5ex_t_regref.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ main(void)
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
rdata = (H5R_ref_t *)malloc(dims[0] * sizeof(H5R_ref_t));
#else
rdata = (hdset_reg_ref_t *)malloc(dims[0] * sizeof(hdset_reg_ref_t));
rdata = (hdset_reg_ref_t *)malloc(dims[0] * sizeof(hdset_reg_ref_t));
#endif

status = H5Sclose(space);
Expand Down
2 changes: 1 addition & 1 deletion HDF5Examples/C/H5T/h5ex_t_regrefatt.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ main(void)
#if H5_VERSION_GE(1, 12, 0) && !defined(H5_USE_110_API) && !defined(H5_USE_18_API) && !defined(H5_USE_16_API)
rdata = (H5R_ref_t *)malloc(dims[0] * sizeof(H5R_ref_t));
#else
rdata = (hdset_reg_ref_t *)malloc(dims[0] * sizeof(hdset_reg_ref_t));
rdata = (hdset_reg_ref_t *)malloc(dims[0] * sizeof(hdset_reg_ref_t));
#endif

status = H5Sclose(space);
Expand Down
2 changes: 1 addition & 1 deletion HDF5Examples/JAVA/H5T/H5Ex_T_Commit.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private static class Sensor_Datatype {

String[] memberNames = {"Serial number", "Location", "Temperature (F)", "Pressure (inHg)"};
long[] memberFileTypes = {HDF5Constants.H5T_STD_I32BE, HDF5Constants.H5T_C_S1,
HDF5Constants.H5T_IEEE_F64BE, HDF5Constants.H5T_IEEE_F64BE};
HDF5Constants.H5T_IEEE_F64BE, HDF5Constants.H5T_IEEE_F64BE};
static int[] memberStorage = {INTEGERSIZE, MAXSTRINGSIZE, DOUBLESIZE, DOUBLESIZE};

// Data size is the storage size for the members not the object.
Expand Down
2 changes: 1 addition & 1 deletion HDF5Examples/JAVA/H5T/H5Ex_T_Compound.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static class Sensor_Datatype {

static String[] memberNames = {"Serial number", "Location", "Temperature (F)", "Pressure (inHg)"};
static long[] memberMemTypes = {HDF5Constants.H5T_NATIVE_INT, HDF5Constants.H5T_C_S1,
HDF5Constants.H5T_NATIVE_DOUBLE, HDF5Constants.H5T_NATIVE_DOUBLE};
HDF5Constants.H5T_NATIVE_DOUBLE, HDF5Constants.H5T_NATIVE_DOUBLE};
static long[] memberFileTypes = {HDF5Constants.H5T_STD_I32BE, HDF5Constants.H5T_C_S1,
HDF5Constants.H5T_IEEE_F64BE, HDF5Constants.H5T_IEEE_F64BE};
static int[] memberStorage = {INTEGERSIZE, MAXSTRINGSIZE, DOUBLESIZE, DOUBLESIZE};
Expand Down
2 changes: 1 addition & 1 deletion HDF5Examples/JAVA/H5T/H5Ex_T_CompoundAttribute.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static class Sensor_Datatype {

static String[] memberNames = {"Serial number", "Location", "Temperature (F)", "Pressure (inHg)"};
static long[] memberMemTypes = {HDF5Constants.H5T_NATIVE_INT, HDF5Constants.H5T_C_S1,
HDF5Constants.H5T_NATIVE_DOUBLE, HDF5Constants.H5T_NATIVE_DOUBLE};
HDF5Constants.H5T_NATIVE_DOUBLE, HDF5Constants.H5T_NATIVE_DOUBLE};
static long[] memberFileTypes = {HDF5Constants.H5T_STD_I32BE, HDF5Constants.H5T_C_S1,
HDF5Constants.H5T_IEEE_F64BE, HDF5Constants.H5T_IEEE_F64BE};
static int[] memberStorage = {INTEGERSIZE, MAXSTRINGSIZE, DOUBLESIZE, DOUBLESIZE};
Expand Down
4 changes: 2 additions & 2 deletions c++/examples/h5tutr_extend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ main(void)
hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
hsize_t chunk_dims[2] = {2, 5};
int data[3][3] = {{1, 1, 1}, // data to write
{1, 1, 1},
{1, 1, 1}};
{1, 1, 1},
{1, 1, 1}};

// Variables used in extending and writing to the extended portion of dataset

Expand Down
4 changes: 2 additions & 2 deletions c++/src/H5DataType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ DataType::DataType(const H5T_class_t type_class, size_t size)
///\exception H5::ReferenceException
//--------------------------------------------------------------------------
DataType::DataType(const H5Location &loc, const void *ref, H5R_type_t ref_type, const PropList &plist)
: H5Object(), id{H5Location::p_dereference(loc.getId(), ref, ref_type, plist,
"constructor - by dereference")},
: H5Object(),
id{H5Location::p_dereference(loc.getId(), ref, ref_type, plist, "constructor - by dereference")},
encoded_buf(NULL), buf_size(0)
{
}
Expand Down
2 changes: 1 addition & 1 deletion c++/test/dsets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ test_compression(H5File &file)
throw Exception("test_compression", "Failed in partial I/O");
}
} // for j
} // for i
} // for i

delete dataset;
dataset = NULL;
Expand Down
4 changes: 2 additions & 2 deletions c++/test/tarray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ test_array_compound_array()
idxi, idxj, wdata[idxi][idxj].i, idxi, idxj, rdata[idxi][idxj].i);
continue;
} // end if
} // end for
} // end for
} // end for
} // end for

// Close all
atype_check.close();
Expand Down
2 changes: 1 addition & 1 deletion c++/test/tattr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2025,7 +2025,7 @@ test_attr()
test_attr_corder_create_basic(fcpl, curr_fapl);
}
} // end for
} // end try block
} // end try block

catch (Exception &E) {
issue_fail_msg("test_attr()", __LINE__, __FILE__, E.getCDetailMsg());
Expand Down
2 changes: 1 addition & 1 deletion c++/test/tcompound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ test_compound_4()
<< d_ptr->c[1] << "," << d_ptr->c[2] << "," << d_ptr->c[3] << ", d=" << d_ptr->d
<< ", e=" << d_ptr->e << "}" << endl;
} // if
} // for
} // for

/* Release resources */
free(buf);
Expand Down
14 changes: 7 additions & 7 deletions c++/test/titerate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ using namespace H5;
#define NDATASETS 50

/* Number of attributes for attribute iteration test */
//#define NATTR 50
// #define NATTR 50

/* Number of groups for second group iteration test */
//#define ITER_NGROUPS 150
// #define ITER_NGROUPS 150

/* General maximum length of names used */
#define NAMELEN 80

/* 1-D dataset with fixed dimensions */
//#define SPACE1_RANK 1
//#define SPACE1_DIM1 4
// #define SPACE1_RANK 1
// #define SPACE1_DIM1 4

const H5std_string FILE_ITERATE("titerate.h5");
const H5std_string GROUP1("Top Group");
Expand Down Expand Up @@ -225,7 +225,7 @@ test_iter_group(FileAccPropList &fapl)
}
catch (FileIException &invalid_action) // invalid index
{
} // do nothing, exception expected
} // do nothing, exception expected
catch (GroupIException &invalid_action) // invalid index
{
} // do nothing, exception expected
Expand All @@ -241,7 +241,7 @@ test_iter_group(FileAccPropList &fapl)
}
catch (FileIException &invalid_action) // invalid index
{
} // do nothing, exception expected
} // do nothing, exception expected
catch (GroupIException &invalid_action) // invalid index
{
} // do nothing, exception expected
Expand All @@ -257,7 +257,7 @@ test_iter_group(FileAccPropList &fapl)
}
catch (FileIException &invalid_action) // invalid index
{
} // do nothing, exception expected
} // do nothing, exception expected
catch (GroupIException &invalid_action) // invalid index
{
} // do nothing, exception expected
Expand Down
2 changes: 1 addition & 1 deletion c++/test/tvlstr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ test_compact_vlstring()
static_cast<int>(i), wdata[i], static_cast<int>(i), rdata[i]);
continue;
} // end if
} // end for
} // end for

// Reclaim the read VL data
DataSet::vlenReclaim(static_cast<void *>(rdata), vlst, sid1);
Expand Down
4 changes: 2 additions & 2 deletions examples/h5_extend.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ main(void)
herr_t status;
hsize_t chunk_dims[2] = {2, 5};
int data[3][3] = {{1, 1, 1}, /* data to write */
{1, 1, 1},
{1, 1, 1}};
{1, 1, 1},
{1, 1, 1}};

/* Variables used in extending and writing to the extended portion of dataset */
hsize_t size[2];
Expand Down
22 changes: 11 additions & 11 deletions fortran/src/H5_f.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,17 +567,17 @@ h5init_flags_c(int_f *h5d_flags, size_t_f *h5d_size_flags, int_f *h5e_flags, hid
h5fd_flags[20] = (int_f)SELECT_IOC_TOTAL;
h5fd_flags[21] = (int_f)ioc_selection_options;
#else
h5fd_flags[11] = 0;
h5fd_flags[12] = 0;
h5fd_flags[13] = 0;
h5fd_flags[14] = 0;
h5fd_flags[15] = 0;
h5fd_flags[16] = 0;
h5fd_flags[17] = 0;
h5fd_flags[18] = 0;
h5fd_flags[19] = 0;
h5fd_flags[20] = 0;
h5fd_flags[21] = 0;
h5fd_flags[11] = 0;
h5fd_flags[12] = 0;
h5fd_flags[13] = 0;
h5fd_flags[14] = 0;
h5fd_flags[15] = 0;
h5fd_flags[16] = 0;
h5fd_flags[17] = 0;
h5fd_flags[18] = 0;
h5fd_flags[19] = 0;
h5fd_flags[20] = 0;
h5fd_flags[21] = 0;
#endif

/*
Expand Down
2 changes: 1 addition & 1 deletion hl/examples/ex_table_03.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ main(void)

Particle p = {"zero", 0, 0, 0.0F, 0.0};
size_t dst_sizes[NFIELDS] = {sizeof(p.name), sizeof(p.lati), sizeof(p.longi), sizeof(p.pressure),
sizeof(p.temperature)};
sizeof(p.temperature)};

/* Define field information */
const char *field_names[NFIELDS] = {"Name", "Latitude", "Longitude", "Pressure", "Temperature"};
Expand Down
2 changes: 1 addition & 1 deletion hl/examples/ex_table_04.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ main(void)
size_t dst_offset[NFIELDS] = {HOFFSET(Particle, name), HOFFSET(Particle, lati), HOFFSET(Particle, longi),
HOFFSET(Particle, pressure), HOFFSET(Particle, temperature)};
size_t dst_sizes[NFIELDS] = {sizeof(dst_buf[0].name), sizeof(dst_buf[0].lati), sizeof(dst_buf[0].longi),
sizeof(dst_buf[0].pressure), sizeof(dst_buf[0].temperature)};
sizeof(dst_buf[0].pressure), sizeof(dst_buf[0].temperature)};
size_t field_offset_pos[2] = {HOFFSET(Position, lati), HOFFSET(Position, longi)};
const char *field_names[NFIELDS] = /* Define field information */
{"Name", "Latitude", "Longitude", "Pressure", "Temperature"};
Expand Down
2 changes: 1 addition & 1 deletion hl/examples/ex_table_05.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ main(void)
size_t dst_offset[NFIELDS] = {HOFFSET(Particle, name), HOFFSET(Particle, lati), HOFFSET(Particle, longi),
HOFFSET(Particle, pressure), HOFFSET(Particle, temperature)};
size_t dst_sizes[NFIELDS] = {sizeof(dst_buf[0].name), sizeof(dst_buf[0].lati), sizeof(dst_buf[0].longi),
sizeof(dst_buf[0].pressure), sizeof(dst_buf[0].temperature)};
sizeof(dst_buf[0].pressure), sizeof(dst_buf[0].temperature)};

size_t field_offset_pos[2] = {HOFFSET(Position, lati), HOFFSET(Position, longi)};

Expand Down
2 changes: 1 addition & 1 deletion hl/examples/ex_table_08.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ main(void)
size_t dst_offset[NFIELDS] = {HOFFSET(Particle, name), HOFFSET(Particle, lati), HOFFSET(Particle, longi),
HOFFSET(Particle, pressure), HOFFSET(Particle, temperature)};
size_t dst_sizes[NFIELDS] = {sizeof(p_data[0].name), sizeof(p_data[0].lati), sizeof(p_data[0].longi),
sizeof(p_data[0].pressure), sizeof(p_data[0].temperature)};
sizeof(p_data[0].pressure), sizeof(p_data[0].temperature)};

/* Define an array of Particles to insert */
Particle p_data_insert[NRECORDS_INS] = {{"new", 30, 30, 3.0F, 30.0}, {"new", 40, 40, 4.0F, 40.0}};
Expand Down
2 changes: 1 addition & 1 deletion hl/examples/ex_table_09.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ main(void)
size_t dst_offset[NFIELDS] = {HOFFSET(Particle, name), HOFFSET(Particle, lati), HOFFSET(Particle, longi),
HOFFSET(Particle, pressure), HOFFSET(Particle, temperature)};
size_t dst_sizes[NFIELDS] = {sizeof(dst_buf[0].name), sizeof(dst_buf[0].lati), sizeof(dst_buf[0].longi),
sizeof(dst_buf[0].pressure), sizeof(dst_buf[0].temperature)};
sizeof(dst_buf[0].pressure), sizeof(dst_buf[0].temperature)};

/* Define an array of Particles */
Particle p_data[NRECORDS] = {{"zero", 0, 0, 0.0F, 0.0}, {"one", 10, 10, 1.0F, 10.0},
Expand Down
2 changes: 1 addition & 1 deletion hl/examples/ex_table_10.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ main(void)
size_t dst_offset[NFIELDS] = {HOFFSET(Particle, name), HOFFSET(Particle, lati), HOFFSET(Particle, longi),
HOFFSET(Particle, pressure), HOFFSET(Particle, temperature)};
size_t dst_sizes[NFIELDS] = {sizeof(dst_buf[0].name), sizeof(dst_buf[0].lati), sizeof(dst_buf[0].longi),
sizeof(dst_buf[0].pressure), sizeof(dst_buf[0].temperature)};
sizeof(dst_buf[0].pressure), sizeof(dst_buf[0].temperature)};

/* Define field information */
const char *field_names[NFIELDS] = {"Name", "Latitude", "Longitude", "Pressure", "Temperature"};
Expand Down
4 changes: 2 additions & 2 deletions hl/src/H5DO.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, hid_t
count[u] = extension;
start[u] = old_size;
} /* end if */
} /* end for */
} /* end for */
if (FAIL == H5Sselect_hyperslab(new_space_id, H5S_SELECT_SET, start, stride, count, block))
goto done;

Expand Down Expand Up @@ -208,7 +208,7 @@ H5DOappend(hid_t dset_id, hid_t dxpl_id, unsigned axis, size_t extension, hid_t
if (H5Dflush(dset_id) < 0)
goto done;
} /* end if */
} /* end if */
} /* end if */

/* Indicate success */
ret_value = SUCCEED;
Expand Down
16 changes: 8 additions & 8 deletions hl/src/H5DS.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ H5DSattach_scale(hid_t did, hid_t dsid, unsigned int idx)
((hobj_ref_t *)buf[idx].p)[0] = ref_to_ds;
}
} /* end else */
} /* end if */
} /* end if */
else {
if (is_new_ref && H5Rdestroy(&nref_to_ds) < 0)
goto out;
Expand Down Expand Up @@ -911,9 +911,9 @@ H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx)
found_ds = 1;
break;
} /* end if */
} /* end if */
} /* j */
} /* if */
} /* end if */
} /* j */
} /* if */

/* the scale must be present to continue */
if (found_ds == 0)
Expand Down Expand Up @@ -1057,9 +1057,9 @@ H5DSdetach_scale(hid_t did, hid_t dsid, unsigned int idx)
found_dset = 1;
break;
} /* end if */
} /* end if */
} /* if we have the same dimension index */
} /* ii */
} /* end if */
} /* if we have the same dimension index */
} /* ii */

/* close attribute */
if (H5Aclose(aid) < 0)
Expand Down Expand Up @@ -1716,7 +1716,7 @@ H5DSiterate_scales(hid_t did, unsigned int dim, int *ds_idx, H5DS_iterate_t visi
goto out;

} /* i */
} /* if */
} /* if */

/* close */
if (H5Treclaim(tid, sid, H5P_DEFAULT, buf) < 0)
Expand Down
12 changes: 6 additions & 6 deletions hl/src/H5LD.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ H5LD_construct_vector(char *fields, H5LD_memb_t *listv[] /*OUT*/, hid_t par_tid)
if (gotmember) { /* getting something and end of "fields" */
*cur++ = '\0';
memb->names[++j] = NULL;
} /* end if */
} /* end if */
else /* getting nothing but end of list */
valid = false;
end_of_fields = true;
Expand Down Expand Up @@ -232,7 +232,7 @@ H5LD_construct_vector(char *fields, H5LD_memb_t *listv[] /*OUT*/, hid_t par_tid)
gotmember = true;
break;
} /* end switch */
} /* while (valid && !gotcomma && !end_of_fields) */
} /* while (valid && !gotcomma && !end_of_fields) */

/* If valid, put into listv and continue processing further info */
if (valid) {
Expand All @@ -247,7 +247,7 @@ H5LD_construct_vector(char *fields, H5LD_memb_t *listv[] /*OUT*/, hid_t par_tid)
}
goto done;
} /* end else */
} /* while !end_of_fields */
} /* while !end_of_fields */

/* Indicate success */
ret_value = nfields;
Expand Down Expand Up @@ -433,7 +433,7 @@ H5LD_get_dset_elmts(hid_t did, const hsize_t *prev_dims, const hsize_t *cur_dims
++ctr;
count[i] = cur_dims[i] - prev_dims[i];
start[i] = prev_dims[i];
} /* end if */
} /* end if */
else { /* < or = */
start[i] = 0;
count[i] = MIN(prev_dims[i], cur_dims[i]);
Expand All @@ -445,7 +445,7 @@ H5LD_get_dset_elmts(hid_t did, const hsize_t *prev_dims, const hsize_t *cur_dims
/* Make the selection in the dataset based on "cur_dims" and "prev_dims" */
if (H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
goto done;
} /* end if */
} /* end if */
else { /* changes for more than one dimensions */
memset(start, 0, sizeof start);

Expand Down Expand Up @@ -475,7 +475,7 @@ H5LD_get_dset_elmts(hid_t did, const hsize_t *prev_dims, const hsize_t *cur_dims
/* Read and store all the elements in "buf" */
if (H5Dread(did, tid, mid, sid, H5P_DEFAULT, buf) < 0)
goto done;
} /* end if */
} /* end if */
else { /* "fields" is specified */
unsigned char *buf_p = (unsigned char *)buf; /* Pointer to the destination buffer */
char *tmp_buf; /* Temporary buffer for data read */
Expand Down
2 changes: 1 addition & 1 deletion hl/src/H5TB.c
Original file line number Diff line number Diff line change
Expand Up @@ -2096,7 +2096,7 @@ H5TBinsert_field(hid_t loc_id, const char *dset_name, const char *field_name, hi
goto out;
member_type_id = H5I_INVALID_HID;
} /* end else */
} /* end for */
} /* end for */

/*-------------------------------------------------------------------------
* create a new temporary dataset
Expand Down
Loading

0 comments on commit ce362a6

Please sign in to comment.