diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-03-24 19:23:11 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-03-24 19:23:11 (GMT) |
commit | 53e4b5b90b3f5cb9dc7fbe47e6787a5280b2fa04 (patch) | |
tree | 825d37444aa8c0f3bab4442c3f1b0068c7ac2924 /src/H5RS.c | |
parent | 65dc3358db37b04cc64b65b88065cbaf48e63a8b (diff) | |
download | hdf5-53e4b5b90b3f5cb9dc7fbe47e6787a5280b2fa04.zip hdf5-53e4b5b90b3f5cb9dc7fbe47e6787a5280b2fa04.tar.gz hdf5-53e4b5b90b3f5cb9dc7fbe47e6787a5280b2fa04.tar.bz2 |
[svn-r16601] Description:
Bring r16536:16600 from trunk back into revise_chunks branch
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Mac OS X/32 10.5.6 (amazon) in debug mode
Mac OS X/32 10.5.6 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
Diffstat (limited to 'src/H5RS.c')
-rw-r--r-- | src/H5RS.c | 106 |
1 files changed, 53 insertions, 53 deletions
@@ -63,7 +63,7 @@ H5RS_xstrdup(const char *s) { char *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT(H5RS_xstrdup) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5RS_xstrdup) if(s) { ret_value = (char *)H5FL_BLK_MALLOC(str_buf, HDstrlen(s) + 1); @@ -99,21 +99,21 @@ H5RS_xstrdup(const char *s) H5RS_str_t * H5RS_create(const char *s) { - H5RS_str_t *ret_value=NULL; /* Return value */ + H5RS_str_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5RS_create,NULL); + FUNC_ENTER_NOAPI(H5RS_create, NULL) /* Allocate ref-counted string structure */ - if((ret_value=H5FL_MALLOC(H5RS_str_t))==NULL) - HGOTO_ERROR(H5E_RS,H5E_NOSPACE,NULL,"memory allocation failed"); + if(NULL == (ret_value = H5FL_MALLOC(H5RS_str_t))) + HGOTO_ERROR(H5E_RS, H5E_NOSPACE, NULL, "memory allocation failed") /* Set the internal fields */ - ret_value->s=H5RS_xstrdup(s); - ret_value->wrapped=0; - ret_value->n=1; + ret_value->s = H5RS_xstrdup(s); + ret_value->wrapped = 0; + ret_value->n = 1; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5RS_create() */ @@ -139,21 +139,21 @@ done: H5RS_str_t * H5RS_wrap(const char *s) { - H5RS_str_t *ret_value=NULL; /* Return value */ + H5RS_str_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5RS_wrap,NULL); + FUNC_ENTER_NOAPI(H5RS_wrap, NULL) /* Allocate ref-counted string structure */ - if((ret_value=H5FL_MALLOC(H5RS_str_t))==NULL) - HGOTO_ERROR(H5E_RS,H5E_NOSPACE,NULL,"memory allocation failed"); + if(NULL == (ret_value = H5FL_MALLOC(H5RS_str_t))) + HGOTO_ERROR(H5E_RS, H5E_NOSPACE, NULL, "memory allocation failed") /* Set the internal fields */ - ret_value->s=(char*)s; /* (Cast away const OK - QAK) */ - ret_value->wrapped=1; - ret_value->n=1; + ret_value->s = (char*)s; /* (Cast away const OK - QAK) */ + ret_value->wrapped = 1; + ret_value->n = 1; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5RS_wrap() */ @@ -181,21 +181,21 @@ done: H5RS_str_t * H5RS_own(char *s) { - H5RS_str_t *ret_value=NULL; /* Return value */ + H5RS_str_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(H5RS_own,NULL); + FUNC_ENTER_NOAPI(H5RS_own, NULL) /* Allocate ref-counted string structure */ - if((ret_value=H5FL_MALLOC(H5RS_str_t))==NULL) - HGOTO_ERROR(H5E_RS,H5E_NOSPACE,NULL,"memory allocation failed"); + if(NULL == (ret_value = H5FL_MALLOC(H5RS_str_t))) + HGOTO_ERROR(H5E_RS, H5E_NOSPACE, NULL, "memory allocation failed") /* Set the internal fields */ - ret_value->s=s; - ret_value->wrapped=0; - ret_value->n=1; + ret_value->s = s; + ret_value->wrapped = 0; + ret_value->n = 1; done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5RS_own() */ @@ -259,25 +259,25 @@ H5RS_decr(H5RS_str_t *rs) herr_t H5RS_incr(H5RS_str_t *rs) { - FUNC_ENTER_NOAPI_NOFUNC(H5RS_incr); + FUNC_ENTER_NOAPI_NOFUNC(H5RS_incr) /* Sanity check */ - assert(rs); - assert(rs->n > 0); + HDassert(rs); + HDassert(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 * scope appropriately. */ if(rs->wrapped) { - rs->s=H5RS_xstrdup(rs->s); - rs->wrapped=0; + rs->s = H5RS_xstrdup(rs->s); + rs->wrapped = 0; } /* end if */ /* Increment reference count for string */ rs->n++; - FUNC_LEAVE_NOAPI(SUCCEED); + FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5RS_incr() */ @@ -303,14 +303,14 @@ H5RS_incr(H5RS_str_t *rs) H5RS_str_t * H5RS_dup(H5RS_str_t *ret_value) { - FUNC_ENTER_NOAPI_NOFUNC(H5RS_dup); + FUNC_ENTER_NOAPI_NOFUNC(H5RS_dup) /* Check for valid reference counted string */ - if(ret_value!=NULL) + if(ret_value != NULL) /* Increment reference count for string */ ret_value->n++; - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5RS_dup() */ @@ -335,7 +335,7 @@ H5RS_dup(H5RS_str_t *ret_value) H5RS_str_t * H5RS_dup_str(const char *s) { - char *new_str = NULL; /* Duplicate of string */ + char *new_str; /* Duplicate of string */ size_t path_len; /* Length of the path */ H5RS_str_t *ret_value; @@ -387,15 +387,15 @@ int H5RS_cmp(const H5RS_str_t *rs1, const H5RS_str_t *rs2) { /* Can't return invalid value from this function */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5RS_cmp); + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5RS_cmp) /* Sanity check */ - assert(rs1); - assert(rs1->s); - assert(rs2); - assert(rs2->s); + HDassert(rs1); + HDassert(rs1->s); + HDassert(rs2); + HDassert(rs2->s); - FUNC_LEAVE_NOAPI(HDstrcmp(rs1->s,rs2->s)); + FUNC_LEAVE_NOAPI(HDstrcmp(rs1->s, rs2->s)) } /* end H5RS_cmp() */ @@ -420,13 +420,13 @@ H5RS_cmp(const H5RS_str_t *rs1, const H5RS_str_t *rs2) ssize_t H5RS_len(const H5RS_str_t *rs) { - FUNC_ENTER_NOAPI_NOFUNC(H5RS_len); + FUNC_ENTER_NOAPI_NOFUNC(H5RS_len) /* Sanity check */ - assert(rs); - assert(rs->s); + HDassert(rs); + HDassert(rs->s); - FUNC_LEAVE_NOAPI((ssize_t)HDstrlen(rs->s)); + FUNC_LEAVE_NOAPI((ssize_t)HDstrlen(rs->s)) } /* end H5RS_len() */ @@ -454,13 +454,13 @@ H5RS_len(const H5RS_str_t *rs) char * H5RS_get_str(const H5RS_str_t *rs) { - FUNC_ENTER_NOAPI_NOFUNC(H5RS_get_str); + FUNC_ENTER_NOAPI_NOFUNC(H5RS_get_str) /* Sanity check */ - assert(rs); - assert(rs->s); + HDassert(rs); + HDassert(rs->s); - FUNC_LEAVE_NOAPI(rs->s); + FUNC_LEAVE_NOAPI(rs->s) } /* end H5RS_get_str() */ @@ -486,12 +486,12 @@ H5RS_get_str(const H5RS_str_t *rs) unsigned H5RS_get_count(const H5RS_str_t *rs) { - FUNC_ENTER_NOAPI_NOFUNC(H5RS_get_count); + FUNC_ENTER_NOAPI_NOFUNC(H5RS_get_count) /* Sanity check */ - assert(rs); - assert(rs->n>0); + HDassert(rs); + HDassert(rs->n > 0); - FUNC_LEAVE_NOAPI(rs->n); + FUNC_LEAVE_NOAPI(rs->n) } /* end H5RS_get_count() */ |