summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Collins <ccollins@apache.org>2016-08-22 17:36:12 -0700
committerChristopher Collins <ccollins@apache.org>2016-08-22 17:36:12 -0700
commit18c8837bdd7bca02771dcc9eaf783d9b2ce01764 (patch)
tree30e107c17df861d46ca56f3aaeec3556d9156754
parent03c939a22d76b045f55228ad61c1fc4b88cd5fc6 (diff)
Fix warnings reported by clang.
-rw-r--r--hw/mcu/native/src/hal_uart.c2
-rw-r--r--libs/bootutil/src/test/boot_test.c12
-rw-r--r--net/nimble/host/src/ble_sm.c15
-rw-r--r--net/nimble/host/src/ble_sm_alg.c28
-rw-r--r--net/nimble/host/src/test/ble_hs_test_util.c3
-rw-r--r--net/nimble/host/src/test/ble_sm_test_util.c3
6 files changed, 11 insertions, 52 deletions
diff --git a/hw/mcu/native/src/hal_uart.c b/hw/mcu/native/src/hal_uart.c
index c30a4148..41afcc66 100644
--- a/hw/mcu/native/src/hal_uart.c
+++ b/hw/mcu/native/src/hal_uart.c
@@ -148,9 +148,9 @@ uart_transmit_char(struct uart *uart)
OS_EXIT_CRITICAL(sr);
return 0;
}
+ ch = rc;
uart_log_data(uart, 1, ch);
OS_EXIT_CRITICAL(sr);
- ch = rc;
rc = write(uart->u_fd, &ch, 1);
if (rc <= 0) {
/* XXX EOF/error, what now? */
diff --git a/libs/bootutil/src/test/boot_test.c b/libs/bootutil/src/test/boot_test.c
index 459e4245..c1dcb836 100644
--- a/libs/bootutil/src/test/boot_test.c
+++ b/libs/bootutil/src/test/boot_test.c
@@ -47,13 +47,7 @@ static struct flash_area boot_test_area_descs[] = {
[4] = { .fa_off = 0x000a0000, .fa_size = 128 * 1024 },
[5] = { .fa_off = 0x000c0000, .fa_size = 128 * 1024 },
[6] = { .fa_off = 0x000e0000, .fa_size = 128 * 1024 },
-};
-
-static const struct flash_area boot_test_format_descs[] = {
- [0] = { .fa_off = 0x00004000, .fa_size = 16 * 1024 },
- [1] = { .fa_off = 0x00008000, .fa_size = 16 * 1024 },
- [2] = { .fa_off = 0x0000c000, .fa_size = 16 * 1024 },
- [3] = { .fa_off = 0, .fa_size = 0 },
+ [7] = { 0 },
};
/** Areas representing the beginning of image slots. */
@@ -1193,9 +1187,11 @@ boot_test_all(void)
#ifdef MYNEWT_SELFTEST
int
-main(void)
+main(int argc, char **argv)
{
tu_config.tc_print_results = 1;
+ tu_parse_args(argc, argv);
+
tu_init();
boot_test_all();
diff --git a/net/nimble/host/src/ble_sm.c b/net/nimble/host/src/ble_sm.c
index 4991e2ed..8e07cdb0 100644
--- a/net/nimble/host/src/ble_sm.c
+++ b/net/nimble/host/src/ble_sm.c
@@ -2260,17 +2260,12 @@ ble_sm_inject_io(uint16_t conn_handle, struct ble_sm_io *pkey)
switch (pkey->action) {
case BLE_SM_IOACT_OOB:
- if (pkey->oob == NULL) {
- res.app_status = BLE_HS_SM_US_ERR(BLE_SM_ERR_OOB);
- res.sm_err = BLE_SM_ERR_OOB;
- } else {
- proc->flags |= BLE_SM_PROC_F_IO_INJECTED;
- memcpy(proc->tk, pkey->oob, 16);
- if ((proc->flags & BLE_SM_PROC_F_INITIATOR) ||
- (proc->flags & BLE_SM_PROC_F_ADVANCE_ON_IO)) {
+ proc->flags |= BLE_SM_PROC_F_IO_INJECTED;
+ memcpy(proc->tk, pkey->oob, 16);
+ if ((proc->flags & BLE_SM_PROC_F_INITIATOR) ||
+ (proc->flags & BLE_SM_PROC_F_ADVANCE_ON_IO)) {
- res.execute = 1;
- }
+ res.execute = 1;
}
break;
diff --git a/net/nimble/host/src/ble_sm_alg.c b/net/nimble/host/src/ble_sm_alg.c
index a2b0fcf3..66f86dc6 100644
--- a/net/nimble/host/src/ble_sm_alg.c
+++ b/net/nimble/host/src/ble_sm_alg.c
@@ -40,34 +40,6 @@ static const uint32_t ble_sm_alg_dbg_priv_key[8] = {
0xa3c55f38, 0x3f49f6d4
};
-static const uint8_t ble_sm_alg_dbg_pub_key[64] = {
- 0xe6, 0x9d, 0x35, 0x0e, 0x48, 0x01, 0x03, 0xcc,
- 0xdb, 0xfd, 0xf4, 0xac, 0x11, 0x91, 0xf4, 0xef,
- 0xb9, 0xa5, 0xf9, 0xe9, 0xa7, 0x83, 0x2c, 0x5e,
- 0x2c, 0xbe, 0x97, 0xf2, 0xd2, 0x03, 0xb0, 0x20,
- 0x8b, 0xd2, 0x89, 0x15, 0xd0, 0x8e, 0x1c, 0x74,
- 0x24, 0x30, 0xed, 0x8f, 0xc2, 0x45, 0x63, 0x76,
- 0x5c, 0x15, 0x52, 0x5a, 0xbf, 0x9a, 0x32, 0x63,
- 0x6d, 0xeb, 0x2a, 0x65, 0x49, 0x9c, 0x80, 0xdc
-};
-
-static const uint8_t ble_sm_alg_dbg_f4[16] = {
- 0x2d, 0x87, 0x74, 0xa9, 0xbe, 0xa1, 0xed, 0xf1,
- 0x1c, 0xbd, 0xa9, 0x07, 0xf1, 0x16, 0xc9, 0xf2,
-};
-
-static const uint8_t ble_sm_alg_dbg_f5[32] = {
- 0x20, 0x6e, 0x63, 0xce, 0x20, 0x6a, 0x3f, 0xfd,
- 0x02, 0x4a, 0x08, 0xa1, 0x76, 0xf1, 0x65, 0x29,
- 0x38, 0x0a, 0x75, 0x94, 0xb5, 0x22, 0x05, 0x98,
- 0x23, 0xcd, 0xd7, 0x69, 0x11, 0x79, 0x86, 0x69,
-};
-
-static const uint8_t ble_sm_alg_dbg_f6[16] = {
- 0x61, 0x8f, 0x95, 0xda, 0x09, 0x0b, 0x6c, 0xd2,
- 0xc5, 0xe8, 0xd0, 0x9c, 0x98, 0x73, 0xc4, 0xe3,
-};
-
static void
ble_sm_alg_log_buf(const char *name, const uint8_t *buf, int len)
{
diff --git a/net/nimble/host/src/test/ble_hs_test_util.c b/net/nimble/host/src/test/ble_hs_test_util.c
index 0ced75ae..e1acb81c 100644
--- a/net/nimble/host/src/test/ble_hs_test_util.c
+++ b/net/nimble/host/src/test/ble_hs_test_util.c
@@ -34,9 +34,6 @@ uint8_t g_dev_addr[BLE_DEV_ADDR_LEN];
#define BLE_HS_TEST_UTIL_PUB_ADDR_VAL { 0x0a, 0x54, 0xab, 0x49, 0x7f, 0x06 }
-static const uint8_t ble_hs_test_util_pub_addr[BLE_DEV_ADDR_LEN] =
- BLE_HS_TEST_UTIL_PUB_ADDR_VAL;
-
/** Use lots of small mbufs to ensure correct mbuf usage. */
#define BLE_HS_TEST_UTIL_NUM_MBUFS (100)
#define BLE_HS_TEST_UTIL_BUF_SIZE OS_ALIGN(100, 4)
diff --git a/net/nimble/host/src/test/ble_sm_test_util.c b/net/nimble/host/src/test/ble_sm_test_util.c
index ca9aadf7..9edaa04c 100644
--- a/net/nimble/host/src/test/ble_sm_test_util.c
+++ b/net/nimble/host/src/test/ble_sm_test_util.c
@@ -275,7 +275,6 @@ ble_sm_test_util_conn_cb(struct ble_gap_event *event, void *arg)
rc = ble_gap_conn_find(event->enc_change.conn_handle, &desc);
TEST_ASSERT_FATAL(rc == 0);
ble_sm_test_sec_state = desc.sec_state;
- rc = 0;
break;
case BLE_GAP_EVENT_PASSKEY_ACTION:
@@ -288,7 +287,7 @@ ble_sm_test_util_conn_cb(struct ble_gap_event *event, void *arg)
ble_sm_test_gap_event_type = event->type;
- return rc;
+ return 0;
}
static void