diff --git a/netutils/tftpc/tftpc_get.c b/netutils/tftpc/tftpc_get.c index e6b945728..7d7fcda55 100644 --- a/netutils/tftpc/tftpc_get.c +++ b/netutils/tftpc/tftpc_get.c @@ -304,7 +304,7 @@ errout: static ssize_t tftp_write(FAR void *ctx, uint32_t offset, FAR uint8_t *buf, size_t len) { - int fd = (int)ctx; + int fd = (intptr_t)ctx; size_t left = len; ssize_t nbyteswritten; @@ -365,7 +365,8 @@ int tftpget(FAR const char *remote, FAR const char *local, in_addr_t addr, goto errout; } - result = tftpget_cb(remote, addr, binary, tftp_write, (void*)fd); + result = tftpget_cb(remote, addr, binary, tftp_write, + (FAR void *)(intptr_t)fd); close(fd); diff --git a/netutils/tftpc/tftpc_put.c b/netutils/tftpc/tftpc_put.c index e321a516f..6bc2b5d95 100644 --- a/netutils/tftpc/tftpc_put.c +++ b/netutils/tftpc/tftpc_put.c @@ -431,7 +431,7 @@ errout: static ssize_t tftp_read(FAR void *ctx, uint32_t offset, FAR uint8_t *buf, size_t buflen) { - int fd = (int)ctx; + int fd = (intptr_t)ctx; off_t tmp; ssize_t nbytesread; ssize_t totalread = 0; @@ -512,7 +512,8 @@ int tftpput(FAR const char *local, FAR const char *remote, in_addr_t addr, goto errout; } - result = tftpput_cb(remote, addr, binary, tftp_read, (FAR void *)fd); + result = tftpput_cb(remote, addr, binary, tftp_read, + (FAR void *)(intptr_t)fd); close(fd);