You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/08/23 00:36:47 UTC

incubator-mynewt-core git commit: Fix warnings reported by clang.

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop 03c939a22 -> 18c8837bd


Fix warnings reported by clang.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/18c8837b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/18c8837b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/18c8837b

Branch: refs/heads/develop
Commit: 18c8837bdd7bca02771dcc9eaf783d9b2ce01764
Parents: 03c939a
Author: Christopher Collins <cc...@apache.org>
Authored: Mon Aug 22 17:36:12 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Mon Aug 22 17:36:12 2016 -0700

----------------------------------------------------------------------
 hw/mcu/native/src/hal_uart.c                |  2 +-
 libs/bootutil/src/test/boot_test.c          | 12 ++++------
 net/nimble/host/src/ble_sm.c                | 15 +++++--------
 net/nimble/host/src/ble_sm_alg.c            | 28 ------------------------
 net/nimble/host/src/test/ble_hs_test_util.c |  3 ---
 net/nimble/host/src/test/ble_sm_test_util.c |  3 +--
 6 files changed, 11 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/18c8837b/hw/mcu/native/src/hal_uart.c
----------------------------------------------------------------------
diff --git a/hw/mcu/native/src/hal_uart.c b/hw/mcu/native/src/hal_uart.c
index c30a414..41afcc6 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? */

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/18c8837b/libs/bootutil/src/test/boot_test.c
----------------------------------------------------------------------
diff --git a/libs/bootutil/src/test/boot_test.c b/libs/bootutil/src/test/boot_test.c
index 459e424..c1dcb83 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();

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/18c8837b/net/nimble/host/src/ble_sm.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_sm.c b/net/nimble/host/src/ble_sm.c
index 4991e2e..8e07cdb 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;
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/18c8837b/net/nimble/host/src/ble_sm_alg.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_sm_alg.c b/net/nimble/host/src/ble_sm_alg.c
index a2b0fcf..66f86dc 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)
 {

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/18c8837b/net/nimble/host/src/test/ble_hs_test_util.c
----------------------------------------------------------------------
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 0ced75a..e1acb81 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)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/18c8837b/net/nimble/host/src/test/ble_sm_test_util.c
----------------------------------------------------------------------
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 ca9aadf..9edaa04 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