From 2d96ce8faa277809c0c94aca54320483889f577d Mon Sep 17 00:00:00 2001 From: Xavi Hernandez Date: Tue, 25 Sep 2018 13:22:47 +0200 Subject: all: fix warnings on non 64-bits architectures When compiling in other architectures there appear many warnings. Some of them are actual problems that prevent gluster to work correctly on those architectures. Change-Id: Icdc7107a2bc2da662903c51910beddb84bdf03c0 fixes: bz#1632717 Signed-off-by: Xavi Hernandez --- xlators/features/bit-rot/src/bitd/bit-rot.c | 3 +-- xlators/features/bit-rot/src/stub/bit-rot-stub.c | 6 +++--- xlators/features/bit-rot/src/stub/bit-rot-stub.h | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) (limited to 'xlators/features/bit-rot') diff --git a/xlators/features/bit-rot/src/bitd/bit-rot.c b/xlators/features/bit-rot/src/bitd/bit-rot.c index 75fa0490c90..8ea89257836 100644 --- a/xlators/features/bit-rot/src/bitd/bit-rot.c +++ b/xlators/features/bit-rot/src/bitd/bit-rot.c @@ -351,8 +351,7 @@ br_calculate_obj_checksum(unsigned char *md, br_child_t *child, fd_t *fd, &sha256); if (ret < 0) { gf_msg(this->name, GF_LOG_ERROR, 0, BRB_MSG_BLOCK_READ_FAILED, - "reading block with " - "offset %lu of object %s failed", + "reading block with offset %" PRIu64 " of object %s failed", offset, uuid_utoa(fd->inode->gfid)); break; } diff --git a/xlators/features/bit-rot/src/stub/bit-rot-stub.c b/xlators/features/bit-rot/src/stub/bit-rot-stub.c index c6c9b6aafce..0fc2b651b2d 100644 --- a/xlators/features/bit-rot/src/stub/bit-rot-stub.c +++ b/xlators/features/bit-rot/src/stub/bit-rot-stub.c @@ -410,7 +410,7 @@ br_stub_init_inode_versions(xlator_t *this, fd_t *fd, inode_t *inode, goto free_ctx; if (ctx_addr) - *ctx_addr = (uint64_t)ctx; + *ctx_addr = (uint64_t)(uintptr_t)ctx; return 0; free_ctx: @@ -3411,14 +3411,14 @@ br_stub_ictxmerge(xlator_t *this, fd_t *fd, inode_t *inode, ret = br_stub_get_inode_ctx(this, inode, &ctxaddr); if (ret < 0) goto done; - ctx = (br_stub_inode_ctx_t *)ctxaddr; + ctx = (br_stub_inode_ctx_t *)(uintptr_t)ctxaddr; LOCK(&linked_inode->lock); { ret = __br_stub_get_inode_ctx(this, linked_inode, &lctxaddr); if (ret < 0) goto unblock; - lctx = (br_stub_inode_ctx_t *)lctxaddr; + lctx = (br_stub_inode_ctx_t *)(uintptr_t)lctxaddr; GF_ASSERT(list_is_singular(&ctx->fd_list)); br_stub_fd = list_first_entry(&ctx->fd_list, br_stub_fd_t, list); diff --git a/xlators/features/bit-rot/src/stub/bit-rot-stub.h b/xlators/features/bit-rot/src/stub/bit-rot-stub.h index a15667e323a..9e6492ebdd7 100644 --- a/xlators/features/bit-rot/src/stub/bit-rot-stub.h +++ b/xlators/features/bit-rot/src/stub/bit-rot-stub.h @@ -255,7 +255,7 @@ br_stub_get_inode_ctx(xlator_t *this, inode_t *inode, uint64_t *ctx) static inline int br_stub_set_inode_ctx(xlator_t *this, inode_t *inode, br_stub_inode_ctx_t *ctx) { - uint64_t ctx_addr = (uint64_t)ctx; + uint64_t ctx_addr = (uint64_t)(uintptr_t)ctx; return inode_ctx_set(inode, this, &ctx_addr); } -- cgit