summaryrefslogtreecommitdiff
path: root/lib/gnutls_mem.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2004-06-07 10:05:43 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2004-06-07 10:05:43 +0000
commit802e1ede038010ddab31225f4b8a7e8d74f3b987 (patch)
treef9f07d2fb57da9843ac6b79e06e9266301b7e8b7 /lib/gnutls_mem.c
parente0781d87ea58ff1ac1b6439d60510a8a26ea9f54 (diff)
downloadgnutls-802e1ede038010ddab31225f4b8a7e8d74f3b987.tar.gz
changed indentation to 4 spaces instead of tabs.
Diffstat (limited to 'lib/gnutls_mem.c')
-rw-r--r--lib/gnutls_mem.c70
1 files changed, 39 insertions, 31 deletions
diff --git a/lib/gnutls_mem.c b/lib/gnutls_mem.c
index 0762c6f1ae..2202e75e54 100644
--- a/lib/gnutls_mem.c
+++ b/lib/gnutls_mem.c
@@ -29,56 +29,65 @@ gnutls_alloc_function gnutls_malloc = malloc;
gnutls_free_function gnutls_free = free;
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, size_t) = calloc;
+char *(*gnutls_strdup) (const char *) = _gnutls_strdup;
-int _gnutls_is_secure_mem_null( const void* ign) { return 0; }
+int _gnutls_is_secure_mem_null(const void *ign)
+{
+ return 0;
+}
-int (*_gnutls_is_secure_memory)(const void*) = _gnutls_is_secure_mem_null;
+int (*_gnutls_is_secure_memory) (const void *) =
+ _gnutls_is_secure_mem_null;
void *_gnutls_calloc(size_t nmemb, size_t size)
{
- void *ret;
- size *= nmemb;
- ret = gnutls_malloc(size);
- if (ret != NULL) memset(ret, 0, size);
- return ret;
+ void *ret;
+ size *= nmemb;
+ ret = gnutls_malloc(size);
+ if (ret != NULL)
+ memset(ret, 0, size);
+ return ret;
}
svoid *gnutls_secure_calloc(size_t nmemb, size_t size)
{
- svoid *ret;
- size *= nmemb;
- ret = gnutls_secure_malloc(size);
- if (ret != NULL) memset(ret, 0, size);
- return ret;
+ svoid *ret;
+ size *= nmemb;
+ ret = gnutls_secure_malloc(size);
+ 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) {
-size_t siz = strlen( str) + 1;
-char* ret;
+char *_gnutls_strdup(const char *str)
+{
+ 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;
}
@@ -96,7 +105,7 @@ char* ret;
* 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)
{
}
@@ -109,9 +118,8 @@ void* gnutls_malloc( size_t s)
* The deallocation function used is the one set by gnutls_global_set_mem_functions().
*
**/
-void gnutls_free( void* ptr)
+void gnutls_free(void *ptr)
{
}
#endif
-