Skip to content

Commit

Permalink
Fix compiler and cppcheck warnings (ARMmbed#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arto Kinnunen authored Jan 8, 2021
1 parent ca7ca7d commit 4a126bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions source/coap_connection_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ static NS_LIST_DEFINE(socket_list, internal_socket_t, link);
static uint8_t max_handshakes = MAX_ONGOING_HANDSHAKES;
static uint8_t max_sessions = MAX_SECURE_SESSION_COUNT;

#ifdef COAP_SECURITY_AVAILABLE
static void timer_cb(void *param);
#endif

static void recv_sckt_msg(void *cb_res);
#ifdef COAP_SECURITY_AVAILABLE
Expand Down Expand Up @@ -122,6 +124,7 @@ static secure_session_t *secure_session_find_by_timer_id(int8_t timer_id)
return this;
}

#ifdef COAP_SECURITY_AVAILABLE
static bool is_secure_session_valid(secure_session_t *session)
{
ns_list_foreach(secure_session_t, cur_ptr, &secure_session_list) {
Expand All @@ -131,6 +134,7 @@ static bool is_secure_session_valid(secure_session_t *session)
}
return false;
}
#endif

static void secure_session_delete(secure_session_t *this)
{
Expand Down Expand Up @@ -164,6 +168,7 @@ static int8_t virtual_socket_id_allocate()

static secure_session_t *secure_session_create(internal_socket_t *parent, const uint8_t *address_ptr, uint16_t port, SecureConnectionMode secure_mode)
{
(void) secure_mode;
uint8_t handshakes = 0;
if (!address_ptr) {
return NULL;
Expand Down Expand Up @@ -493,6 +498,7 @@ static int secure_session_recvfrom(int8_t socket_id, unsigned char *buf, size_t
* TODO - might be better to use an event timer in conjunction with
* CoAP tasklet
*/
#ifdef COAP_SECURITY_AVAILABLE
static void timer_cb(void *param)
{
secure_session_t *sec = param;
Expand Down Expand Up @@ -524,6 +530,7 @@ static void timer_cb(void *param)
}
}
}
#endif

#ifdef COAP_SECURITY_AVAILABLE
static void start_timer(int8_t timer_id, uint32_t int_ms, uint32_t fin_ms)
Expand Down
1 change: 1 addition & 0 deletions source/include/coap_security_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
// cppcheck-suppress preprocessorErrorDirective
#include MBEDTLS_CONFIG_FILE
#endif

Expand Down

0 comments on commit 4a126bd

Please sign in to comment.