Skip to content

Commit 1ff8b44

Browse files
committed
Widen the mynewt pointer prints so they build on a 64 bit native BSP
1 parent ddbab7b commit 1ff8b44

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

mynewt/client-tls-mn.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#include <hal/hal_gpio.h>
2626
#include <hal/hal_flash.h>
27+
#include <stdint.h>
2728
#include <console/console.h>
2829

2930
#include <log/log.h>
@@ -120,12 +121,12 @@ static const oc_handler_t omgr_oc_handler = {
120121

121122
static void net_test_readable(void *arg, int err)
122123
{
123-
console_printf("net_test_readable %x - %d\n", (int)arg, err);
124+
console_printf("net_test_readable %lx - %d\n", (unsigned long)(uintptr_t)arg, err);
124125
}
125126

126127
static void net_test_writable(void *arg, int err)
127128
{
128-
console_printf("net_test_writable %x - %d\n", (int)arg, err);
129+
console_printf("net_test_writable %lx - %d\n", (unsigned long)(uintptr_t)arg, err);
129130
}
130131

131132
static const union mn_socket_cb net_test_cbs = {
@@ -135,7 +136,8 @@ static const union mn_socket_cb net_test_cbs = {
135136

136137
static int net_test_newconn(void *arg, struct mn_socket *new)
137138
{
138-
console_printf("net_test_newconn %x - %x\n", (int)arg, (int)new);
139+
console_printf("net_test_newconn %lx - %lx\n", (unsigned long)(uintptr_t)arg,
140+
(unsigned long)(uintptr_t)new);
139141
mn_socket_set_cbs(new, NULL, &net_test_cbs);
140142
net_test_socket2 = new;
141143
return 0;
@@ -161,12 +163,12 @@ net_cli(int argc, char **argv)
161163
}
162164
if (!strcmp(argv[1], "udp")) {
163165
rc = mn_socket(&net_test_socket, MN_PF_INET, MN_SOCK_DGRAM, 0);
164-
console_printf("mn_socket(UDP) = %d %x\n", rc,
165-
(int)net_test_socket);
166+
console_printf("mn_socket(UDP) = %d %lx\n", rc,
167+
(unsigned long)(uintptr_t)net_test_socket);
166168
} else if (!strcmp(argv[1], "tcp")) {
167169
rc = mn_socket(&net_test_socket, MN_PF_INET, MN_SOCK_STREAM, 0);
168-
console_printf("mn_socket(TCP) = %d %x\n", rc,
169-
(int)net_test_socket);
170+
console_printf("mn_socket(TCP) = %d %lx\n", rc,
171+
(unsigned long)(uintptr_t)net_test_socket);
170172
} else if (!strcmp(argv[1], "connect") || !strcmp(argv[1], "bind")) {
171173
char *addrStr = DEFAULT_IPADDR;
172174
int port = DEFAULT_PORT;

0 commit comments

Comments
 (0)