From: Kefu Chai Date: Mon, 1 May 2017 04:27:44 +0000 (+0800) Subject: test/librbd: print uint64_t in a platform neutral way X-Git-Tag: v12.0.3~150^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5126f553197c9b32499d601c257cb3cd234bc14d;p=ceph.git test/librbd: print uint64_t in a platform neutral way Signed-off-by: Kefu Chai --- diff --git a/src/test/librbd/test_internal.cc b/src/test/librbd/test_internal.cc index 5b4f1d68162a..92121beab998 100644 --- a/src/test/librbd/test_internal.cc +++ b/src/test/librbd/test_internal.cc @@ -1030,7 +1030,7 @@ TEST_F(TestInternal, TestCoR) ASSERT_EQ(0, image.stat(info, sizeof(info))); const int object_num = info.size / info.obj_size; - printf("made parent image \"%s\": %ldK (%d * %ldK)\n", m_image_name.c_str(), + printf("made parent image \"%s\": %ldK (%d * %" PRIu64 "K)\n", m_image_name.c_str(), (unsigned long)m_image_size, object_num, info.obj_size/1024); // write something into parent @@ -1167,8 +1167,8 @@ TEST_F(TestInternal, FlattenNoEmptyObjects) ASSERT_EQ(0, image.stat(info, sizeof(info))); const int object_num = info.size / info.obj_size; - printf("made parent image \"%s\": %ldK (%d * %ldK)\n", m_image_name.c_str(), - (unsigned long)m_image_size, object_num, info.obj_size/1024); + printf("made parent image \"%s\": %" PRIu64 "K (%d * %" PRIu64 "K)\n", + m_image_name.c_str(), m_image_size, object_num, info.obj_size/1024); // write something into parent char test_data[TEST_IO_SIZE + 1]; diff --git a/src/test/librbd/test_librbd.cc b/src/test/librbd/test_librbd.cc index 3d2089480922..989b605e23b4 100644 --- a/src/test/librbd/test_librbd.cc +++ b/src/test/librbd/test_librbd.cc @@ -109,7 +109,8 @@ static int create_image_full(rados_ioctx_t ioctx, const char *name, stripe_unit = (1ull << (*order-1)); } - printf("creating image with stripe unit: %ld, stripe count: %ld\n", + printf("creating image with stripe unit: %" PRIu64 ", " + "stripe count: %" PRIu64 "\n", stripe_unit, IMAGE_STRIPE_COUNT); return rbd_create3(ioctx, name, size, features, order, stripe_unit, IMAGE_STRIPE_COUNT); diff --git a/src/test/librbd/test_support.cc b/src/test/librbd/test_support.cc index db16131df05e..fa8e25194a76 100644 --- a/src/test/librbd/test_support.cc +++ b/src/test/librbd/test_support.cc @@ -40,7 +40,7 @@ int create_image_full_pp(librbd::RBD &rbd, librados::IoCtx &ioctx, stripe_unit = (1ull << (*order-1)); } - printf("creating image with stripe unit: %ld, stripe count: %ld\n", + printf("creating image with stripe unit: %" PRIu64 ", stripe count: %" PRIu64 "\n", stripe_unit, IMAGE_STRIPE_COUNT); return rbd.create3(ioctx, name.c_str(), size, features, order, stripe_unit, IMAGE_STRIPE_COUNT);