diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 45065e8774d..255fb32b106 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -142,9 +142,8 @@ H5G_map_obj_type(H5O_type_t obj_type) * and it's object ID is returned. * * The SIZE_HINT parameter specifies how much file space to reserve - * to store the names that will appear in this group. This number - * must be less than or equal to UINT32_MAX. If zero is supplied - * for the SIZE_HINT then a default size is chosen. + * to store the names that will appear in this group. If zero is + * supplied for the SIZE_HINT then a default size is chosen. * * Note: Deprecated in favor of H5Gcreate2 * @@ -174,8 +173,6 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint) /* Check arguments */ if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no name given") - if (size_hint > UINT32_MAX) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "size_hint cannot be larger than UINT32_MAX") /* Check if we need to create a non-standard GCPL */ if (size_hint > 0) { @@ -199,7 +196,7 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, H5I_INVALID_HID, "can't get group info") /* Set the non-default local heap size hint */ - H5_CHECKED_ASSIGN(ginfo.lheap_size_hint, uint32_t, size_hint, size_t); + ginfo.lheap_size_hint = size_hint; if (H5P_set(gc_plist, H5G_CRT_GROUP_INFO_NAME, &ginfo) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, H5I_INVALID_HID, "can't set group info") } diff --git a/src/H5Gpublic.h b/src/H5Gpublic.h index b009d4175af..8fe2fe8055b 100644 --- a/src/H5Gpublic.h +++ b/src/H5Gpublic.h @@ -592,8 +592,7 @@ typedef struct H5G_stat_t { * group, is not limited. * * \p size_hint is a hint for the number of bytes to reserve to store - * the names which will be eventually added to the new group. This - * value must be between 0 and UINT32_MAX (inclusive). If this + * the names which will be eventually added to the new group. If this * parameter is zero, a default value will be used. * * The return value is a group identifier for the open group. This diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 65f030876ff..ae2448cf86c 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -684,7 +684,7 @@ typedef struct H5O_bogus_t { */ typedef struct H5O_ginfo_t { /* "Old" format group info (not stored) */ - uint32_t lheap_size_hint; /* Local heap size hint */ + size_t lheap_size_hint; /* Local heap size hint */ /* "New" format group info (stored) */ diff --git a/test/tmisc.c b/test/tmisc.c index 4d0c04dd211..9235e0c832f 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -4088,22 +4088,13 @@ test_misc23(void) H5E_END_TRY; VERIFY(tmp_id, FAIL, "H5Gcreate1"); - /* Make sure that size_hint values that can't fit into a 32-bit - * unsigned integer are rejected. Only necessary on systems where - * size_t is a 64-bit type. - */ - if (SIZE_MAX > UINT32_MAX) { - H5E_BEGIN_TRY - { - tmp_id = H5Gcreate1(file_id, "/size_hint_too_large", SIZE_MAX); - } - H5E_END_TRY; - VERIFY(tmp_id, FAIL, "H5Gcreate1"); - } - tmp_id = H5Gcreate1(file_id, "/A/grp", (size_t)0); CHECK(tmp_id, FAIL, "H5Gcreate1"); + /* Check that the largest size hint is acceptable */ + tmp_id = H5Gcreate1(file_id, "/enormous_size_hint", SIZE_MAX); + CHECK(tmp_id, FAIL, "H5Gcreate1"); + status = H5Gclose(tmp_id); CHECK(status, FAIL, "H5Gclose");