diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2023-07-27 23:38:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-27 23:38:50 (GMT) |
commit | e286b6e706b28330a64115c13c11ae832536b857 (patch) | |
tree | a7fdc80d328010b9c6671829f8b19ea433a4380c /hl/src/H5LT.c | |
parent | 41a6b581aef055821796fc9d31f58778dc1c4197 (diff) | |
download | hdf5-e286b6e706b28330a64115c13c11ae832536b857.zip hdf5-e286b6e706b28330a64115c13c11ae832536b857.tar.gz hdf5-e286b6e706b28330a64115c13c11ae832536b857.tar.bz2 |
Sync high-level library with develop (#3298)
Diffstat (limited to 'hl/src/H5LT.c')
-rw-r--r-- | hl/src/H5LT.c | 246 |
1 files changed, 122 insertions, 124 deletions
diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index 4250071..d48f240 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -507,7 +507,7 @@ out: H5Dclose(did); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -674,7 +674,7 @@ H5LTmake_dataset_string(hid_t loc_id, const char *dset_name, const char *buf) if ((tid = H5Tcopy(H5T_C_S1)) < 0) goto out; - size = HDstrlen(buf) + 1; /* extra null term */ + size = strlen(buf) + 1; /* extra null term */ if (H5Tset_size(tid, size) < 0) goto out; @@ -712,7 +712,7 @@ out: H5Tclose(tid); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -760,7 +760,7 @@ H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags) alloc_incr = min_incr; /* Configure FAPL to use the core file driver */ - if (H5Pset_fapl_core(fapl, alloc_incr, FALSE) < 0) + if (H5Pset_fapl_core(fapl, alloc_incr, false) < 0) goto out; /* Set callbacks for file image ops ONLY if the file image is NOT copied */ @@ -804,7 +804,7 @@ H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags) file_open_flags = H5F_ACC_RDONLY; /* define a unique file name */ - HDsnprintf(file_name, (sizeof(file_name) - 1), "file_image_%ld", file_name_counter++); + snprintf(file_name, (sizeof(file_name) - 1), "file_image_%ld", file_name_counter++); /* Assign file image in FAPL to the core file driver */ if ((file_id = H5Fopen(file_name, file_open_flags, fapl)) < 0) @@ -822,7 +822,7 @@ out: { H5Pclose(fapl); } - H5E_END_TRY; + H5E_END_TRY return -1; } /* end H5LTopen_file_image() */ @@ -1021,7 +1021,7 @@ out: H5Dclose(did); H5Tclose(tid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -1073,7 +1073,7 @@ out: H5Dclose(did); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -1144,7 +1144,7 @@ out: H5Sclose(sid); H5Dclose(did); } - H5E_END_TRY; + H5E_END_TRY return -1; } @@ -1179,7 +1179,7 @@ find_dataset(H5_ATTR_UNUSED hid_t loc_id, const char *name, H5_ATTR_UNUSED const * cause the iterator to immediately return that positive value, * indicating short-circuit success */ - if (HDstrncmp(name, (char *)op_data, HDstrlen((char *)op_data)) == 0) + if (strncmp(name, (char *)op_data, strlen((char *)op_data)) == 0) ret = 1; return ret; @@ -1260,7 +1260,7 @@ H5LTset_attribute_string(hid_t loc_id, const char *obj_name, const char *attr_na if ((attr_type = H5Tcopy(H5T_C_S1)) < 0) goto out; - attr_size = HDstrlen(attr_data) + 1; /* extra null term */ + attr_size = strlen(attr_data) + 1; /* extra null term */ if (H5Tset_size(attr_type, (size_t)attr_size) < 0) goto out; @@ -1720,7 +1720,6 @@ H5LTget_attribute_ndims(hid_t loc_id, const char *obj_name, const char *attr_nam /* End access to the attribute */ if (H5Aclose(attr_id)) goto out; - ; /* Close the object */ if (H5Oclose(obj_id) < 0) @@ -1839,7 +1838,7 @@ H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type) goto out; } - input_len = HDstrlen(text); + input_len = strlen(text); myinput = HDstrdup(text); if ((type_id = H5LTyyparse()) < 0) { @@ -1866,7 +1865,7 @@ out: *------------------------------------------------------------------------- */ static char * -realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, const char *str_to_add) +realloc_and_append(bool _no_user_buf, size_t *len, char *buf, const char *str_to_add) { size_t size_str_to_add, size_str; @@ -1877,10 +1876,10 @@ realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, const char *str goto out; /* If the buffer isn't big enough, reallocate it. Otherwise, go to do strcat. */ - if (str_to_add && ((ssize_t)(*len - (HDstrlen(buf) + HDstrlen(str_to_add) + 1)) < LIMIT)) { - *len += ((HDstrlen(buf) + HDstrlen(str_to_add) + 1) / INCREMENT + 1) * INCREMENT; + if (str_to_add && ((ssize_t)(*len - (strlen(buf) + strlen(str_to_add) + 1)) < LIMIT)) { + *len += ((strlen(buf) + strlen(str_to_add) + 1) / INCREMENT + 1) * INCREMENT; } - else if (!str_to_add && ((ssize_t)(*len - HDstrlen(buf) - 1) < LIMIT)) { + else if (!str_to_add && ((ssize_t)(*len - strlen(buf) - 1) < LIMIT)) { *len += INCREMENT; } @@ -1896,19 +1895,19 @@ realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, const char *str if (str_to_add) { /* find the size of the buffer to add */ - size_str_to_add = HDstrlen(str_to_add); + size_str_to_add = strlen(str_to_add); /* find the size of the current buffer */ - size_str = HDstrlen(buf); + size_str = strlen(buf); /* Check to make sure the appended string does not * extend past the allocated buffer; if it does then truncate the string */ if (size_str < *len - 1) { if (size_str + size_str_to_add < *len - 1) { - HDstrcat(buf, str_to_add); + strcat(buf, str_to_add); } else { - HDstrncat(buf, str_to_add, (*len - 1) - size_str); + strncat(buf, str_to_add, (*len - 1) - size_str); } } else { @@ -1932,7 +1931,7 @@ out: *------------------------------------------------------------------------- */ static char * -indentation(size_t x, char *str, hbool_t no_u_buf, size_t *s_len) +indentation(size_t x, char *str, bool no_u_buf, size_t *s_len) { char tmp_str[TMP_LEN]; @@ -1941,7 +1940,7 @@ indentation(size_t x, char *str, hbool_t no_u_buf, size_t *s_len) tmp_str[x] = '\0'; } else - HDsnprintf(tmp_str, TMP_LEN, "error: the indentation exceeds the number of cols."); + snprintf(tmp_str, TMP_LEN, "error: the indentation exceeds the number of cols."); if (!(str = realloc_and_append(no_u_buf, s_len, str, tmp_str))) goto out; @@ -1961,7 +1960,7 @@ out: * *-----------------------------------------------------------------------*/ static char * -print_enum(hid_t type, char *str, size_t *str_len, hbool_t no_ubuf, size_t indt) +print_enum(hid_t type, char *str, size_t *str_len, bool no_ubuf, size_t indt) { char **name = NULL; /*member names */ unsigned char *value = NULL; /*value array */ @@ -2020,7 +2019,7 @@ print_enum(hid_t type, char *str, size_t *str_len, hbool_t no_ubuf, size_t indt) for (i = 0; i < nmembs; i++) { if (!(str = indentation(indt + COL, str, no_ubuf, str_len))) goto out; - nchars = HDsnprintf(tmp_str, TMP_LEN, "\"%s\"", name[i]); + nchars = snprintf(tmp_str, TMP_LEN, "\"%s\"", name[i]); if (!(str = realloc_and_append(no_ubuf, str_len, str, tmp_str))) goto out; memset(tmp_str, ' ', (size_t)MAX(3, 19 - nchars) + 1); @@ -2029,13 +2028,13 @@ print_enum(hid_t type, char *str, size_t *str_len, hbool_t no_ubuf, size_t indt) goto out; if (H5T_SGN_NONE == H5Tget_sign(native)) - HDsnprintf(tmp_str, TMP_LEN, "%u", *((unsigned int *)((void *)(value + (size_t)i * dst_size)))); + snprintf(tmp_str, TMP_LEN, "%u", *((unsigned int *)((void *)(value + (size_t)i * dst_size)))); else - HDsnprintf(tmp_str, TMP_LEN, "%d", *((int *)((void *)(value + (size_t)i * dst_size)))); + snprintf(tmp_str, TMP_LEN, "%d", *((int *)((void *)(value + (size_t)i * dst_size)))); if (!(str = realloc_and_append(no_ubuf, str_len, str, tmp_str))) goto out; - HDsnprintf(tmp_str, TMP_LEN, ";\n"); + snprintf(tmp_str, TMP_LEN, ";\n"); if (!(str = realloc_and_append(no_ubuf, str_len, str, tmp_str))) goto out; } @@ -2104,7 +2103,7 @@ H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t *len) text_str[0] = '\0'; if (!(text_str = H5LT_dtype_to_text(dtype, text_str, lang_type, &str_len, 1))) goto out; - *len = HDstrlen(text_str) + 1; + *len = strlen(text_str) + 1; if (text_str) free(text_str); text_str = NULL; @@ -2135,7 +2134,7 @@ out: *------------------------------------------------------------------------- */ char * -H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hbool_t no_user_buf) +H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, bool no_user_buf) { H5T_class_t tcls; char tmp_str[TMP_LEN]; @@ -2145,7 +2144,7 @@ H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hb goto out; if (lang != H5LT_DDL) { - HDsnprintf(dt_str, *slen, "only DDL is supported for now"); + snprintf(dt_str, *slen, "only DDL is supported for now"); goto out; } @@ -2156,112 +2155,112 @@ H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hb case H5T_INTEGER: case H5T_BITFIELD: if (H5Tequal(dtype, H5T_STD_I8BE)) { - HDsnprintf(dt_str, *slen, "H5T_STD_I8BE"); + snprintf(dt_str, *slen, "H5T_STD_I8BE"); } else if (H5Tequal(dtype, H5T_STD_I8LE)) { - HDsnprintf(dt_str, *slen, "H5T_STD_I8LE"); + snprintf(dt_str, *slen, "H5T_STD_I8LE"); } else if (H5Tequal(dtype, H5T_STD_I16BE)) { - HDsnprintf(dt_str, *slen, "H5T_STD_I16BE"); + snprintf(dt_str, *slen, "H5T_STD_I16BE"); } else if (H5Tequal(dtype, H5T_STD_I16LE)) { - HDsnprintf(dt_str, *slen, "H5T_STD_I16LE"); + snprintf(dt_str, *slen, "H5T_STD_I16LE"); } else if (H5Tequal(dtype, H5T_STD_I32BE)) { - HDsnprintf(dt_str, *slen, "H5T_STD_I32BE"); + snprintf(dt_str, *slen, "H5T_STD_I32BE"); } else if (H5Tequal(dtype, H5T_STD_I32LE)) { - HDsnprintf(dt_str, *slen, "H5T_STD_I32LE"); + snprintf(dt_str, *slen, "H5T_STD_I32LE"); } else if (H5Tequal(dtype, H5T_STD_I64BE)) { - HDsnprintf(dt_str, *slen, "H5T_STD_I64BE"); + snprintf(dt_str, *slen, "H5T_STD_I64BE"); } else if (H5Tequal(dtype, H5T_STD_I64LE)) { - HDsnprintf(dt_str, *slen, "H5T_STD_I64LE"); + snprintf(dt_str, *slen, "H5T_STD_I64LE"); } else if (H5Tequal(dtype, H5T_STD_U8BE)) { - HDsnprintf(dt_str, *slen, "H5T_STD_U8BE"); + snprintf(dt_str, *slen, "H5T_STD_U8BE"); } else if (H5Tequal(dtype, H5T_STD_U8LE)) { - HDsnprintf(dt_str, *slen, "H5T_STD_U8LE"); + snprintf(dt_str, *slen, "H5T_STD_U8LE"); } else if (H5Tequal(dtype, H5T_STD_U16BE)) { - HDsnprintf(dt_str, *slen, "H5T_STD_U16BE"); + snprintf(dt_str, *slen, "H5T_STD_U16BE"); } else if (H5Tequal(dtype, H5T_STD_U16LE)) { - HDsnprintf(dt_str, *slen, "H5T_STD_U16LE"); + snprintf(dt_str, *slen, "H5T_STD_U16LE"); } else if (H5Tequal(dtype, H5T_STD_U32BE)) { - HDsnprintf(dt_str, *slen, "H5T_STD_U32BE"); + snprintf(dt_str, *slen, "H5T_STD_U32BE"); } else if (H5Tequal(dtype, H5T_STD_U32LE)) { - HDsnprintf(dt_str, *slen, "H5T_STD_U32LE"); + snprintf(dt_str, *slen, "H5T_STD_U32LE"); } else if (H5Tequal(dtype, H5T_STD_U64BE)) { - HDsnprintf(dt_str, *slen, "H5T_STD_U64BE"); + snprintf(dt_str, *slen, "H5T_STD_U64BE"); } else if (H5Tequal(dtype, H5T_STD_U64LE)) { - HDsnprintf(dt_str, *slen, "H5T_STD_U64LE"); + snprintf(dt_str, *slen, "H5T_STD_U64LE"); } else if (H5Tequal(dtype, H5T_NATIVE_SCHAR)) { - HDsnprintf(dt_str, *slen, "H5T_NATIVE_SCHAR"); + snprintf(dt_str, *slen, "H5T_NATIVE_SCHAR"); } else if (H5Tequal(dtype, H5T_NATIVE_UCHAR)) { - HDsnprintf(dt_str, *slen, "H5T_NATIVE_UCHAR"); + snprintf(dt_str, *slen, "H5T_NATIVE_UCHAR"); } else if (H5Tequal(dtype, H5T_NATIVE_SHORT)) { - HDsnprintf(dt_str, *slen, "H5T_NATIVE_SHORT"); + snprintf(dt_str, *slen, "H5T_NATIVE_SHORT"); } else if (H5Tequal(dtype, H5T_NATIVE_USHORT)) { - HDsnprintf(dt_str, *slen, "H5T_NATIVE_USHORT"); + snprintf(dt_str, *slen, "H5T_NATIVE_USHORT"); } else if (H5Tequal(dtype, H5T_NATIVE_INT)) { - HDsnprintf(dt_str, *slen, "H5T_NATIVE_INT"); + snprintf(dt_str, *slen, "H5T_NATIVE_INT"); } else if (H5Tequal(dtype, H5T_NATIVE_UINT)) { - HDsnprintf(dt_str, *slen, "H5T_NATIVE_UINT"); + snprintf(dt_str, *slen, "H5T_NATIVE_UINT"); } else if (H5Tequal(dtype, H5T_NATIVE_LONG)) { - HDsnprintf(dt_str, *slen, "H5T_NATIVE_LONG"); + snprintf(dt_str, *slen, "H5T_NATIVE_LONG"); } else if (H5Tequal(dtype, H5T_NATIVE_ULONG)) { - HDsnprintf(dt_str, *slen, "H5T_NATIVE_ULONG"); + snprintf(dt_str, *slen, "H5T_NATIVE_ULONG"); } else if (H5Tequal(dtype, H5T_NATIVE_LLONG)) { - HDsnprintf(dt_str, *slen, "H5T_NATIVE_LLONG"); + snprintf(dt_str, *slen, "H5T_NATIVE_LLONG"); } else if (H5Tequal(dtype, H5T_NATIVE_ULLONG)) { - HDsnprintf(dt_str, *slen, "H5T_NATIVE_ULLONG"); + snprintf(dt_str, *slen, "H5T_NATIVE_ULLONG"); } else { - HDsnprintf(dt_str, *slen, "undefined integer"); + snprintf(dt_str, *slen, "undefined integer"); } break; case H5T_FLOAT: if (H5Tequal(dtype, H5T_IEEE_F32BE)) { - HDsnprintf(dt_str, *slen, "H5T_IEEE_F32BE"); + snprintf(dt_str, *slen, "H5T_IEEE_F32BE"); } else if (H5Tequal(dtype, H5T_IEEE_F32LE)) { - HDsnprintf(dt_str, *slen, "H5T_IEEE_F32LE"); + snprintf(dt_str, *slen, "H5T_IEEE_F32LE"); } else if (H5Tequal(dtype, H5T_IEEE_F64BE)) { - HDsnprintf(dt_str, *slen, "H5T_IEEE_F64BE"); + snprintf(dt_str, *slen, "H5T_IEEE_F64BE"); } else if (H5Tequal(dtype, H5T_IEEE_F64LE)) { - HDsnprintf(dt_str, *slen, "H5T_IEEE_F64LE"); + snprintf(dt_str, *slen, "H5T_IEEE_F64LE"); } else if (H5Tequal(dtype, H5T_NATIVE_FLOAT)) { - HDsnprintf(dt_str, *slen, "H5T_NATIVE_FLOAT"); + snprintf(dt_str, *slen, "H5T_NATIVE_FLOAT"); } else if (H5Tequal(dtype, H5T_NATIVE_DOUBLE)) { - HDsnprintf(dt_str, *slen, "H5T_NATIVE_DOUBLE"); + snprintf(dt_str, *slen, "H5T_NATIVE_DOUBLE"); } else if (H5Tequal(dtype, H5T_NATIVE_LDOUBLE)) { - HDsnprintf(dt_str, *slen, "H5T_NATIVE_LDOUBLE"); + snprintf(dt_str, *slen, "H5T_NATIVE_LDOUBLE"); } else { - HDsnprintf(dt_str, *slen, "undefined float"); + snprintf(dt_str, *slen, "undefined float"); } break; @@ -2289,16 +2288,16 @@ H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hb goto out; /* Print lead-in */ - HDsnprintf(dt_str, *slen, "H5T_STRING {\n"); + snprintf(dt_str, *slen, "H5T_STRING {\n"); indent += COL; if (!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) goto out; if (is_vlstr) - HDsnprintf(tmp_str, TMP_LEN, "STRSIZE H5T_VARIABLE;\n"); + snprintf(tmp_str, TMP_LEN, "STRSIZE H5T_VARIABLE;\n"); else - HDsnprintf(tmp_str, TMP_LEN, "STRSIZE %d;\n", (int)size); + snprintf(tmp_str, TMP_LEN, "STRSIZE %d;\n", (int)size); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; @@ -2307,13 +2306,13 @@ H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hb goto out; if (str_pad == H5T_STR_NULLTERM) - HDsnprintf(tmp_str, TMP_LEN, "STRPAD H5T_STR_NULLTERM;\n"); + snprintf(tmp_str, TMP_LEN, "STRPAD H5T_STR_NULLTERM;\n"); else if (str_pad == H5T_STR_NULLPAD) - HDsnprintf(tmp_str, TMP_LEN, "STRPAD H5T_STR_NULLPAD;\n"); + snprintf(tmp_str, TMP_LEN, "STRPAD H5T_STR_NULLPAD;\n"); else if (str_pad == H5T_STR_SPACEPAD) - HDsnprintf(tmp_str, TMP_LEN, "STRPAD H5T_STR_SPACEPAD;\n"); + snprintf(tmp_str, TMP_LEN, "STRPAD H5T_STR_SPACEPAD;\n"); else - HDsnprintf(tmp_str, TMP_LEN, "STRPAD H5T_STR_ERROR;\n"); + snprintf(tmp_str, TMP_LEN, "STRPAD H5T_STR_ERROR;\n"); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; @@ -2322,11 +2321,11 @@ H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hb goto out; if (cset == H5T_CSET_ASCII) - HDsnprintf(tmp_str, TMP_LEN, "CSET H5T_CSET_ASCII;\n"); + snprintf(tmp_str, TMP_LEN, "CSET H5T_CSET_ASCII;\n"); else if (cset == H5T_CSET_UTF8) - HDsnprintf(tmp_str, TMP_LEN, "CSET H5T_CSET_UTF8;\n"); + snprintf(tmp_str, TMP_LEN, "CSET H5T_CSET_UTF8;\n"); else - HDsnprintf(tmp_str, TMP_LEN, "CSET unknown;\n"); + snprintf(tmp_str, TMP_LEN, "CSET unknown;\n"); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; @@ -2352,7 +2351,7 @@ H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hb /* Check C variable-length string first. Are the two types equal? */ if (H5Tequal(tmp_type, str_type)) { - HDsnprintf(tmp_str, TMP_LEN, "CTYPE H5T_C_S1;\n"); + snprintf(tmp_str, TMP_LEN, "CTYPE H5T_C_S1;\n"); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; goto next; @@ -2371,7 +2370,7 @@ H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hb } if (H5Tequal(tmp_type, str_type)) { - HDsnprintf(tmp_str, TMP_LEN, "CTYPE H5T_C_S1;\n"); + snprintf(tmp_str, TMP_LEN, "CTYPE H5T_C_S1;\n"); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; goto next; @@ -2393,7 +2392,7 @@ H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hb /* Are the two types equal? */ if (H5Tequal(tmp_type, str_type)) { - HDsnprintf(tmp_str, TMP_LEN, "CTYPE H5T_FORTRAN_S1;\n"); + snprintf(tmp_str, TMP_LEN, "CTYPE H5T_FORTRAN_S1;\n"); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; goto next; @@ -2413,14 +2412,14 @@ H5LT_dtype_to_text(hid_t dtype, char *dt_str, H5LT_lang_t lang, size_t *slen, hb /* Are the two types equal? */ if (H5Tequal(tmp_type, str_type)) { - HDsnprintf(tmp_str, TMP_LEN, "CTYPE H5T_FORTRAN_S1;\n"); + snprintf(tmp_str, TMP_LEN, "CTYPE H5T_FORTRAN_S1;\n"); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; goto next; } /* Type doesn't match any of above. */ - HDsnprintf(tmp_str, TMP_LEN, "CTYPE unknown_one_character_type;\n"); + snprintf(tmp_str, TMP_LEN, "CTYPE unknown_one_character_type;\n"); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; @@ -2432,7 +2431,7 @@ next: indent -= COL; if (!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) goto out; - HDsnprintf(tmp_str, TMP_LEN, "}"); + snprintf(tmp_str, TMP_LEN, "}"); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; @@ -2442,12 +2441,12 @@ next: char *tag = NULL; /* Print lead-in */ - HDsnprintf(dt_str, *slen, "H5T_OPAQUE {\n"); + snprintf(dt_str, *slen, "H5T_OPAQUE {\n"); indent += COL; if (!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) goto out; - HDsnprintf(tmp_str, TMP_LEN, "OPQ_SIZE %lu;\n", (unsigned long)H5Tget_size(dtype)); + snprintf(tmp_str, TMP_LEN, "OPQ_SIZE %lu;\n", (unsigned long)H5Tget_size(dtype)); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; @@ -2455,13 +2454,13 @@ next: goto out; tag = H5Tget_tag(dtype); if (tag) { - HDsnprintf(tmp_str, TMP_LEN, "OPQ_TAG \"%s\";\n", tag); + snprintf(tmp_str, TMP_LEN, "OPQ_TAG \"%s\";\n", tag); if (tag) H5free_memory(tag); tag = NULL; } else - HDsnprintf(tmp_str, TMP_LEN, "OPQ_TAG \"\";\n"); + snprintf(tmp_str, TMP_LEN, "OPQ_TAG \"\";\n"); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; @@ -2469,7 +2468,7 @@ next: indent -= COL; if (!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) goto out; - HDsnprintf(tmp_str, TMP_LEN, "}"); + snprintf(tmp_str, TMP_LEN, "}"); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; @@ -2481,7 +2480,7 @@ next: char *stmp = NULL; /* Print lead-in */ - HDsnprintf(dt_str, *slen, "H5T_ENUM {\n"); + snprintf(dt_str, *slen, "H5T_ENUM {\n"); indent += COL; if (!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) goto out; @@ -2504,7 +2503,7 @@ next: free(stmp); stmp = NULL; - HDsnprintf(tmp_str, TMP_LEN, ";\n"); + snprintf(tmp_str, TMP_LEN, ";\n"); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; H5Tclose(super); @@ -2516,7 +2515,7 @@ next: indent -= COL; if (!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) goto out; - HDsnprintf(tmp_str, TMP_LEN, "}"); + snprintf(tmp_str, TMP_LEN, "}"); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; @@ -2528,7 +2527,7 @@ next: char *stmp = NULL; /* Print lead-in */ - HDsnprintf(dt_str, *slen, "H5T_VLEN {\n"); + snprintf(dt_str, *slen, "H5T_VLEN {\n"); indent += COL; if (!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) goto out; @@ -2550,7 +2549,7 @@ next: if (stmp) free(stmp); stmp = NULL; - HDsnprintf(tmp_str, TMP_LEN, "\n"); + snprintf(tmp_str, TMP_LEN, "\n"); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; H5Tclose(super); @@ -2559,7 +2558,7 @@ next: indent -= COL; if (!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) goto out; - HDsnprintf(tmp_str, TMP_LEN, "}"); + snprintf(tmp_str, TMP_LEN, "}"); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; @@ -2573,7 +2572,7 @@ next: int ndims; /* Print lead-in */ - HDsnprintf(dt_str, *slen, "H5T_ARRAY {\n"); + snprintf(dt_str, *slen, "H5T_ARRAY {\n"); indent += COL; if (!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) goto out; @@ -2586,11 +2585,11 @@ next: /* Print array dimensions */ for (i = 0; i < ndims; i++) { - HDsnprintf(tmp_str, TMP_LEN, "[%d]", (int)dims[i]); + snprintf(tmp_str, TMP_LEN, "[%d]", (int)dims[i]); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; } - HDsnprintf(tmp_str, TMP_LEN, " "); + snprintf(tmp_str, TMP_LEN, " "); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; @@ -2610,7 +2609,7 @@ next: if (stmp) free(stmp); stmp = NULL; - HDsnprintf(tmp_str, TMP_LEN, "\n"); + snprintf(tmp_str, TMP_LEN, "\n"); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; H5Tclose(super); @@ -2619,7 +2618,7 @@ next: indent -= COL; if (!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) goto out; - HDsnprintf(tmp_str, TMP_LEN, "}"); + snprintf(tmp_str, TMP_LEN, "}"); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; @@ -2637,7 +2636,7 @@ next: if ((nmembs = H5Tget_nmembers(dtype)) < 0) goto out; - HDsnprintf(dt_str, *slen, "H5T_COMPOUND {\n"); + snprintf(dt_str, *slen, "H5T_COMPOUND {\n"); indent += COL; for (i = 0; i < nmembs; i++) { @@ -2672,14 +2671,14 @@ next: if (H5T_COMPOUND == mclass) indent -= COL; - HDsnprintf(tmp_str, TMP_LEN, " \"%s\"", mname); + snprintf(tmp_str, TMP_LEN, " \"%s\"", mname); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; if (mname) H5free_memory(mname); mname = NULL; - HDsnprintf(tmp_str, TMP_LEN, " : %lu;\n", (unsigned long)moffset); + snprintf(tmp_str, TMP_LEN, " : %lu;\n", (unsigned long)moffset); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; } @@ -2688,30 +2687,30 @@ next: indent -= COL; if (!(dt_str = indentation(indent + COL, dt_str, no_user_buf, slen))) goto out; - HDsnprintf(tmp_str, TMP_LEN, "}"); + snprintf(tmp_str, TMP_LEN, "}"); if (!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; break; } case H5T_TIME: - HDsnprintf(dt_str, *slen, "H5T_TIME: not yet implemented"); + snprintf(dt_str, *slen, "H5T_TIME: not yet implemented"); break; case H5T_NO_CLASS: - HDsnprintf(dt_str, *slen, "H5T_NO_CLASS"); + snprintf(dt_str, *slen, "H5T_NO_CLASS"); break; case H5T_REFERENCE: - if (H5Tequal(dtype, H5T_STD_REF_DSETREG) == TRUE) { - HDsnprintf(dt_str, *slen, " H5T_REFERENCE { H5T_STD_REF_DSETREG }"); + if (H5Tequal(dtype, H5T_STD_REF_DSETREG) == true) { + snprintf(dt_str, *slen, " H5T_REFERENCE { H5T_STD_REF_DSETREG }"); } else { - HDsnprintf(dt_str, *slen, " H5T_REFERENCE { H5T_STD_REF_OBJECT }"); + snprintf(dt_str, *slen, " H5T_REFERENCE { H5T_STD_REF_OBJECT }"); } break; case H5T_NCLASSES: break; default: - HDsnprintf(dt_str, *slen, "unknown data type"); + snprintf(dt_str, *slen, "unknown data type"); } return dt_str; @@ -3137,7 +3136,6 @@ H5LT_get_attribute_disk(hid_t loc_id, const char *attr_name, void *attr_out) if (H5Aclose(attr_id) < 0) return -1; - ; return 0; @@ -3181,7 +3179,7 @@ H5LT_set_attribute_string(hid_t dset_id, const char *name, const char *buf) if ((tid = H5Tcopy(H5T_C_S1)) < 0) return FAIL; - size = HDstrlen(buf) + 1; /* extra null term */ + size = strlen(buf) + 1; /* extra null term */ if (H5Tset_size(tid, (size_t)size) < 0) goto out; @@ -3221,7 +3219,7 @@ out: H5Tclose(tid); H5Sclose(sid); } - H5E_END_TRY; + H5E_END_TRY return FAIL; } @@ -3237,7 +3235,7 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid) htri_t ret_value; /* Initialize */ - ret_value = FALSE; + ret_value = false; /* check the arguments */ if (path == NULL) { @@ -3252,17 +3250,17 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid) } /* Find the length of the path */ - path_length = HDstrlen(path); + path_length = strlen(path); /* Check if the identifier is the object itself, i.e. path is '.' */ - if (HDstrncmp(path, ".", path_length) == 0) { + if (strncmp(path, ".", path_length) == 0) { if (check_object_valid) { obj_exists = H5Oexists_by_name(loc_id, path, H5P_DEFAULT); ret_value = obj_exists; goto done; } else { - ret_value = TRUE; /* Since the object is the identifier itself, + ret_value = true; /* Since the object is the identifier itself, * we can only check if loc_id is a valid type */ goto done; } @@ -3277,18 +3275,18 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid) curr_name = tmp_path; /* check if absolute pathname */ - if (HDstrncmp(path, "/", 1) == 0) + if (strncmp(path, "/", 1) == 0) curr_name++; /* check if relative path name starts with "./" */ - if (HDstrncmp(path, "./", 2) == 0) + if (strncmp(path, "./", 2) == 0) curr_name += 2; - while ((delimit = HDstrchr(curr_name, '/')) != NULL) { + while ((delimit = strchr(curr_name, '/')) != NULL) { /* Change the delimiter to terminate the string */ *delimit = '\0'; - obj_exists = FALSE; + obj_exists = false; if ((link_exists = H5Lexists(loc_id, tmp_path, H5P_DEFAULT)) < 0) { ret_value = FAIL; goto done; @@ -3296,8 +3294,8 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid) /* If target link does not exist then no reason to * continue checking the path */ - if (link_exists != TRUE) { - ret_value = FALSE; + if (link_exists != true) { + ret_value = false; goto done; } @@ -3307,7 +3305,7 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid) goto done; } - if (obj_exists != TRUE) + if (obj_exists != true) break; /* Change the delimiter back to '/' */ @@ -3326,8 +3324,8 @@ H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid) } else { ret_value = link_exists; - /* Determine if link resolves to an actual object for check_object_valid TRUE */ - if (check_object_valid == TRUE && link_exists == TRUE) { + /* Determine if link resolves to an actual object for check_object_valid true */ + if (check_object_valid == true && link_exists == true) { if ((obj_exists = H5Oexists_by_name(loc_id, tmp_path, H5P_DEFAULT)) < 0) { ret_value = FAIL; } |