diff --git a/src/h5core/h5_syscall.c b/src/h5core/h5_syscall.c index 2fdd73a..2bf37d9 100644 --- a/src/h5core/h5_syscall.c +++ b/src/h5core/h5_syscall.c @@ -4,37 +4,31 @@ #include "h5_core.h" #include "h5_core_private.h" -void * +void* h5priv_alloc ( - h5_file_t * const f, - void *ptr, + h5_file_t* const f, + void* ptr, const size_t size ) { - h5_debug ( f, "Allocating %ld bytes.", size ); - ptr = realloc ( ptr, size ); - if ( ptr == NULL ) { - h5_error ( - f, - H5_ERR_NOMEM, - "Out of memory." ); + h5_debug (f, "Allocating %ld bytes.", size); + ptr = realloc (ptr, size); + if (ptr == NULL) { + h5_error (f, H5_ERR_NOMEM, "Out of memory."); return (void*)(H5_ERR); } return ptr; } -void * +void* h5priv_calloc ( - h5_file_t * const f, + h5_file_t* const f, const size_t count, const size_t size ) { - h5_debug ( f, "Allocating %ld * %ld bytes.", count, size ); - void *ptr = calloc ( count, size ); - if ( ptr == NULL ) { - h5_error ( - f, - H5_ERR_NOMEM, - "Out of memory." ); + h5_debug (f, "Allocating %ld * %ld bytes.", count, size); + void* ptr = calloc (count, size); + if (ptr == NULL) { + h5_error (f, H5_ERR_NOMEM, "Out of memory."); return (void*)(H5_ERR); } return ptr; @@ -42,26 +36,23 @@ h5priv_calloc ( h5_err_t h5priv_free ( - h5_file_t * const f, - void *ptr + h5_file_t* const f, + void* ptr ) { - if ( ptr ) free ( ptr ); + if (ptr) free (ptr); return H5_SUCCESS; } -void * +void* h5priv_tsearch ( - h5_file_t * const f, - const void *key, - void **rootp, - int (*compar) (const void *key1, const void *key2) + h5_file_t* const f, + const void* key, + void** rootp, + int (*compar) (const void* key1, const void* key2) ) { - void *ptr = tsearch ( key, rootp, compar ); - if ( ptr == NULL ) { - h5_error ( - f, - H5_ERR_NOMEM, - "Out of memory." ); + void* ptr = tsearch (key, rootp, compar); + if (ptr == NULL) { + h5_error (f, H5_ERR_NOMEM, "Out of memory."); return (void*)(H5_ERR); } return ptr; @@ -69,13 +60,13 @@ h5priv_tsearch ( void * h5priv_tfind ( - h5_file_t * const f, - const void *key, - void *const *rootp, - int (*compar) (const void *key1, const void *key2) + h5_file_t* const f, + const void* key, + void* const* rootp, + int (*compar) (const void* key1, const void* key2) ) { - void *ptr = tfind ( key, rootp, compar ); - if ( ptr == NULL ) { + void* ptr = tfind (key, rootp, compar); + if (ptr == NULL) { return (void*)(H5_ERR); } return ptr;