From ba9deaeb66ac820f079702fc298c3aea91793a0f Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 19 Mar 2021 17:04:16 +0000 Subject: [PATCH 1/5] Committing clang-format changes --- src/H5Tconv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/H5Tconv.c b/src/H5Tconv.c index f2dff0befbe..0c986331c2c 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -3843,7 +3843,7 @@ H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz size_t half_size; /*half the type size */ size_t olap; /*num overlapping elements */ uint8_t * s, *sp, *d, *dp; /*source and dest traversal ptrs*/ - uint8_t * src_rev = NULL; /*order-reversed source buffer */ + uint8_t * src_rev = NULL; /*order-reversed source buffer */ uint8_t dbuf[64] = {0}; /*temp destination buffer */ size_t first; ssize_t sfirst; /*a signed version of `first' */ @@ -4286,7 +4286,7 @@ H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz size_t olap; /*num overlapping elements */ ssize_t bitno = 0; /*bit number */ uint8_t * s, *sp, *d, *dp; /*source and dest traversal ptrs*/ - uint8_t * src_rev = NULL; /*order-reversed source buffer */ + uint8_t * src_rev = NULL; /*order-reversed source buffer */ uint8_t dbuf[64] = {0}; /*temp destination buffer */ uint8_t tmp1, tmp2; /*temp variables for swapping bytes*/ @@ -8401,7 +8401,7 @@ H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz size_t tsize; /*type size for swapping bytes */ size_t olap; /*num overlapping elements */ uint8_t * s, *sp, *d, *dp; /*source and dest traversal ptrs*/ - uint8_t * src_rev = NULL; /*order-reversed source buffer */ + uint8_t * src_rev = NULL; /*order-reversed source buffer */ uint8_t dbuf[64] = {0}; /*temp destination buffer */ uint8_t tmp1, tmp2; /*temp variables for swapping bytes*/ @@ -9027,7 +9027,7 @@ H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, siz size_t tsize; /*type size for swapping bytes */ size_t olap; /*num overlapping elements */ uint8_t * s, *sp, *d, *dp; /*source and dest traversal ptrs*/ - uint8_t * src_rev = NULL; /*order-reversed source buffer */ + uint8_t * src_rev = NULL; /*order-reversed source buffer */ uint8_t dbuf[64] = {0}; /*temp destination buffer */ uint8_t tmp1, tmp2; /*temp variables for swapping bytes*/ From 2edae83c6da680ef9c9eb1868a7cbea107ce85c5 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 22 Mar 2021 04:49:02 -0700 Subject: [PATCH 2/5] Misc warning fixes from Visual Studio --- src/H5system.c | 4 ++-- src/H5trace.c | 2 +- src/H5win32defs.h | 4 ++++ test/tfile.c | 48 +++++++++++++++++++++++------------------------ test/th5s.c | 22 +++++++++++----------- test/tid.c | 10 +++++----- test/titerate.c | 4 ++-- test/tmisc.c | 2 +- test/tvltypes.c | 6 +++--- 9 files changed, 53 insertions(+), 49 deletions(-) diff --git a/src/H5system.c b/src/H5system.c index 53307a8c1de..31a18355993 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -573,8 +573,8 @@ Wgetlogin(void) { #ifdef H5_HAVE_WINSOCK2_H - long bufferCount = WloginBuffer_count; - if (GetUserName(Wlogin_buffer, &bufferCount) == 0) + DWORD bufferCount = WloginBuffer_count; + if (GetUserName(Wlogin_buffer, &bufferCount) != 0) return (Wlogin_buffer); else #endif /* H5_HAVE_WINSOCK2_H */ diff --git a/src/H5trace.c b/src/H5trace.c index aa9cfd404a0..d0c6fdd1271 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -3884,7 +3884,7 @@ H5_trace(const double *returning, const char *func, const char *type, ...) FILE * out = H5_debug_g.trace; static hbool_t is_first_invocation = TRUE; H5_timer_t function_timer = {{0}, {0}, {0}, FALSE}; - H5_timevals_t function_times; + H5_timevals_t function_times = {0.0, 0.0, 0.0}; static H5_timer_t running_timer; H5_timevals_t running_times; static int current_depth = 0; diff --git a/src/H5win32defs.h b/src/H5win32defs.h index 8f3947afd34..ecb1fd8af9e 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -200,8 +200,12 @@ H5_DLL float Wroundf(float arg); #define HDsetenv(N, V, O) Wsetenv(N, V, O) #define HDflock(F, L) Wflock(F, L) #define HDgetlogin() Wgetlogin() + +/* VS 2015 introduced C99-compliant versions of these functions */ +#if (_MSC_VER < 1900) #define HDsnprintf c99_snprintf /*varargs*/ #define HDvsnprintf c99_vsnprintf /*varargs*/ +#endif /* Non-POSIX functions */ diff --git a/test/tfile.c b/test/tfile.c index c8c123c23f6..78a22ad71ca 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -5806,7 +5806,7 @@ test_libver_bounds_super_create(hid_t fapl, hid_t fcpl, htri_t is_swmr, htri_t n /* Get the internal file pointer if the create succeeds */ if (fid >= 0) { f = (H5F_t *)H5VL_object(fid); - CHECK(f, NULL, "H5VL_object"); + CHECK_PTR(f, "H5VL_object"); } /* Retrieve the low/high bounds */ @@ -5982,7 +5982,7 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr, htri_t non /* Get the internal file pointer */ f = (H5F_t *)H5VL_object(fid); - CHECK(f, NULL, "H5VL_object"); + CHECK_PTR(f, "H5VL_object"); /* The file's superblock version */ super_vers = f->shared->sblock->super_vers; @@ -6023,7 +6023,7 @@ test_libver_bounds_super_open(hid_t fapl, hid_t fcpl, htri_t is_swmr, htri_t non /* Get the internal file pointer if the open succeeds */ if (fid >= 0) { f = (H5F_t *)H5VL_object(fid); - CHECK(f, NULL, "H5VL_object"); + CHECK_PTR(f, "H5VL_object"); } /* Verify the file open succeeds or fails */ @@ -6201,7 +6201,7 @@ test_libver_bounds_obj(hid_t fapl) /* Get the internal file pointer */ f = (H5F_t *)H5VL_object(fid); - CHECK(f, NULL, "H5VL_object"); + CHECK_PTR(f, "H5VL_object"); /* Create a group in the file */ gid = H5Gcreate2(fid, GRP_NAME, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); @@ -6309,7 +6309,7 @@ test_libver_bounds_dataset(hid_t fapl) /* Get the internal dataset pointer */ dset = (H5D_t *)H5VL_object(did); - CHECK(dset, NULL, "H5VL_object"); + CHECK_PTR(dset, "H5VL_object"); /* Verify version for layout and fill value messages */ if (low == H5F_LIBVER_EARLIEST) { @@ -6357,7 +6357,7 @@ test_libver_bounds_dataset(hid_t fapl) /* Get the internal dataset pointer */ dset = (H5D_t *)H5VL_object(did); - CHECK(dset, NULL, "H5VL_object"); + CHECK_PTR(dset, "H5VL_object"); /* Verify layout message version and chunk indexing type */ VERIFY(dset->shared->layout.version, H5O_LAYOUT_VERSION_4, "H5O_layout_ver_bounds"); @@ -6419,7 +6419,7 @@ test_libver_bounds_dataset(hid_t fapl) /* Get the internal file pointer */ f = (H5F_t *)H5VL_object(fid); - CHECK(f, NULL, "H5VL_object"); + CHECK_PTR(f, "H5VL_object"); /* Create the chunked dataset */ did = H5Dcreate2(fid, DSETC, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); @@ -6427,7 +6427,7 @@ test_libver_bounds_dataset(hid_t fapl) /* Get the internal file pointer */ dset = (H5D_t *)H5VL_object(did); - CHECK(dset, NULL, "H5VL_object"); + CHECK_PTR(dset, "H5VL_object"); /* Verify the dataset's layout, fill value and filter pipeline message versions */ /* Also verify the chunk indexing type */ @@ -6548,7 +6548,7 @@ test_libver_bounds_dataspace(hid_t fapl) sid = H5Dget_space(did); CHECK(sid, H5I_INVALID_HID, "H5Dget_space"); space = (H5S_t *)H5I_object(sid); - CHECK(space, NULL, "H5I_object"); + CHECK_PTR(space, "H5I_object"); /* Verify the dataspace version */ VERIFY(space->extent.version, H5O_sdspace_ver_bounds[low], "H5O_sdspace_ver_bounds"); @@ -6565,7 +6565,7 @@ test_libver_bounds_dataspace(hid_t fapl) sid_null = H5Dget_space(did_null); CHECK(sid_null, H5I_INVALID_HID, "H5Dget_space"); space_null = (H5S_t *)H5I_object(sid_null); - CHECK(space_null, NULL, "H5I_object"); + CHECK_PTR(space_null, "H5I_object"); /* Verify the dataspace version */ VERIFY(space_null->extent.version, H5O_SDSPACE_VERSION_2, "H5O_sdspace_ver_bounds"); @@ -6643,7 +6643,7 @@ test_libver_bounds_dataspace(hid_t fapl) /* Get the internal file pointer */ f = (H5F_t *)H5VL_object(fid); - CHECK(f, NULL, "H5VL_object"); + CHECK_PTR(f, "H5VL_object"); /* Create the chunked dataset */ did = H5Dcreate2(fid, DSETA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT); @@ -6653,7 +6653,7 @@ test_libver_bounds_dataspace(hid_t fapl) tmp_sid = H5Dget_space(did); CHECK(tmp_sid, H5I_INVALID_HID, "H5Dget_space"); tmp_space = (H5S_t *)H5I_object(tmp_sid); - CHECK(tmp_space, NULL, "H5I_object"); + CHECK_PTR(tmp_space, "H5I_object"); /* Create the compact dataset */ did_compact = H5Dcreate2(fid, DSETB, H5T_NATIVE_INT, sid_compact, H5P_DEFAULT, dcpl_compact, @@ -6664,7 +6664,7 @@ test_libver_bounds_dataspace(hid_t fapl) tmp_sid_compact = H5Dget_space(did_compact); CHECK(tmp_sid_compact, H5I_INVALID_HID, "H5Dget_space"); tmp_space_compact = (H5S_t *)H5I_object(tmp_sid_compact); - CHECK(tmp_space_compact, NULL, "H5I_object"); + CHECK_PTR(tmp_space_compact, "H5I_object"); /* Create the contiguous dataset */ did_contig = @@ -6675,7 +6675,7 @@ test_libver_bounds_dataspace(hid_t fapl) tmp_sid_contig = H5Dget_space(did_contig); CHECK(tmp_sid_contig, H5I_INVALID_HID, "H5Dget_space"); tmp_space_contig = (H5S_t *)H5I_object(tmp_sid_contig); - CHECK(tmp_space_contig, NULL, "H5I_object"); + CHECK_PTR(tmp_space_contig, "H5I_object"); /* Verify versions for the three dataspaces */ VERIFY(tmp_space->extent.version, H5O_sdspace_ver_bounds[f->shared->low_bound], @@ -6899,7 +6899,7 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) /* Get the internal datatype pointer */ dtype = (H5T_t *)H5I_object(dtid); - CHECK(dtype, NULL, "H5I_object"); + CHECK_PTR(dtype, "H5I_object"); /* Verify the datatype message version */ /* H5T_COMPOUND, H5T_ENUM, H5T_ARRAY: @@ -6973,13 +6973,13 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) /* Get the internal file pointer */ f = (H5F_t *)H5VL_object(fid); - CHECK(f, NULL, "H5VL_object"); + CHECK_PTR(f, "H5VL_object"); /* Open the committed datatype */ str_tid = H5Topen2(fid, "datatype", H5P_DEFAULT); CHECK(str_tid, FAIL, "H5Topen2"); str_dtype = (H5T_t *)H5VL_object(str_tid); - CHECK(str_dtype, NULL, "H5VL_object"); + CHECK_PTR(str_dtype, "H5VL_object"); /* Verify the committed datatype message version */ VERIFY(str_dtype->shared->version, H5O_dtype_ver_bounds[H5F_LIBVER_EARLIEST], @@ -6999,7 +6999,7 @@ test_libver_bounds_datatype_check(hid_t fapl, hid_t tid) /* Get the internal datatype pointer */ dtype = (H5T_t *)H5I_object(dtid); - CHECK(dtype, NULL, "H5I_object"); + CHECK_PTR(dtype, "H5I_object"); /* Verify the dataset's datatype message version */ /* H5T_COMPOUND, H5T_ENUM, H5T_ARRAY: @@ -7132,7 +7132,7 @@ test_libver_bounds_attributes(hid_t fapl) /* Get the internal attribute pointer */ attr = (H5A_t *)H5VL_object(aid); - CHECK(attr, NULL, "H5VL_object"); + CHECK_PTR(attr, "H5VL_object"); /* Verify the attribute version */ if (low == H5F_LIBVER_EARLIEST) @@ -7151,7 +7151,7 @@ test_libver_bounds_attributes(hid_t fapl) /* Get the internal attribute pointer */ attr = (H5A_t *)H5VL_object(aid); - CHECK(attr, NULL, "H5VL_object"); + CHECK_PTR(attr, "H5VL_object"); /* Verify attribute version */ VERIFY(attr->shared->version, H5O_attr_ver_bounds[low], "H5O_attr_ver_bounds"); @@ -7172,7 +7172,7 @@ test_libver_bounds_attributes(hid_t fapl) /* Get internal attribute pointer */ attr = (H5A_t *)H5VL_object(aid); - CHECK(attr, NULL, "H5VL_object"); + CHECK_PTR(attr, "H5VL_object"); /* Verify attribute version */ if (low == H5F_LIBVER_EARLIEST) @@ -7237,7 +7237,7 @@ test_libver_bounds_attributes(hid_t fapl) /* Get the internal attribute pointer */ attr = (H5A_t *)H5VL_object(aid); - CHECK(attr, NULL, "H5VL_object"); + CHECK_PTR(attr, "H5VL_object"); /* Verify the attribute version */ if (low == H5F_LIBVER_EARLIEST) @@ -7299,7 +7299,7 @@ test_libver_bounds_attributes(hid_t fapl) /* Get the internal file pointer */ f = (H5F_t *)H5VL_object(fid); - CHECK(f, NULL, "H5VL_object"); + CHECK_PTR(f, "H5VL_object"); /* Open the group */ gid = H5Gopen2(fid, GRP_NAME, H5P_DEFAULT); @@ -7311,7 +7311,7 @@ test_libver_bounds_attributes(hid_t fapl) /* Get the internal attribute pointer */ attr = (H5A_t *)H5VL_object(aid); - CHECK(attr, NULL, "H5VL_object"); + CHECK_PTR(attr, "H5VL_object"); /* Verify the attribute message version */ VERIFY(attr->shared->version, H5O_attr_ver_bounds[f->shared->low_bound], diff --git a/test/th5s.c b/test/th5s.c index 8598e71f5dd..30c33962e0d 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -1246,7 +1246,7 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high) if (sbuf_size > 0) { sbuf = (unsigned char *)HDcalloc((size_t)1, sbuf_size); - CHECK(sbuf, NULL, "HDcalloc"); + CHECK_PTR(sbuf, "HDcalloc"); } /* Try decoding bogus buffer */ @@ -1308,7 +1308,7 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high) if (null_size > 0) { null_sbuf = (unsigned char *)HDcalloc((size_t)1, null_size); - CHECK(null_sbuf, NULL, "HDcalloc"); + CHECK_PTR(null_sbuf, "HDcalloc"); } /* Encode the null dataspace in the buffer */ @@ -1344,7 +1344,7 @@ test_h5s_encode(H5F_libver_t low, H5F_libver_t high) if (scalar_size > 0) { scalar_buf = (unsigned char *)HDcalloc((size_t)1, scalar_size); - CHECK(scalar_buf, NULL, "HDcalloc"); + CHECK_PTR(scalar_buf, "HDcalloc"); } /* Encode the scalar dataspace in the buffer */ @@ -1438,7 +1438,7 @@ test_h5s_encode1(void) if (sbuf_size > 0) { sbuf = (unsigned char *)HDcalloc((size_t)1, sbuf_size); - CHECK(sbuf, NULL, "HDcalloc"); + CHECK_PTR(sbuf, "HDcalloc"); } /* Try decoding bogus buffer */ @@ -1500,7 +1500,7 @@ test_h5s_encode1(void) if (null_size > 0) { null_sbuf = (unsigned char *)HDcalloc((size_t)1, null_size); - CHECK(null_sbuf, NULL, "HDcalloc"); + CHECK_PTR(null_sbuf, "HDcalloc"); } /* Encode the null dataspace in the buffer */ @@ -1536,7 +1536,7 @@ test_h5s_encode1(void) if (scalar_size > 0) { scalar_buf = (unsigned char *)HDcalloc((size_t)1, scalar_size); - CHECK(scalar_buf, NULL, "HDcalloc"); + CHECK_PTR(scalar_buf, "HDcalloc"); } /* Encode the scalar dataspace in the buffer */ @@ -1623,7 +1623,7 @@ test_h5s_check_encoding(hid_t in_fapl, hid_t in_sid, uint32_t expected_version, /* Allocate the buffer for encoding */ buf = (char *)HDmalloc(buf_size); - CHECK(buf, NULL, "H5Dmalloc"); + CHECK_PTR(buf, "H5Dmalloc"); /* Encode according to the setting in in_fapl */ ret = H5Sencode2(in_sid, buf, &buf_size, in_fapl); @@ -2149,7 +2149,7 @@ test_h5s_encode_length(void) /* Allocate the buffer */ if (sbuf_size > 0) { sbuf = (unsigned char *)HDcalloc((size_t)1, sbuf_size); - CHECK(sbuf, NULL, "H5Sencode2"); + CHECK_PTR(sbuf, "H5Sencode2"); } /* Encode the dataspace */ @@ -3304,7 +3304,7 @@ test_versionbounds(void) /* Its version should be H5O_SDSPACE_VERSION_1 */ spacep = (H5S_t *)H5I_object(space); - CHECK(spacep, NULL, "H5I_object"); + CHECK_PTR(spacep, "H5I_object"); VERIFY(spacep->extent.version, H5O_SDSPACE_VERSION_1, "basic dataspace version bound"); /* Set high bound to V18 */ @@ -3325,7 +3325,7 @@ test_versionbounds(void) dset_space = H5Dget_space(dset); CHECK(dset_space, FAIL, "H5Dget_space"); spacep = (H5S_t *)H5I_object(dset_space); - CHECK(spacep, NULL, "H5I_object"); + CHECK_PTR(spacep, "H5I_object"); /* Dataspace version should remain as H5O_SDSPACE_VERSION_1 */ VERIFY(spacep->extent.version, H5O_SDSPACE_VERSION_1, "basic dataspace version bound"); @@ -3362,7 +3362,7 @@ test_versionbounds(void) dset_space = H5Dget_space(dset); CHECK(dset_space, FAIL, "H5Dget_space"); spacep = (H5S_t *)H5I_object(dset_space); - CHECK(spacep, NULL, "H5I_object"); + CHECK_PTR(spacep, "H5I_object"); /* Verify the dataspace version */ VERIFY(spacep->extent.version, H5O_sdspace_ver_bounds[low], "upgraded dataspace version"); diff --git a/test/tid.c b/test/tid.c index 662064f869a..1f30a4f4e5c 100644 --- a/test/tid.c +++ b/test/tid.c @@ -513,7 +513,7 @@ test_id_type_list(void) /* Sanity check */ if ((int)startType >= H5I_MAX_NUM_TYPES || startType < H5I_NTYPES) { /* Error condition, throw an error */ - CHECK(1, 1, "H5Iregister_type"); + ERROR("H5Iregister_type"); goto out; } /* Create types up to H5I_MAX_NUM_TYPES */ @@ -705,7 +705,7 @@ test_remove_clear_type(void) /* Create an array to hold the objects in the master list */ list_size = RCT_MAX_NOBJS * sizeof(rct_obj_t); obj_list.objects = HDmalloc(list_size); - CHECK(obj_list.objects, NULL, "HDcalloc"); + CHECK_PTR(obj_list.objects, "HDcalloc"); if (NULL == obj_list.objects) goto error; @@ -718,7 +718,7 @@ test_remove_clear_type(void) hsize_t nmembers = 1234567; /* The number of objects found while scanning through the object list */ - unsigned found; + int found; /********************* * Build object list * @@ -1080,7 +1080,7 @@ test_future_ids(void) VERIFY(*actual_obj2, 7, "H5Iobject_verify"); if (7 != *actual_obj2) goto error; - VERIFY(actual_obj, actual_obj2, "H5Iobject_verify"); + CHECK_PTR_EQ(actual_obj, actual_obj2, "H5Iobject_verify"); if (actual_obj != actual_obj2) goto error; @@ -1131,7 +1131,7 @@ test_future_ids(void) VERIFY(*actual_obj2, 7, "H5Iobject_verify"); if (7 != *actual_obj2) goto error; - VERIFY(actual_obj, actual_obj2, "H5Iobject_verify"); + CHECK_PTR_EQ(actual_obj, actual_obj2, "H5Iobject_verify"); if (actual_obj != actual_obj2) goto error; diff --git a/test/titerate.c b/test/titerate.c index c507beb69d7..10ed039fb78 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -952,7 +952,7 @@ test_links(hid_t fapl) else if (!HDstrcmp(obj_name, "softlink")) VERIFY(linfo.type, H5L_TYPE_SOFT, "H5Lget_name_by_idx"); else - CHECK(0, 0, "unknown object name"); + ERROR("unknown object name"); } /* end for */ ret = H5Gclose(gid); @@ -1122,7 +1122,7 @@ test_links_deprec(hid_t fapl) else if (!HDstrcmp(obj_name, "softlink")) VERIFY(linfo.type, H5L_TYPE_SOFT, "H5Lget_name_by_idx"); else - CHECK(0, 0, "unknown object name"); + ERROR("unknown object name"); } /* end for */ ret = H5Gclose(gid); diff --git a/test/tmisc.c b/test/tmisc.c index 8c7e53d22c4..03f995299d5 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -3613,7 +3613,7 @@ test_misc19(void) /* Get a VOL class to register */ vol_cls = h5_get_dummy_vol_class(); - CHECK(vol_cls, NULL, "h5_get_dummy_vol_class"); + CHECK_PTR(vol_cls, "h5_get_dummy_vol_class"); /* Register a VOL connector */ volid = H5VLregister_connector(vol_cls, H5P_DEFAULT); diff --git a/test/tvltypes.c b/test/tvltypes.c index b8cbe6d5d91..c00ebe80ea1 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -2508,8 +2508,8 @@ test_vltypes_fill_value(void) hid_t large_dspace_id; /* Dataspace ID for large datasets */ hid_t small_select_dspace_id; /* Dataspace ID for selection in small datasets */ hid_t large_select_dspace_id; /* Dataspace ID for selection in large datasets */ - hid_t dset_dspace_id; /* Dataspace ID for a particular dataset */ - hid_t dset_select_dspace_id; /* Dataspace ID for selection in a particular dataset */ + hid_t dset_dspace_id = -1; /* Dataspace ID for a particular dataset */ + hid_t dset_select_dspace_id = -1; /* Dataspace ID for selection in a particular dataset */ hid_t scalar_dspace_id; /* Dataspace ID for scalar dataspace */ hid_t single_dspace_id; /* Dataspace ID for single element selection */ hsize_t single_offset[] = {2}; /* Offset of single element selection */ @@ -2525,7 +2525,7 @@ test_vltypes_fill_value(void) hid_t dset_id; hsize_t small_dims[] = {SPACE4_DIM_SMALL}; hsize_t large_dims[] = {SPACE4_DIM_LARGE}; - size_t dset_elmts; /* Number of elements in a particular dataset */ + size_t dset_elmts = 0; /* Number of elements in a particular dataset */ const dtype1_struct fill1 = {1, 2, "foobar", "", NULL, "\0", "dead", 3, 4.0F, 100.0F, 1.0F, "liquid", "meter"}; const dtype1_struct wdata = {3, 4, "", NULL, "\0", "foo", "two", 6, 8.0F, 200.0F, 2.0F, "solid", "yard"}; From 2a31a14da558888ca2b7cad9cc052f2cfbbf22cd Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 22 Mar 2021 11:51:44 +0000 Subject: [PATCH 3/5] Committing clang-format changes --- src/H5win32defs.h | 4 ++-- test/tvltypes.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/H5win32defs.h b/src/H5win32defs.h index ecb1fd8af9e..bddb06ba0b2 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -203,8 +203,8 @@ H5_DLL float Wroundf(float arg); /* VS 2015 introduced C99-compliant versions of these functions */ #if (_MSC_VER < 1900) -#define HDsnprintf c99_snprintf /*varargs*/ -#define HDvsnprintf c99_vsnprintf /*varargs*/ +#define HDsnprintf c99_snprintf /*varargs*/ +#define HDvsnprintf c99_vsnprintf /*varargs*/ #endif /* Non-POSIX functions */ diff --git a/test/tvltypes.c b/test/tvltypes.c index c00ebe80ea1..50b2d7a0b02 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -2526,7 +2526,7 @@ test_vltypes_fill_value(void) hsize_t small_dims[] = {SPACE4_DIM_SMALL}; hsize_t large_dims[] = {SPACE4_DIM_LARGE}; size_t dset_elmts = 0; /* Number of elements in a particular dataset */ - const dtype1_struct fill1 = {1, 2, "foobar", "", NULL, "\0", "dead", + const dtype1_struct fill1 = {1, 2, "foobar", "", NULL, "\0", "dead", 3, 4.0F, 100.0F, 1.0F, "liquid", "meter"}; const dtype1_struct wdata = {3, 4, "", NULL, "\0", "foo", "two", 6, 8.0F, 200.0F, 2.0F, "solid", "yard"}; dtype1_struct * rbuf = NULL; /* Buffer for reading data */ From 8c12e27b7253e799bdb56fa300b06db35c92fb7a Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 22 Mar 2021 05:29:11 -0700 Subject: [PATCH 4/5] Fixes warnings in swmr.c test --- test/swmr.c | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/test/swmr.c b/test/swmr.c index 607b4485758..ee08df70d36 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -847,14 +847,17 @@ test_metadata_read_attempts(hid_t in_fapl) static int test_metadata_read_retry_info(hid_t in_fapl) { - hid_t fapl, new_fapl; /* File access property list */ - hid_t fid, fid1; /* File IDs */ + hid_t fapl = H5I_INVALID_HID; /* File access property list */ + hid_t new_fapl = H5I_INVALID_HID; /* File access property list */ + hid_t fid = H5I_INVALID_HID; /* File ID */ + hid_t fid1 = H5I_INVALID_HID; /* File ID */ H5F_retry_info_t info, info1; /* The collection of metadata retries */ H5F_t * f = NULL, *f1 = NULL; /* Internal file object pointers */ unsigned i, j, n; /* Local index variables */ - hid_t did1, did2; /* Dataset IDs */ - hid_t sid; /* Dataspace ID */ - hid_t dcpl; /* Dataset creation property list */ + hid_t did1 = H5I_INVALID_HID; /* Dataset ID */ + hid_t did2 = H5I_INVALID_HID; /* Dataset ID */ + hid_t sid = H5I_INVALID_HID; /* Dataspace ID */ + hid_t dcpl = H5I_INVALID_HID; /* Dataset creation property list */ hsize_t dims[2] = {6, 10}; /* Dataset dimensions */ char filename[NAME_BUF_SIZE]; /* File name */ int buf[6][10], chkbuf1[6][10], chkbuf2[6][10]; /* Buffers for data */ @@ -1623,7 +1626,7 @@ test_start_swmr_write(hid_t in_fapl, hbool_t new_format) FAIL_STACK_ERROR /* Should be 100 */ - if (attempts != (new_format ? H5F_METADATA_READ_ATTEMPTS : H5F_SWMR_METADATA_READ_ATTEMPTS)) + if (attempts != (unsigned int)(new_format ? H5F_METADATA_READ_ATTEMPTS : H5F_SWMR_METADATA_READ_ATTEMPTS)) TEST_ERROR; /* Close the property list */ @@ -4499,8 +4502,9 @@ test_file_lock_same(hid_t in_fapl) static int test_file_lock_swmr_same(hid_t in_fapl) { - hid_t fid, fid2; /* File IDs */ - hid_t fapl; /* File access property list */ + hid_t fid = H5I_INVALID_HID; /* File IDs */ + hid_t fid2 = H5I_INVALID_HID; + hid_t fapl = H5I_INVALID_HID; /* File access property list */ char filename[NAME_BUF_SIZE]; /* file name */ /* Output message about test being performed */ @@ -6556,10 +6560,18 @@ test_swmr_vfd_flag(void) static int test_bug_refresh(hid_t in_fapl) { - hid_t fid = -1; /* File ID */ - hid_t fapl; + hid_t fid = H5I_INVALID_HID; + hid_t fapl = H5I_INVALID_HID; H5F_t *f; - hid_t gid1, gid2, gid3, gid4, gid5, gid6, gid7, gid8, gid9; + hid_t gid1 = H5I_INVALID_HID; + hid_t gid2 = H5I_INVALID_HID; + hid_t gid3 = H5I_INVALID_HID; + hid_t gid4 = H5I_INVALID_HID; + hid_t gid5 = H5I_INVALID_HID; + hid_t gid6 = H5I_INVALID_HID; + hid_t gid7 = H5I_INVALID_HID; + hid_t gid8 = H5I_INVALID_HID; + hid_t gid9 = H5I_INVALID_HID; char filename[NAME_BUF_SIZE]; /* File name */ /* Create a copy of the input parameter in_fapl */ From 41ba92c05b412c85149907030c8a02bf2d282ea0 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 22 Mar 2021 12:31:33 +0000 Subject: [PATCH 5/5] Committing clang-format changes --- test/swmr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/swmr.c b/test/swmr.c index ee08df70d36..24a0b7c643c 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -4502,7 +4502,7 @@ test_file_lock_same(hid_t in_fapl) static int test_file_lock_swmr_same(hid_t in_fapl) { - hid_t fid = H5I_INVALID_HID; /* File IDs */ + hid_t fid = H5I_INVALID_HID; /* File IDs */ hid_t fid2 = H5I_INVALID_HID; hid_t fapl = H5I_INVALID_HID; /* File access property list */ char filename[NAME_BUF_SIZE]; /* file name */