diff options
Diffstat (limited to 'src/H5RS.c')
-rw-r--r-- | src/H5RS.c | 74 |
1 files changed, 37 insertions, 37 deletions
@@ -110,7 +110,7 @@ H5RS__xstrdup(H5RS_str_t *rs, const char *s) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(rs); + assert(rs); if (s) { size_t len = HDstrlen(s); @@ -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) - HDmemcpy(rs->s, s, len); + memcpy(rs->s, s, len); rs->end = rs->s + len; *rs->end = '\0'; rs->len = len; @@ -138,9 +138,9 @@ H5RS__xstrdup(H5RS_str_t *rs, const char *s) } /* end if */ else { /* Sanity checks */ - HDassert(NULL == rs->end); - HDassert(0 == rs->max); - HDassert(0 == rs->len); + assert(NULL == rs->end); + assert(0 == rs->max); + assert(0 == rs->len); } /* end else */ } /* end else */ @@ -174,7 +174,7 @@ H5RS__prepare_for_append(H5RS_str_t *rs) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(rs); + assert(rs); if (NULL == rs->s) { rs->max = H5RS_ALLOC_SIZE; @@ -226,7 +226,7 @@ H5RS__resize_for_append(H5RS_str_t *rs, size_t len) FUNC_ENTER_PACKAGE /* Sanity check */ - HDassert(rs); + assert(rs); /* Check if buffer should be re-allocated */ if (len >= (rs->max - rs->len)) { @@ -365,24 +365,24 @@ H5RS_asprintf_cat(H5RS_str_t *rs, const char *fmt, ...) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(rs); - HDassert(fmt); + assert(rs); + assert(fmt); /* Prepare the [possibly wrapped or empty] ref-counted string for an append */ if (H5RS__prepare_for_append(rs) < 0) HGOTO_ERROR(H5E_RS, H5E_CANTINIT, FAIL, "can't initialize ref-counted string") /* Attempt to write formatted output into the managed string */ - HDva_start(args1, fmt); - HDva_copy(args2, args1); + 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)) { /* 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") /* Restart the va_list */ - HDva_end(args1); - HDva_copy(args1, args2); + va_end(args1); + va_copy(args1, args2); } /* end while */ /* Increment the size & end of the string */ @@ -390,8 +390,8 @@ H5RS_asprintf_cat(H5RS_str_t *rs, const char *fmt, ...) rs->end += out_len; /* Finish access to varargs */ - HDva_end(args1); - HDva_end(args2); + va_end(args1); + va_end(args2); done: FUNC_LEAVE_NOAPI(ret_value) @@ -419,8 +419,8 @@ H5RS_acat(H5RS_str_t *rs, const char *s) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(rs); - HDassert(s); + assert(rs); + assert(s); /* Concatenate the provided string on to the managed string */ if (*s) { @@ -436,7 +436,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 */ - HDmemcpy(rs->end, s, len); + memcpy(rs->end, s, len); rs->end += len; *rs->end = '\0'; rs->len += len; @@ -468,8 +468,8 @@ H5RS_ancat(H5RS_str_t *rs, const char *s, size_t n) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(rs); - HDassert(s); + assert(rs); + assert(s); /* Concatenate the provided string on to the managed string */ if (n && *s) { @@ -488,7 +488,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 */ - HDmemcpy(rs->end, s, n); + memcpy(rs->end, s, n); rs->end += n; *rs->end = '\0'; rs->len += n; @@ -519,8 +519,8 @@ H5RS_aputc(H5RS_str_t *rs, int c) FUNC_ENTER_NOAPI(FAIL) /* Sanity checks */ - HDassert(rs); - HDassert(c); + assert(rs); + assert(c); /* Allocate the underlying string, if necessary */ if (H5RS__prepare_for_append(rs) < 0) @@ -565,8 +565,8 @@ H5RS_decr(H5RS_str_t *rs) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(rs); - HDassert(rs->n > 0); + assert(rs); + assert(rs->n > 0); /* Decrement reference count for string */ if ((--rs->n) == 0) { @@ -604,8 +604,8 @@ H5RS_incr(H5RS_str_t *rs) FUNC_ENTER_NOAPI(FAIL) /* Sanity check */ - HDassert(rs); - HDassert(rs->n > 0); + assert(rs); + assert(rs->n > 0); /* If the ref-counted string started life as a wrapper around an existing * string, duplicate the string now, so that the wrapped string can go out @@ -684,10 +684,10 @@ H5RS_cmp(const H5RS_str_t *rs1, const H5RS_str_t *rs2) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(rs1); - HDassert(rs1->s); - HDassert(rs2); - HDassert(rs2->s); + assert(rs1); + assert(rs1->s); + assert(rs2); + assert(rs2->s); FUNC_LEAVE_NOAPI(HDstrcmp(rs1->s, rs2->s)) } /* end H5RS_cmp() */ @@ -716,8 +716,8 @@ H5RS_len(const H5RS_str_t *rs) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(rs); - HDassert(rs->s); + assert(rs); + assert(rs->s); FUNC_LEAVE_NOAPI(HDstrlen(rs->s)) } /* end H5RS_len() */ @@ -749,8 +749,8 @@ H5RS_get_str(const H5RS_str_t *rs) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(rs); - HDassert(rs->s); + assert(rs); + assert(rs->s); FUNC_LEAVE_NOAPI(rs->s) } /* end H5RS_get_str() */ @@ -780,8 +780,8 @@ H5RS_get_count(const H5RS_str_t *rs) FUNC_ENTER_NOAPI_NOINIT_NOERR /* Sanity check */ - HDassert(rs); - HDassert(rs->n > 0); + assert(rs); + assert(rs->n > 0); FUNC_LEAVE_NOAPI(rs->n) } /* end H5RS_get_count() */ |