This is an automated email from the ASF dual-hosted git repository.

naraj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git

commit 5061deb4a55b1ac2f5939fe61f60d0629a42d1e1
Author: MichaƂ Narajowski <michal.narajow...@codecoup.pl>
AuthorDate: Tue Nov 20 11:17:59 2018 +0100

    mesh: Cast 32bit values to ensure proper formatting
---
 nimble/host/mesh/src/access.c    | 13 +++++++------
 nimble/host/mesh/src/adv.c       |  2 +-
 nimble/host/mesh/src/beacon.c    |  6 +++---
 nimble/host/mesh/src/cfg_cli.c   |  2 +-
 nimble/host/mesh/src/cfg_srv.c   |  4 ++--
 nimble/host/mesh/src/crypto.c    | 16 +++++++++-------
 nimble/host/mesh/src/friend.c    | 19 +++++++++++--------
 nimble/host/mesh/src/lpn.c       |  6 +++---
 nimble/host/mesh/src/mesh.c      |  2 +-
 nimble/host/mesh/src/net.c       | 16 ++++++++++------
 nimble/host/mesh/src/prov.c      |  6 +++---
 nimble/host/mesh/src/proxy.c     |  5 +++--
 nimble/host/mesh/src/settings.c  | 14 ++++++++------
 nimble/host/mesh/src/transport.c | 19 ++++++++++++-------
 14 files changed, 74 insertions(+), 56 deletions(-)

diff --git a/nimble/host/mesh/src/access.c b/nimble/host/mesh/src/access.c
index 12e3bde..40ac67b 100644
--- a/nimble/host/mesh/src/access.c
+++ b/nimble/host/mesh/src/access.c
@@ -116,7 +116,7 @@ static s32_t next_period(struct bt_mesh_model *mod)
 
        elapsed = k_uptime_get_32() - pub->period_start;
 
-       BT_DBG("Publishing took %ums", elapsed);
+       BT_DBG("Publishing took %ums", (unsigned) elapsed);
 
        if (elapsed > period) {
                BT_WARN("Publication sending took longer than the period");
@@ -141,7 +141,7 @@ static void publish_sent(int err, void *user_data)
        }
 
        if (delay) {
-               BT_DBG("Publishing next time in %dms", delay);
+               BT_DBG("Publishing next time in %dms", (int) delay);
                k_delayed_work_submit(&mod->pub->timer, delay);
        }
 }
@@ -199,7 +199,7 @@ static void mod_publish(struct ble_npl_event *work)
        BT_DBG("");
 
        period_ms = bt_mesh_model_pub_period_get(pub->mod);
-       BT_DBG("period %u ms", period_ms);
+       BT_DBG("period %u ms", (unsigned) period_ms);
 
        if (pub->count) {
                err = publish_retransmit(pub->mod);
@@ -536,7 +536,7 @@ void bt_mesh_model_recv(struct bt_mesh_net_rx *rx, struct 
os_mbuf *buf)
                return;
        }
 
-       BT_DBG("OpCode 0x%08x", opcode);
+       BT_DBG("OpCode 0x%08x", (unsigned) opcode);
 
        for (i = 0; i < dev_comp->elem_count; i++) {
                struct bt_mesh_elem *elem = &dev_comp->elem[i];
@@ -572,7 +572,7 @@ void bt_mesh_model_recv(struct bt_mesh_net_rx *rx, struct 
os_mbuf *buf)
 
                        if (buf->om_len < op->min_len) {
                                BT_ERR("Too short message for OpCode 0x%08x",
-                                      opcode);
+                                      (unsigned) opcode);
                                continue;
                        }
 
@@ -585,7 +585,8 @@ void bt_mesh_model_recv(struct bt_mesh_net_rx *rx, struct 
os_mbuf *buf)
                        net_buf_simple_restore(buf, &state);
 
                } else {
-                       BT_DBG("No OpCode 0x%08x for elem %d", opcode, i);
+                       BT_DBG("No OpCode 0x%08x for elem %d",
+                              (unsigned) opcode, i);
                }
        }
 }
diff --git a/nimble/host/mesh/src/adv.c b/nimble/host/mesh/src/adv.c
index 2c841c3..996853f 100644
--- a/nimble/host/mesh/src/adv.c
+++ b/nimble/host/mesh/src/adv.c
@@ -160,7 +160,7 @@ mesh_adv_thread(void *args)
                ev = ble_npl_eventq_get(&adv_queue, 0);
                while (!ev) {
                        timeout = bt_mesh_proxy_adv_start();
-                       BT_DBG("Proxy Advertising up to %d ms", timeout);
+                       BT_DBG("Proxy Advertising up to %d ms", (int) timeout);
 
                        // FIXME: should we redefine K_SECONDS macro instead in 
glue?
                        if (timeout != K_FOREVER) {
diff --git a/nimble/host/mesh/src/beacon.c b/nimble/host/mesh/src/beacon.c
index b7eca32..a0d212e 100644
--- a/nimble/host/mesh/src/beacon.c
+++ b/nimble/host/mesh/src/beacon.c
@@ -96,7 +96,7 @@ void bt_mesh_beacon_create(struct bt_mesh_subnet *sub,
 
        BT_DBG("net_idx 0x%04x flags 0x%02x NetID %s", sub->net_idx,
               flags, bt_hex(keys->net_id, 8));
-       BT_DBG("IV Index 0x%08x Auth %s", bt_mesh.iv_index,
+       BT_DBG("IV Index 0x%08x Auth %s", (unsigned) bt_mesh.iv_index,
               bt_hex(sub->auth, 8));
 }
 
@@ -285,7 +285,7 @@ static void secure_beacon_recv(struct os_mbuf *buf)
        auth = buf->om_data;
 
        BT_DBG("flags 0x%02x id %s iv_index 0x%08x",
-              flags, bt_hex(net_id, 8), iv_index);
+              flags, bt_hex(net_id, 8), (unsigned) iv_index);
 
        sub = bt_mesh_subnet_find(net_id, flags, iv_index, auth, &new_key);
        if (!sub) {
@@ -308,7 +308,7 @@ static void secure_beacon_recv(struct os_mbuf *buf)
        }
 
        BT_DBG("net_idx 0x%04x iv_index 0x%08x, current iv_index 0x%08x",
-              sub->net_idx, iv_index, bt_mesh.iv_index);
+              sub->net_idx, (unsigned) iv_index, (unsigned) bt_mesh.iv_index);
 
        if (bt_mesh.ivu_initiator &&
            bt_mesh.iv_update == BT_MESH_IV_UPDATE(flags)) {
diff --git a/nimble/host/mesh/src/cfg_cli.c b/nimble/host/mesh/src/cfg_cli.c
index ac8be55..17f01b9 100644
--- a/nimble/host/mesh/src/cfg_cli.c
+++ b/nimble/host/mesh/src/cfg_cli.c
@@ -68,7 +68,7 @@ static void state_status_u8(struct bt_mesh_model *model,
 
        if (cli->op_pending != expect_status) {
                BT_WARN("Unexpected Status (0x%08x != 0x%08x)",
-                       cli->op_pending, expect_status);
+                       (unsigned) cli->op_pending, (unsigned) expect_status);
                return;
        }
 
diff --git a/nimble/host/mesh/src/cfg_srv.c b/nimble/host/mesh/src/cfg_srv.c
index 9791642..0901e6d 100644
--- a/nimble/host/mesh/src/cfg_srv.c
+++ b/nimble/host/mesh/src/cfg_srv.c
@@ -295,7 +295,7 @@ static u8_t _mod_pub_set(struct bt_mesh_model *model, u16_t 
pub_addr,
                s32_t period_ms;
 
                period_ms = bt_mesh_model_pub_period_get(model);
-               BT_DBG("period %u ms", period_ms);
+               BT_DBG("period %u ms", (unsigned) period_ms);
 
                if (period_ms) {
                        k_delayed_work_submit(&model->pub->timer, period_ms);
@@ -3239,7 +3239,7 @@ static void heartbeat_sub_set(struct bt_mesh_model *model,
        /* Let the transport layer know it needs to handle this address */
        bt_mesh_set_hb_sub_dst(cfg->hb_sub.dst);
 
-       BT_DBG("period_ms %u", period_ms);
+       BT_DBG("period_ms %u", (unsigned) period_ms);
 
        if (period_ms) {
                cfg->hb_sub.expiry = k_uptime_get() + period_ms;
diff --git a/nimble/host/mesh/src/crypto.c b/nimble/host/mesh/src/crypto.c
index d603018..6227c90 100644
--- a/nimble/host/mesh/src/crypto.c
+++ b/nimble/host/mesh/src/crypto.c
@@ -574,7 +574,8 @@ int bt_mesh_net_obfuscate(u8_t *pdu, u32_t iv_index,
        u8_t tmp[16];
        int err, i;
 
-       BT_DBG("IVIndex %u, PrivacyKey %s", iv_index, bt_hex(privacy_key, 16));
+       BT_DBG("IVIndex %u, PrivacyKey %s", (unsigned) iv_index,
+              bt_hex(privacy_key, 16));
 
        sys_put_be32(iv_index, &priv_rand[5]);
        memcpy(&priv_rand[9], &pdu[7], 7);
@@ -600,8 +601,8 @@ int bt_mesh_net_encrypt(const u8_t key[16], struct os_mbuf 
*buf,
        u8_t nonce[13];
        int err;
 
-       BT_DBG("IVIndex %u EncKey %s mic_len %u", iv_index, bt_hex(key, 16),
-              mic_len);
+       BT_DBG("IVIndex %u EncKey %s mic_len %u", (unsigned) iv_index,
+              bt_hex(key, 16), mic_len);
        BT_DBG("PDU (len %u) %s", buf->om_len, bt_hex(buf->om_data, 
buf->om_len));
 
 #if (MYNEWT_VAL(BLE_MESH_PROXY))
@@ -632,8 +633,8 @@ int bt_mesh_net_decrypt(const u8_t key[16], struct os_mbuf 
*buf,
        u8_t nonce[13];
 
        BT_DBG("PDU (%u bytes) %s", buf->om_len, bt_hex(buf->om_data, 
buf->om_len));
-       BT_DBG("iv_index %u, key %s mic_len %u", iv_index, bt_hex(key, 16),
-              mic_len);
+       BT_DBG("iv_index %u, key %s mic_len %u", (unsigned) iv_index,
+              bt_hex(key, 16), mic_len);
 
 #if (MYNEWT_VAL(BLE_MESH_PROXY))
        if (proxy) {
@@ -680,7 +681,8 @@ int bt_mesh_app_encrypt(const u8_t key[16], bool dev_key, 
u8_t aszmic,
 
        BT_DBG("AppKey %s", bt_hex(key, 16));
        BT_DBG("dev_key %u src 0x%04x dst 0x%04x", dev_key, src, dst);
-       BT_DBG("seq_num 0x%08x iv_index 0x%08x", seq_num, iv_index);
+       BT_DBG("seq_num 0x%08x iv_index 0x%08x", (unsigned) seq_num,
+              (unsigned) iv_index);
        BT_DBG("Clear: %s", bt_hex(buf->om_data, buf->om_len));
 
        create_app_nonce(nonce, dev_key, aszmic, src, dst, seq_num, iv_index);
@@ -851,7 +853,7 @@ int bt_mesh_beacon_auth(const u8_t beacon_key[16], u8_t 
flags,
 
        BT_DBG("BeaconKey %s", bt_hex(beacon_key, 16));
        BT_DBG("NetId %s", bt_hex(net_id, 8));
-       BT_DBG("IV Index 0x%08x", iv_index);
+       BT_DBG("IV Index 0x%08x", (unsigned) iv_index);
 
        msg[0] = flags;
        memcpy(&msg[1], net_id, 8);
diff --git a/nimble/host/mesh/src/friend.c b/nimble/host/mesh/src/friend.c
index f136f11..561f5b2 100644
--- a/nimble/host/mesh/src/friend.c
+++ b/nimble/host/mesh/src/friend.c
@@ -462,7 +462,7 @@ static void friend_recv_delay(struct bt_mesh_friend *frnd)
 {
        frnd->pending_req = 1;
        k_delayed_work_submit(&frnd->timer, recv_delay(frnd));
-       BT_DBG("Waiting RecvDelay of %d ms", recv_delay(frnd));
+       BT_DBG("Waiting RecvDelay of %d ms", (int) recv_delay(frnd));
 }
 
 int bt_mesh_friend_sub_add(struct bt_mesh_net_rx *rx,
@@ -790,7 +790,7 @@ static s32_t offer_delay(struct bt_mesh_friend *frnd, s8_t 
rssi, u8_t crit)
        delay -= (s32_t)fact[RSSI_FACT(crit)] * rssi;
        delay /= 10;
 
-       BT_DBG("Local Delay calculated as %d ms", delay);
+       BT_DBG("Local Delay calculated as %d ms", (int) delay);
 
        if (delay < 100) {
                return K_MSEC(100);
@@ -822,7 +822,7 @@ int bt_mesh_friend_req(struct bt_mesh_net_rx *rx, struct 
os_mbuf *buf)
                   ((u32_t)msg->poll_to[2]));
 
        if (poll_to <= 0x000009 || poll_to >= 0x34bc00) {
-               BT_WARN("Prohibited PollTimeout (0x%06x)", poll_to);
+               BT_WARN("Prohibited PollTimeout (0x%06x)", (unsigned) poll_to);
                return -EINVAL;
        }
 
@@ -839,7 +839,7 @@ int bt_mesh_friend_req(struct bt_mesh_net_rx *rx, struct 
os_mbuf *buf)
        if (CONFIG_BT_MESH_FRIEND_QUEUE_SIZE < MIN_QUEUE_SIZE(msg->criteria)) {
                BT_WARN("We have a too small Friend Queue size (%u < %u)",
                        CONFIG_BT_MESH_FRIEND_QUEUE_SIZE,
-                       MIN_QUEUE_SIZE(msg->criteria));
+                       (unsigned) MIN_QUEUE_SIZE(msg->criteria));
                return 0;
        }
 
@@ -880,7 +880,8 @@ init_friend:
        frnd->clear.frnd = sys_be16_to_cpu(msg->prev_addr);
 
        BT_DBG("LPN 0x%04x rssi %d recv_delay %u poll_to %ums",
-              frnd->lpn, rx->rssi, frnd->recv_delay, frnd->poll_to);
+              frnd->lpn, rx->rssi, frnd->recv_delay,
+              (unsigned) frnd->poll_to);
 
        if (BT_MESH_ADDR_IS_UNICAST(old_friend) &&
            !bt_mesh_elem_find(old_friend)) {
@@ -999,7 +1000,8 @@ static void buf_send_end(int err, void *user_data)
 
        if (frnd->established) {
                k_delayed_work_submit(&frnd->timer, frnd->poll_to);
-               BT_DBG("Waiting %u ms for next poll", frnd->poll_to);
+               BT_DBG("Waiting %u ms for next poll",
+                      (unsigned) frnd->poll_to);
        } else {
                /* Friend offer timeout is 1 second */
                k_delayed_work_submit(&frnd->timer, K_SECONDS(1));
@@ -1117,7 +1119,8 @@ static void friend_lpn_enqueue_rx(struct bt_mesh_friend 
*frnd,
        struct friend_pdu_info info;
        struct os_mbuf *buf;
 
-       BT_DBG("LPN 0x%04x queue_size %u", frnd->lpn, frnd->queue_size);
+       BT_DBG("LPN 0x%04x queue_size %u", frnd->lpn,
+              (unsigned) frnd->queue_size);
 
        if (type == BT_MESH_FRIEND_PDU_SINGLE && seq_auth) {
                friend_purge_old_ack(frnd, seq_auth, rx->ctx.addr);
@@ -1153,7 +1156,7 @@ static void friend_lpn_enqueue_rx(struct bt_mesh_friend 
*frnd,
        enqueue_friend_pdu(frnd, type, buf);
 
        BT_DBG("Queued message for LPN 0x%04x, queue_size %u",
-              frnd->lpn, frnd->queue_size);
+              frnd->lpn, (unsigned) frnd->queue_size);
 }
 
 static void friend_lpn_enqueue_tx(struct bt_mesh_friend *frnd,
diff --git a/nimble/host/mesh/src/lpn.c b/nimble/host/mesh/src/lpn.c
index e456502..27ca0ef 100644
--- a/nimble/host/mesh/src/lpn.c
+++ b/nimble/host/mesh/src/lpn.c
@@ -840,7 +840,7 @@ static s32_t poll_timeout(struct bt_mesh_lpn *lpn)
                                        POLL_TIMEOUT_MAX(lpn));
        }
 
-       BT_DBG("Poll Timeout is %ums", lpn->poll_timeout);
+       BT_DBG("Poll Timeout is %ums", (unsigned) lpn->poll_timeout);
 
        return lpn->poll_timeout;
 }
@@ -966,8 +966,8 @@ int bt_mesh_lpn_friend_update(struct bt_mesh_net_rx *rx,
 
        iv_index = sys_be32_to_cpu(msg->iv_index);
 
-       BT_DBG("flags 0x%02x iv_index 0x%08x md %u", msg->flags, iv_index,
-              msg->md);
+       BT_DBG("flags 0x%02x iv_index 0x%08x md %u", msg->flags,
+              (unsigned) iv_index, msg->md);
 
        if (bt_mesh_kr_update(sub, BT_MESH_KEY_REFRESH(msg->flags),
                              rx->new_key)) {
diff --git a/nimble/host/mesh/src/mesh.c b/nimble/host/mesh/src/mesh.c
index 4d5ed6c..347e756 100644
--- a/nimble/host/mesh/src/mesh.c
+++ b/nimble/host/mesh/src/mesh.c
@@ -40,7 +40,7 @@ int bt_mesh_provision(const u8_t net_key[16], u16_t net_idx,
 
        BT_INFO("Primary Element: 0x%04x", addr);
        BT_DBG("net_idx 0x%04x flags 0x%02x iv_index 0x%04x",
-              net_idx, flags, iv_index);
+              net_idx, flags, (unsigned) iv_index);
 
        if ((MYNEWT_VAL(BLE_MESH_PB_GATT))) {
                bt_mesh_proxy_prov_disable();
diff --git a/nimble/host/mesh/src/net.c b/nimble/host/mesh/src/net.c
index 75d3a1b..afa712c 100644
--- a/nimble/host/mesh/src/net.c
+++ b/nimble/host/mesh/src/net.c
@@ -426,7 +426,7 @@ int bt_mesh_net_beacon_update(struct bt_mesh_subnet *sub)
                keys = &sub->keys[0];
        }
 
-       BT_DBG("flags 0x%02x, IVI 0x%08x", flags, bt_mesh.iv_index);
+       BT_DBG("flags 0x%02x, IVI 0x%08x", flags, (unsigned) bt_mesh.iv_index);
 
        return bt_mesh_beacon_auth(keys->beacon, flags, keys->net_id,
                                   bt_mesh.iv_index, sub->auth);
@@ -438,7 +438,8 @@ int bt_mesh_net_create(u16_t idx, u8_t flags, const u8_t 
key[16],
        struct bt_mesh_subnet *sub;
        int err;
 
-       BT_DBG("idx %u flags 0x%02x iv_index %u", idx, flags, iv_index);
+       BT_DBG("idx %u flags 0x%02x iv_index %u", idx, flags,
+              (unsigned) iv_index);
 
        BT_DBG("NetKey %s", bt_hex(key, 16));
 
@@ -623,7 +624,8 @@ bool bt_mesh_net_iv_update(u32_t iv_index, bool iv_update)
 
                if (iv_index != bt_mesh.iv_index) {
                        BT_WARN("IV Index mismatch: 0x%08x != 0x%08x",
-                               iv_index, bt_mesh.iv_index);
+                               (unsigned) iv_index,
+                               (unsigned) bt_mesh.iv_index);
                        return false;
                }
 
@@ -643,7 +645,8 @@ bool bt_mesh_net_iv_update(u32_t iv_index, bool iv_update)
                if (iv_index < bt_mesh.iv_index ||
                    iv_index > bt_mesh.iv_index + 42) {
                        BT_ERR("IV Index out of sync: 0x%08x != 0x%08x",
-                              iv_index, bt_mesh.iv_index);
+                              (unsigned) iv_index,
+                              (unsigned) bt_mesh.iv_index);
                        return false;
                }
 
@@ -688,7 +691,7 @@ do_update:
        if (bt_mesh.iv_update) {
                bt_mesh.iv_index = iv_index;
                BT_DBG("IV Update state entered. New index 0x%08x",
-                      bt_mesh.iv_index);
+                      (unsigned) bt_mesh.iv_index);
 
                bt_mesh_rpl_reset();
        } else {
@@ -984,7 +987,8 @@ static int net_decrypt(struct bt_mesh_subnet *sub, const 
u8_t *enc,
                       struct os_mbuf *buf)
 {
        BT_DBG("NID 0x%02x net_idx 0x%04x", NID(data), sub->net_idx);
-       BT_DBG("IVI %u net->iv_index 0x%08x", IVI(data), bt_mesh.iv_index);
+       BT_DBG("IVI %u net->iv_index 0x%08x", IVI(data),
+              (unsigned) bt_mesh.iv_index);
 
        rx->old_iv = (IVI(data) != (bt_mesh.iv_index & 0x01));
 
diff --git a/nimble/host/mesh/src/prov.c b/nimble/host/mesh/src/prov.c
index 9124613..94876ab 100644
--- a/nimble/host/mesh/src/prov.c
+++ b/nimble/host/mesh/src/prov.c
@@ -796,7 +796,7 @@ static void send_input_complete(void)
 
 int bt_mesh_input_number(u32_t num)
 {
-       BT_DBG("%u", num);
+       BT_DBG("%u", (unsigned) num);
 
        if (!atomic_test_and_clear_bit(link.flags, WAIT_NUMBER)) {
                return -EINVAL;
@@ -1075,7 +1075,7 @@ static void prov_data(const u8_t *data)
        addr = sys_get_be16(&pdu[23]);
 
        BT_DBG("net_idx %u iv_index 0x%08x, addr 0x%04x",
-              net_idx, iv_index, addr);
+              net_idx, (unsigned) iv_index, addr);
 
        prov_buf_init(msg, PROV_COMPLETE);
        prov_send(msg);
@@ -1476,7 +1476,7 @@ void bt_mesh_pb_adv_recv(struct os_mbuf *buf)
        rx.xact_id = net_buf_simple_pull_u8(buf);
        rx.gpc = net_buf_simple_pull_u8(buf);
 
-       BT_DBG("link_id 0x%08x xact_id %u", rx.link_id, rx.xact_id);
+       BT_DBG("link_id 0x%08x xact_id %u", (unsigned) rx.link_id, rx.xact_id);
 
        if (atomic_test_bit(link.flags, LINK_ACTIVE) && link.id != rx.link_id) {
                BT_DBG("Ignoring mesh beacon for unknown link");
diff --git a/nimble/host/mesh/src/proxy.c b/nimble/host/mesh/src/proxy.c
index b1908f0..46e1ce9 100644
--- a/nimble/host/mesh/src/proxy.c
+++ b/nimble/host/mesh/src/proxy.c
@@ -1141,7 +1141,7 @@ static s32_t gatt_proxy_advertise(struct bt_mesh_subnet 
*sub)
                if (active < NODE_ID_TIMEOUT) {
                        remaining = NODE_ID_TIMEOUT - active;
                        BT_DBG("Node ID active for %u ms, %d ms remaining",
-                              active, remaining);
+                              (unsigned) active, (int) remaining);
                        node_id_adv(sub);
                } else {
                        bt_mesh_proxy_identity_stop(sub);
@@ -1175,7 +1175,8 @@ static s32_t gatt_proxy_advertise(struct bt_mesh_subnet 
*sub)
                }
        }
 
-       BT_DBG("Advertising %d ms for net_idx 0x%04x", remaining, sub->net_idx);
+       BT_DBG("Advertising %d ms for net_idx 0x%04x",
+              (int) remaining, sub->net_idx);
 
        return remaining;
 }
diff --git a/nimble/host/mesh/src/settings.c b/nimble/host/mesh/src/settings.c
index 189692d..72ae172 100644
--- a/nimble/host/mesh/src/settings.c
+++ b/nimble/host/mesh/src/settings.c
@@ -177,7 +177,8 @@ static int iv_set(int argc, char **argv, char *val)
        bt_mesh.ivu_duration = iv.iv_duration;
 
        BT_DBG("IV Index 0x%04x (IV Update Flag %u) duration %u hours",
-              bt_mesh.iv_index, bt_mesh.iv_update, bt_mesh.ivu_duration);
+              (unsigned) bt_mesh.iv_index, bt_mesh.iv_update,
+              bt_mesh.ivu_duration);
 
        return 0;
 }
@@ -302,7 +303,7 @@ static int rpl_set(int argc, char **argv, char *val)
        entry->old_iv = rpl.old_iv;
 
        BT_DBG("RPL entry for 0x%04x: Seq 0x%06x old_iv %u", entry->src,
-              entry->seq, entry->old_iv);
+              (unsigned) entry->seq, entry->old_iv);
 
        return 0;
 }
@@ -758,7 +759,8 @@ static void commit_mod(struct bt_mesh_model *mod, struct 
bt_mesh_elem *elem,
            mod->pub->addr != BT_MESH_ADDR_UNASSIGNED) {
                s32_t ms = bt_mesh_model_pub_period_get(mod);
                if (ms) {
-                       BT_DBG("Starting publish timer (period %u ms)", ms);
+                       BT_DBG("Starting publish timer (period %u ms)",
+                              (unsigned) ms);
                        k_delayed_work_submit(&mod->pub->timer, ms);
                }
        }
@@ -844,7 +846,7 @@ static void schedule_store(int flag)
                timeout = K_SECONDS(CONFIG_BT_MESH_STORE_TIMEOUT);
        }
 
-       BT_DBG("Waiting %d seconds", timeout / MSEC_PER_SEC);
+       BT_DBG("Waiting %d seconds", (int) (timeout / MSEC_PER_SEC));
 
        k_delayed_work_submit(&pending_store, timeout);
 }
@@ -955,8 +957,8 @@ static void store_rpl(struct bt_mesh_rpl *entry)
        char path[18];
        char *str;
 
-       BT_DBG("src 0x%04x seq 0x%06x old_iv %u", entry->src, entry->seq,
-              entry->old_iv);
+       BT_DBG("src 0x%04x seq 0x%06x old_iv %u", entry->src,
+              (unsigned) entry->seq, entry->old_iv);
 
        rpl.seq = entry->seq;
        rpl.old_iv = entry->old_iv;
diff --git a/nimble/host/mesh/src/transport.c b/nimble/host/mesh/src/transport.c
index cfca1e0..81192c3 100644
--- a/nimble/host/mesh/src/transport.c
+++ b/nimble/host/mesh/src/transport.c
@@ -724,7 +724,8 @@ static int trans_ack(struct bt_mesh_net_rx *rx, u8_t hdr,
 
        ack = net_buf_simple_pull_be32(buf);
 
-       BT_DBG("OBO %u seq_zero 0x%04x ack 0x%08x", obo, seq_zero, ack);
+       BT_DBG("OBO %u seq_zero 0x%04x ack 0x%08x", obo, seq_zero,
+              (unsigned) ack);
 
        tx = seg_tx_lookup(seq_zero, obo, rx->ctx.addr);
        if (!tx) {
@@ -877,7 +878,7 @@ static int trans_unseg(struct os_mbuf *buf, struct 
bt_mesh_net_rx *rx,
 
        if (rx->local_match && is_replay(rx)) {
                BT_WARN("Replay: src 0x%04x dst 0x%04x seq 0x%06x",
-                       rx->ctx.addr, rx->ctx.recv_dst, rx->seq);
+                       rx->ctx.addr, rx->ctx.recv_dst, (unsigned) rx->seq);
                return -EINVAL;
        }
 
@@ -975,7 +976,8 @@ static int send_ack(struct bt_mesh_subnet *sub, u16_t src, 
u16_t dst,
        u16_t seq_zero = *seq_auth & 0x1fff;
        u8_t buf[6];
 
-       BT_DBG("SeqZero 0x%04x Block 0x%08x OBO %u", seq_zero, block, obo);
+       BT_DBG("SeqZero 0x%04x Block 0x%08x OBO %u", seq_zero,
+              (unsigned) block, obo);
 
        if (bt_mesh_lpn_established()) {
                BT_WARN("Not sending ack when LPN is enabled");
@@ -1145,7 +1147,7 @@ static struct seg_rx *seg_rx_alloc(struct bt_mesh_net_rx 
*net_rx,
                rx->block = 0;
 
                BT_DBG("New RX context. Block Complete 0x%08x",
-                      BLOCK_COMPLETE(seg_n));
+                      (unsigned) BLOCK_COMPLETE(seg_n));
 
                return rx;
        }
@@ -1216,7 +1218,8 @@ static int trans_seg(struct os_mbuf *buf, struct 
bt_mesh_net_rx *net_rx,
                }
 
                if (rx->in_use) {
-                       BT_DBG("Existing RX context. Block 0x%08x", rx->block);
+                       BT_DBG("Existing RX context. Block 0x%08x",
+                              (unsigned) rx->block);
                        goto found_rx;
                }
 
@@ -1314,7 +1317,8 @@ found_rx:
 
        if (net_rx->local_match && is_replay(net_rx)) {
                BT_WARN("Replay: src 0x%04x dst 0x%04x seq 0x%06x",
-                       net_rx->ctx.addr, net_rx->ctx.recv_dst, net_rx->seq);
+                       net_rx->ctx.addr, net_rx->ctx.recv_dst,
+                       (unsigned) net_rx->seq);
                /* Clear the segment's bit */
                rx->block &= ~BIT(seg_o);
                return -EINVAL;
@@ -1353,7 +1357,8 @@ int bt_mesh_trans_recv(struct os_mbuf *buf, struct 
bt_mesh_net_rx *rx)
        }
 
        BT_DBG("src 0x%04x dst 0x%04x seq 0x%08x friend_match %u",
-              rx->ctx.addr, rx->ctx.recv_dst, rx->seq, rx->friend_match);
+              rx->ctx.addr, rx->ctx.recv_dst, (unsigned) rx->seq,
+              rx->friend_match);
 
        /* Remove network headers */
        net_buf_simple_pull(buf, BT_MESH_NET_HDR_LEN);

Reply via email to