From 69a69cc5aed1965112c8742997db45878ce5b306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 29 Apr 2015 01:05:19 +0200 Subject: [PATCH] memory_buffer_alloc_init() now returns void --- ChangeLog | 1 + include/mbedtls/memory_buffer_alloc.h | 4 +--- library/memory_buffer_alloc.c | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 036619d4f..6fc5cfa99 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,6 +20,7 @@ API Changes mbedtls_gcm_init() -> mbedtls_gcm_setkey() mbedtls_hmac_drbg_init() -> mbedtls_hmac_drbg_init(_buf)() mbedtls_ctr_drbg_init() -> mbedtls_ctr_drbg_init(_buf)() + * mbedtls_memory_bufer_alloc_init() now returns void * In the threading layer, mbedtls_mutex_init() and mbedtls_mutex_free() now return void. * ecdsa_write_signature() gained an addtional md_alg argument and diff --git a/include/mbedtls/memory_buffer_alloc.h b/include/mbedtls/memory_buffer_alloc.h index 23f05006f..8d9af00db 100644 --- a/include/mbedtls/memory_buffer_alloc.h +++ b/include/mbedtls/memory_buffer_alloc.h @@ -69,10 +69,8 @@ extern "C" { * * \param buf buffer to use as heap * \param len size of the buffer - * - * \return 0 if successful */ -int mbedtls_memory_buffer_alloc_init( unsigned char *buf, size_t len ); +void mbedtls_memory_buffer_alloc_init( unsigned char *buf, size_t len ); /** * \brief Free the mutex for thread-safety and clear remaining memory diff --git a/library/memory_buffer_alloc.c b/library/memory_buffer_alloc.c index 37788c8f5..8918c5cdf 100644 --- a/library/memory_buffer_alloc.c +++ b/library/memory_buffer_alloc.c @@ -561,7 +561,7 @@ static void buffer_alloc_free_mutexed( void *ptr ) } #endif /* MBEDTLS_THREADING_C */ -int mbedtls_memory_buffer_alloc_init( unsigned char *buf, size_t len ) +void mbedtls_memory_buffer_alloc_init( unsigned char *buf, size_t len ) { memset( &heap, 0, sizeof(buffer_alloc_ctx) ); memset( buf, 0, len ); @@ -591,7 +591,6 @@ int mbedtls_memory_buffer_alloc_init( unsigned char *buf, size_t len ) heap.first->magic1 = MAGIC1; heap.first->magic2 = MAGIC2; heap.first_free = heap.first; - return( 0 ); } void mbedtls_memory_buffer_alloc_free()