From cdb697fd7b21167b57a684fde49ae0d963ddcf99 Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Wed, 5 Apr 2017 18:28:03 -0600 Subject: [PATCH] nrf8001 examples: minor changes to avoid clang build failures Signed-off-by: Jon Trulson --- examples/c++/nrf8001-broadcast.cxx | 11 ++++++----- examples/c++/nrf8001-helloworld.cxx | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/examples/c++/nrf8001-broadcast.cxx b/examples/c++/nrf8001-broadcast.cxx index 2ddfa8f8..444f6a58 100644 --- a/examples/c++/nrf8001-broadcast.cxx +++ b/examples/c++/nrf8001-broadcast.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #ifdef SERVICES_PIPE_TYPE_MAPPING_CONTENT static services_pipe_type_mapping_t @@ -77,11 +78,11 @@ init_aci_setup () { /** * Point ACI data structures to the the setup data that the nRFgo studio generated for the nRF8001 */ - if (NULL != services_pipe_type_mapping) { - aci_state.aci_setup_info.services_pipe_type_mapping = &services_pipe_type_mapping[0]; - } else { - aci_state.aci_setup_info.services_pipe_type_mapping = NULL; - } + // abort if this is NULL + assert(services_pipe_type_mapping != NULL); + + aci_state.aci_setup_info.services_pipe_type_mapping = + &services_pipe_type_mapping[0]; aci_state.aci_setup_info.number_of_pipes = NUMBER_OF_PIPES; aci_state.aci_setup_info.setup_msgs = setup_msgs; diff --git a/examples/c++/nrf8001-helloworld.cxx b/examples/c++/nrf8001-helloworld.cxx index 1c63002b..6b25ecd2 100644 --- a/examples/c++/nrf8001-helloworld.cxx +++ b/examples/c++/nrf8001-helloworld.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include "uart_over_ble.h" /* @@ -95,11 +96,11 @@ init_aci_setup () { /** * Point ACI data structures to the the setup data that the nRFgo studio generated for the nRF8001 */ - if (NULL != services_pipe_type_mapping) { - aci_state.aci_setup_info.services_pipe_type_mapping = &services_pipe_type_mapping[0]; - } else { - aci_state.aci_setup_info.services_pipe_type_mapping = NULL; - } + // abort if this is NULL + assert(services_pipe_type_mapping != NULL); + + aci_state.aci_setup_info.services_pipe_type_mapping = + &services_pipe_type_mapping[0]; aci_state.aci_setup_info.number_of_pipes = NUMBER_OF_PIPES; aci_state.aci_setup_info.setup_msgs = setup_msgs;