diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-11-08 22:14:07 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2013-11-08 22:17:10 +0100 |
commit | 76c93d23c073ef8b885503b7d28a31ffe2add6d8 (patch) | |
tree | 1dd2d22a197bc40c5330e516969a7cb1ae9bc96f /lib/gnutls_mem.c | |
parent | 559a144f6bbcbb611453f82e655dd7438c14d1a7 (diff) | |
download | gnutls-76c93d23c073ef8b885503b7d28a31ffe2add6d8.tar.gz |
reindented code
Diffstat (limited to 'lib/gnutls_mem.c')
-rw-r--r-- | lib/gnutls_mem.c | 71 |
1 files changed, 32 insertions, 39 deletions
diff --git a/lib/gnutls_mem.c b/lib/gnutls_mem.c index 76d183a5c2..2effd1498f 100644 --- a/lib/gnutls_mem.c +++ b/lib/gnutls_mem.c @@ -33,58 +33,53 @@ gnutls_realloc_function gnutls_realloc = realloc; void *(*gnutls_calloc) (size_t, size_t) = calloc; char *(*gnutls_strdup) (const char *) = _gnutls_strdup; -void * -_gnutls_calloc (size_t nmemb, size_t size) +void *_gnutls_calloc(size_t nmemb, size_t size) { - void *ret; - size_t n = xtimes (nmemb, size); - ret = (size_in_bounds_p (n) ? gnutls_malloc (n) : NULL); - if (ret != NULL) - memset (ret, 0, size); - return ret; + void *ret; + size_t n = xtimes(nmemb, size); + ret = (size_in_bounds_p(n) ? gnutls_malloc(n) : NULL); + if (ret != NULL) + memset(ret, 0, size); + return ret; } -svoid * -gnutls_secure_calloc (size_t nmemb, size_t size) +svoid *gnutls_secure_calloc(size_t nmemb, size_t size) { - svoid *ret; - size_t n = xtimes (nmemb, size); - ret = (size_in_bounds_p (n) ? gnutls_secure_malloc (n) : NULL); - if (ret != NULL) - memset (ret, 0, size); - return ret; + svoid *ret; + size_t n = xtimes(nmemb, size); + ret = (size_in_bounds_p(n) ? gnutls_secure_malloc(n) : NULL); + if (ret != NULL) + memset(ret, 0, size); + return ret; } /* This realloc will free ptr in case realloc * fails. */ -void * -gnutls_realloc_fast (void *ptr, size_t size) +void *gnutls_realloc_fast(void *ptr, size_t size) { - void *ret; + void *ret; - if (size == 0) - return ptr; + if (size == 0) + return ptr; - ret = gnutls_realloc (ptr, size); - if (ret == NULL) - { - gnutls_free (ptr); - } + ret = gnutls_realloc(ptr, size); + if (ret == NULL) { + gnutls_free(ptr); + } - return ret; + return ret; } -char * -_gnutls_strdup (const char *str) +char *_gnutls_strdup(const char *str) { - size_t siz = strlen (str) + 1; - char *ret; + size_t siz = strlen(str) + 1; + char *ret; - ret = gnutls_malloc (siz); - if (ret != NULL) - memcpy (ret, str, siz); - return ret; + ret = gnutls_malloc(siz); + if (ret != NULL) + memcpy(ret, str, siz); + return ret; } @@ -103,8 +98,7 @@ _gnutls_strdup (const char *str) * The allocation function used is the one set by * gnutls_global_set_mem_functions(). **/ -void * -gnutls_malloc (size_t s) +void *gnutls_malloc(size_t s) { } @@ -118,8 +112,7 @@ gnutls_malloc (size_t s) * gnutls_global_set_mem_functions(). * **/ -void -gnutls_free (void *ptr) +void gnutls_free(void *ptr) { } |