Skip to content

Commit

Permalink
Review corrections
Browse files Browse the repository at this point in the history
-Fix GCC warning "missing braces around initializer"
-Fix GCC warning "defined but not used " functions
  • Loading branch information
Arto Kinnunen committed May 28, 2019
1 parent 7487ca1 commit f6d81b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion source/6LoWPAN/Thread/thread_extension_bbr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ static int thread_extension_bbr_dua_cb(int8_t service_id, uint8_t source_address
typedef struct {
uint8_t addr[16];
} multicast_addr_t;
static multicast_addr_t multicast_store[MULTICAST_ADDRESS_STORE_AMOUNT] = {{0}};
static multicast_addr_t multicast_store[MULTICAST_ADDRESS_STORE_AMOUNT] = {{{0}}};

static void thread_border_router_multicast_store_add(thread_pbbr_t *this, uint8_t *destination_addr_ptr)
{
Expand Down
12 changes: 8 additions & 4 deletions source/Security/protocols/tls_sec_prot/tls_sec_prot_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ static void tls_sec_prot_lib_debug(void *ctx, int level, const char *file, int l
#endif

#ifdef MBEDTLS_PLATFORM_MEMORY
// Disable for now
//#define TLS_SEC_PROT_LIB_USE_MBEDTLS_PLATFORM_MEMORY
#endif

#ifdef TLS_SEC_PROT_LIB_USE_MBEDTLS_PLATFORM_MEMORY
static void *tls_sec_prot_lib_mem_calloc(size_t count, size_t size);
static void tls_sec_prot_lib_mem_free(void *ptr);
#endif
Expand All @@ -105,9 +110,8 @@ int8_t tls_sec_prot_lib_init(tls_security_t *sec)
{
const char *pers = "ws_tls";

#ifdef MBEDTLS_PLATFORM_MEMORY
// Disable for now
//mbedtls_platform_set_calloc_free(tls_sec_prot_lib_mem_calloc, tls_sec_prot_lib_mem_free);
#ifdef TLS_SEC_PROT_LIB_USE_MBEDTLS_PLATFORM_MEMORY
mbedtls_platform_set_calloc_free(tls_sec_prot_lib_mem_calloc, tls_sec_prot_lib_mem_free);
#endif


Expand Down Expand Up @@ -497,7 +501,7 @@ static int tls_sec_lib_entropy_poll(void *ctx, unsigned char *output, size_t len
return (0);
}

#ifdef MBEDTLS_PLATFORM_MEMORY
#ifdef TLS_SEC_PROT_LIB_USE_MBEDTLS_PLATFORM_MEMORY
static void *tls_sec_prot_lib_mem_calloc(size_t count, size_t size)
{
void *mem_ptr = ns_dyn_mem_temporary_alloc(count * size);
Expand Down

0 comments on commit f6d81b5

Please sign in to comment.