diff options
Diffstat (limited to 'src/H5RS.c')
-rw-r--r-- | src/H5RS.c | 30 |
1 files changed, 15 insertions, 15 deletions
@@ -49,7 +49,7 @@ struct H5RS_str_t { char *end; /* Pointer to terminating NUL character at the end of the string */ size_t len; /* Current length of the string */ size_t max; /* Size of allocated buffer */ - hbool_t wrapped; /* Indicates that the string to be ref-counted is not copied */ + bool wrapped; /* Indicates that the string to be ref-counted is not copied */ unsigned n; /* Reference count of number of pointers sharing string */ }; @@ -113,7 +113,7 @@ H5RS__xstrdup(H5RS_str_t *rs, const char *s) assert(rs); if (s) { - size_t len = HDstrlen(s); + size_t len = strlen(s); /* Determine size of buffer to allocate */ rs->max = H5RS_ALLOC_SIZE; @@ -124,7 +124,7 @@ H5RS__xstrdup(H5RS_str_t *rs, const char *s) if (NULL == (rs->s = (char *)H5FL_BLK_MALLOC(str_buf, rs->max))) HGOTO_ERROR(H5E_RS, H5E_CANTALLOC, FAIL, "memory allocation failed"); if (len) - memcpy(rs->s, s, len); + H5MM_memcpy(rs->s, s, len); rs->end = rs->s + len; *rs->end = '\0'; rs->len = len; @@ -191,7 +191,7 @@ H5RS__prepare_for_append(H5RS_str_t *rs) if (rs->wrapped) { if (H5RS__xstrdup(rs, rs->s) < 0) HGOTO_ERROR(H5E_RS, H5E_CANTCOPY, FAIL, "can't copy string"); - rs->wrapped = FALSE; + rs->wrapped = false; } /* end if */ } /* end else */ @@ -316,16 +316,16 @@ H5RS_wrap(const char *s) * * We ignore warnings about storing a const char pointer in the struct * since we never modify or free the string when the wrapped struct - * field is set to TRUE. + * field is set to true. */ H5_GCC_CLANG_DIAG_OFF("cast-qual") ret_value->s = (char *)s; H5_GCC_CLANG_DIAG_ON("cast-qual") - ret_value->len = HDstrlen(s); + ret_value->len = strlen(s); ret_value->end = ret_value->s + ret_value->len; - ret_value->wrapped = TRUE; + ret_value->wrapped = true; ret_value->max = 0; /* Wrapped, not allocated */ ret_value->n = 1; @@ -372,7 +372,7 @@ H5RS_asprintf_cat(H5RS_str_t *rs, const char *fmt, ...) /* Attempt to write formatted output into the managed string */ va_start(args1, fmt); va_copy(args2, args1); - while ((out_len = (size_t)HDvsnprintf(rs->end, (rs->max - rs->len), fmt, args1)) >= (rs->max - rs->len)) { + while ((out_len = (size_t)vsnprintf(rs->end, (rs->max - rs->len), fmt, args1)) >= (rs->max - rs->len)) { /* Allocate a large enough buffer */ if (H5RS__resize_for_append(rs, out_len) < 0) HGOTO_ERROR(H5E_RS, H5E_CANTRESIZE, FAIL, "can't resize ref-counted string buffer"); @@ -418,7 +418,7 @@ H5RS_acat(H5RS_str_t *rs, const char *s) /* Concatenate the provided string on to the managed string */ if (*s) { - size_t len = HDstrlen(s); + size_t len = strlen(s); /* Allocate the underlying string, if necessary */ if (H5RS__prepare_for_append(rs) < 0) @@ -430,7 +430,7 @@ H5RS_acat(H5RS_str_t *rs, const char *s) HGOTO_ERROR(H5E_RS, H5E_CANTRESIZE, FAIL, "can't resize ref-counted string buffer"); /* Append the string */ - memcpy(rs->end, s, len); + H5MM_memcpy(rs->end, s, len); rs->end += len; *rs->end = '\0'; rs->len += len; @@ -464,7 +464,7 @@ H5RS_ancat(H5RS_str_t *rs, const char *s, size_t n) /* Concatenate the provided string on to the managed string */ if (n && *s) { - size_t len = HDstrlen(s); + size_t len = strlen(s); /* Limit characters to copy to the minimum of 'n' and 'len' */ n = MIN(len, n); @@ -479,7 +479,7 @@ H5RS_ancat(H5RS_str_t *rs, const char *s, size_t n) HGOTO_ERROR(H5E_RS, H5E_CANTRESIZE, FAIL, "can't resize ref-counted string buffer"); /* Append the string */ - memcpy(rs->end, s, n); + H5MM_memcpy(rs->end, s, n); rs->end += n; *rs->end = '\0'; rs->len += n; @@ -602,7 +602,7 @@ H5RS_incr(H5RS_str_t *rs) if (rs->wrapped) { if (H5RS__xstrdup(rs, rs->s) < 0) HGOTO_ERROR(H5E_RS, H5E_CANTCOPY, FAIL, "can't copy string"); - rs->wrapped = FALSE; + rs->wrapped = false; } /* end if */ /* Increment reference count for string */ @@ -677,7 +677,7 @@ H5RS_cmp(const H5RS_str_t *rs1, const H5RS_str_t *rs2) assert(rs2); assert(rs2->s); - FUNC_LEAVE_NOAPI(HDstrcmp(rs1->s, rs2->s)) + FUNC_LEAVE_NOAPI(strcmp(rs1->s, rs2->s)) } /* end H5RS_cmp() */ /*-------------------------------------------------------------------------- @@ -707,7 +707,7 @@ H5RS_len(const H5RS_str_t *rs) assert(rs); assert(rs->s); - FUNC_LEAVE_NOAPI(HDstrlen(rs->s)) + FUNC_LEAVE_NOAPI(strlen(rs->s)) } /* end H5RS_len() */ /*-------------------------------------------------------------------------- |