Mercurial > hg > th-libs
changeset 194:87dac812cac4
Define some argument identifiers in function prototypes and rename some arguments.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 11 Feb 2016 16:42:00 +0200 |
parents | 2b64ad9cdc5f |
children | a16e8272bdda |
files | th_util.c th_util.h |
diffstat | 2 files changed, 16 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/th_util.c Thu Feb 11 16:22:52 2016 +0200 +++ b/th_util.c Thu Feb 11 16:42:00 2016 +0200 @@ -218,27 +218,27 @@ } -void *th_realloc(void *p, size_t l) +void *th_realloc(void *ptr, size_t l) { - return realloc(p, l); + return realloc(ptr, l); } -void th_free(void *p) +void th_free(void *ptr) { /* Check for NULL pointers for portability due to some libc * implementations not handling free(NULL) too well. */ - if (p) free(p); + if (ptr != NULL) free(ptr); } -void th_free_r(void **p) +void th_free_r(void **ptr) { if (p != NULL) { - th_free(*p); - *p = NULL; + th_free(*ptr); + *ptr = NULL; } }
--- a/th_util.h Thu Feb 11 16:22:52 2016 +0200 +++ b/th_util.h Thu Feb 11 16:42:00 2016 +0200 @@ -136,20 +136,20 @@ int th_errno_to_error(int error); const char *th_error_str(int error); -void THERR(const char *, ...); -void THMSG(int, const char *, ...); -void THPRINT(int, const char *, ...); +void THERR(const char *fmt, ...); +void THMSG(int level, const char *fmt, ...); +void THPRINT(int level, const char *fmt, ...); -void THERR_V(const char *, va_list); -void THMSG_V(int, const char *, va_list); -void THPRINT_V(int, const char *, va_list); +void THERR_V(const char *fmt, va_list ap); +void THMSG_V(int level, const char *fmt, va_list ap); +void THPRINT_V(int level, const char *fmt, va_list ap); void *th_malloc(size_t); void *th_malloc0(size_t); void *th_calloc(size_t, size_t); -void *th_realloc(void *, size_t); -void th_free(void *); -void th_free_r(void **); +void *th_realloc(void *ptr, size_t); +void th_free(void *ptr); +void th_free_r(void **ptr); /* Doubly linked list handling