Repository: incubator-mynewt-core Updated Branches: refs/heads/develop 0b82d070c -> 1693f95a3
some changes to support printing with different size intergers. 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/1693f95a Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/1693f95a Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/1693f95a Branch: refs/heads/develop Commit: 1693f95a3c4698792798ac4c2612e9fe90cc5723 Parents: ece29bb Author: Paul Dietrich <paulfdietr...@yahoo.com> Authored: Wed Sep 14 13:30:42 2016 -0700 Committer: Paul Dietrich <paulfdietr...@yahoo.com> Committed: Wed Sep 14 13:32:32 2016 -0700 ---------------------------------------------------------------------- libs/baselibc/include/inttypes.h | 7 +++++-- libs/iotivity/src/messaging/coap/coap.c | 2 +- libs/iotivity/src/messaging/coap/engine.c | 8 ++++---- libs/iotivity/src/messaging/coap/transactions.c | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1693f95a/libs/baselibc/include/inttypes.h ---------------------------------------------------------------------- diff --git a/libs/baselibc/include/inttypes.h b/libs/baselibc/include/inttypes.h index 29311fe..e9ee426 100644 --- a/libs/baselibc/include/inttypes.h +++ b/libs/baselibc/include/inttypes.h @@ -23,6 +23,9 @@ __extern uintmax_t strntoumax(const char *, char **, int, size_t); #if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) +#define __PRI64_RANK "ll" +#define __PRI32_RANK "l" + #define PRId8 "d" #define PRId16 "d" #define PRId32 "d" @@ -97,7 +100,7 @@ __extern uintmax_t strntoumax(const char *, char **, int, size_t); #define PRIx8 "x" #define PRIx16 "x" -#define PRIx32 "x" +#define PRIx32 __PRI32_RANK "x" #define PRIx64 __PRI64_RANK "x" #define PRIxLEAST8 "x" @@ -115,7 +118,7 @@ __extern uintmax_t strntoumax(const char *, char **, int, size_t); #define PRIX8 "X" #define PRIX16 "X" -#define PRIX32 "X" +#define PRIX32 __PRI32_RANK "X" #define PRIX64 __PRI64_RANK "X" #define PRIXLEAST8 "X" http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1693f95a/libs/iotivity/src/messaging/coap/coap.c ---------------------------------------------------------------------- diff --git a/libs/iotivity/src/messaging/coap/coap.c b/libs/iotivity/src/messaging/coap/coap.c index e8d8608..d77fbbb 100644 --- a/libs/iotivity/src/messaging/coap/coap.c +++ b/libs/iotivity/src/messaging/coap/coap.c @@ -405,7 +405,7 @@ coap_serialize_message(void *packet, uint8_t *buffer) void coap_send_message(oc_message_t *message) { - LOG("-sending OCF message (%lu)-\n", message->length); + LOG("-sending OCF message (%u)-\n", (unsigned int) message->length); oc_send_message(message); } http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1693f95a/libs/iotivity/src/messaging/coap/engine.c ---------------------------------------------------------------------- diff --git a/libs/iotivity/src/messaging/coap/engine.c b/libs/iotivity/src/messaging/coap/engine.c index 638541e..0eecabf 100644 --- a/libs/iotivity/src/messaging/coap/engine.c +++ b/libs/iotivity/src/messaging/coap/engine.c @@ -61,7 +61,7 @@ coap_receive(oc_message_t *msg) { erbium_status_code = NO_ERROR; - LOG("\n\nCoAP Engine: received datalen=%lu \n", msg->length); + LOG("\n\nCoAP Engine: received datalen=%u \n", (unsigned int) msg->length); /* static declaration reduces stack peaks and program code size */ static coap_packet_t @@ -141,8 +141,8 @@ coap_receive(oc_message_t *msg) } if (coap_get_header_block2(message, &block_num, NULL, &block_size, &block_offset)) { - LOG("\tBlockwise: block request %u (%u/%u) @ %u bytes\n", block_num, - block_size, COAP_MAX_BLOCK_SIZE, block_offset); + LOG("\tBlockwise: block request %u (%u/%u) @ %u bytes\n", (unsigned int) block_num, + block_size, COAP_MAX_BLOCK_SIZE, (unsigned int) block_offset); block_size = MIN(block_size, COAP_MAX_BLOCK_SIZE); new_offset = block_offset; } @@ -195,7 +195,7 @@ coap_receive(oc_message_t *msg) /* resource provides chunk-wise data */ } else { LOG("\tBlockwise: blockwise resource, new offset %d\n", - new_offset); + (int) new_offset); coap_set_header_block2(response, block_num, new_offset != -1 || response->payload_len > block_size, http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/1693f95a/libs/iotivity/src/messaging/coap/transactions.c ---------------------------------------------------------------------- diff --git a/libs/iotivity/src/messaging/coap/transactions.c b/libs/iotivity/src/messaging/coap/transactions.c index 851cce1..facd95f 100644 --- a/libs/iotivity/src/messaging/coap/transactions.c +++ b/libs/iotivity/src/messaging/coap/transactions.c @@ -68,7 +68,7 @@ coap_new_transaction(uint16_t mid, oc_endpoint_t *endpoint) if (t) { oc_message_t *message = oc_allocate_message(); if (message) { - LOG("Created new transaction %d %ld\n", mid, message->length); + LOG("Created new transaction %d %d\n", mid, (int) message->length); t->mid = mid; t->retrans_counter = 0;