From 1de5d149139b291fe7d768c8a84ec17bb1a8a04e Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Fri, 13 Apr 2018 15:49:09 +0200 Subject: [PATCH] CephBroker.cc: fix format qualifier for unsigned int Signed-off-by: Danny Al-Gaaf --- src/client/hypertable/CephBroker.cc | 42 ++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/src/client/hypertable/CephBroker.cc b/src/client/hypertable/CephBroker.cc index d7911cbfa97..91578a17236 100644 --- a/src/client/hypertable/CephBroker.cc +++ b/src/client/hypertable/CephBroker.cc @@ -117,7 +117,7 @@ void CephBroker::open(ResponseCallbackOpen *cb, const char *fname, report_error(cb, -ceph_fd); return; } - HT_INFOF("open (%s) fd=%d ceph_fd=%d", fname, fd, ceph_fd); + HT_INFOF("open (%s) fd=%" PRIu32 " ceph_fd=%d", fname, fd, ceph_fd); { struct sockaddr_in addr; @@ -182,7 +182,7 @@ void CephBroker::create(ResponseCallbackOpen *cb, const char *fname, uint32_t fl void CephBroker::close(ResponseCallback *cb, uint32_t fd) { if (m_verbose) { - HT_INFOF("close fd=%d", fd); + HT_INFOF("close fd=%" PRIu32, fd); } OpenFileDataCephPtr fdata; m_open_file_map.get(fd, fdata); @@ -196,26 +196,26 @@ void CephBroker::read(ResponseCallbackRead *cb, uint32_t fd, uint32_t amount) { uint64_t offset; StaticBuffer buf(new uint8_t [amount], amount); - HT_DEBUGF("read fd=%d amount = %d", fd, amount); + HT_DEBUGF("read fd=%" PRIu32 " amount = %d", fd, amount); if (!m_open_file_map.get(fd, fdata)) { char errbuf[32]; - sprintf(errbuf, "%d", fd); + sprintf(errbuf, "%" PRIu32, fd); cb->error(Error::DFSBROKER_BAD_FILE_HANDLE, errbuf); - HT_ERRORF("bad file handle: %d", fd); + HT_ERRORF("bad file handle: %" PRIu32, fd); return; } if ((offset = ceph_lseek(cmount, fdata->fd, 0, SEEK_CUR)) < 0) { std::string errs(cpp_strerror((int)-offset)); - HT_ERRORF("lseek failed: fd=%d ceph_fd=%d offset=0 SEEK_CUR - %s", + HT_ERRORF("lseek failed: fd=%" PRIu32 " ceph_fd=%d offset=0 SEEK_CUR - %s", fd, fdata->fd, errs.c_str()); report_error(cb, offset); return; } if ((nread = ceph_read(cmount, fdata->fd, (char *)buf.base, amount, 0)) < 0 ) { - HT_ERRORF("read failed: fd=%d ceph_fd=%d amount=%d", fd, fdata->fd, amount); + HT_ERRORF("read failed: fd=%" PRIu32 " ceph_fd=%d amount=%d", fd, fdata->fd, amount); report_error(cb, -nread); return; } @@ -236,14 +236,14 @@ void CephBroker::append(ResponseCallbackAppend *cb, uint32_t fd, if (!m_open_file_map.get(fd, fdata)) { char errbuf[32]; - sprintf(errbuf, "%d", fd); + sprintf(errbuf, "%" PRIu32, fd); cb->error(Error::DFSBROKER_BAD_FILE_HANDLE, errbuf); return; } if ((offset = (uint64_t)ceph_lseek(cmount, fdata->fd, 0, SEEK_CUR)) < 0) { std::string errs(cpp_strerror((int)-offset)); - HT_ERRORF("lseek failed: fd=%d ceph_fd=%d offset=0 SEEK_CUR - %s", fd, fdata->fd, + HT_ERRORF("lseek failed: fd=%" PRIu32 " ceph_fd=%d offset=0 SEEK_CUR - %s", fd, fdata->fd, errs.c_str()); report_error(cb, offset); return; @@ -251,7 +251,7 @@ void CephBroker::append(ResponseCallbackAppend *cb, uint32_t fd, if ((nwritten = ceph_write(cmount, fdata->fd, (const char *)data, amount, 0)) < 0) { std::string errs(cpp_strerror(nwritten)); - HT_ERRORF("write failed: fd=%d ceph_fd=%d amount=%d - %s", + HT_ERRORF("write failed: fd=%" PRIu32 " ceph_fd=%d amount=%d - %s", fd, fdata->fd, amount, errs.c_str()); report_error(cb, -nwritten); return; @@ -260,7 +260,7 @@ void CephBroker::append(ResponseCallbackAppend *cb, uint32_t fd, int r; if (sync && ((r = ceph_fsync(cmount, fdata->fd, true)) != 0)) { std::string errs(cpp_strerror(errno)); - HT_ERRORF("flush failed: fd=%d ceph_fd=%d - %s", fd, fdata->fd, errs.c_str()); + HT_ERRORF("flush failed: fd=%" PRIu32 " ceph_fd=%d - %s", fd, fdata->fd, errs.c_str()); report_error(cb, r); return; } @@ -271,18 +271,18 @@ void CephBroker::append(ResponseCallbackAppend *cb, uint32_t fd, void CephBroker::seek(ResponseCallback *cb, uint32_t fd, uint64_t offset) { OpenFileDataCephPtr fdata; - HT_DEBUGF("seek fd=%lu offset=%llu", (Lu)fd, (Llu)offset); + HT_DEBUGF("seek fd=%" PRIu32 " offset=%llu", fd, (Llu)offset); if (!m_open_file_map.get(fd, fdata)) { char errbuf[32]; - sprintf(errbuf, "%d", fd); + sprintf(errbuf, "%" PRIu32, fd); cb->error(Error::DFSBROKER_BAD_FILE_HANDLE, errbuf); return; } loff_t res = ceph_lseek(cmount, fdata->fd, offset, SEEK_SET); if (res < 0) { std::string errs(cpp_strerror((int)res)); - HT_ERRORF("lseek failed: fd=%d ceph_fd=%d offset=%llu - %s", + HT_ERRORF("lseek failed: fd=%" PRIu32 " ceph_fd=%d offset=%llu - %s", fd, fdata->fd, (Llu)offset, errs.c_str()); report_error(cb, offset); return; @@ -331,19 +331,19 @@ void CephBroker::pread(ResponseCallbackRead *cb, uint32_t fd, uint64_t offset, ssize_t nread; StaticBuffer buf(new uint8_t [amount], amount); - HT_DEBUGF("pread fd=%d offset=%llu amount=%d", fd, (Llu)offset, amount); + HT_DEBUGF("pread fd=%" PRIu32 " offset=%llu amount=%d", fd, (Llu)offset, amount); if (!m_open_file_map.get(fd, fdata)) { char errbuf[32]; - sprintf(errbuf, "%d", fd); + sprintf(errbuf, "%" PRIu32, fd); cb->error(Error::DFSBROKER_BAD_FILE_HANDLE, errbuf); return; } if ((nread = ceph_read(cmount, fdata->fd, (char *)buf.base, amount, offset)) < 0) { std::string errs(cpp_strerror(nread)); - HT_ERRORF("pread failed: fd=%d ceph_fd=%d amount=%d offset=%llu - %s", fd, fdata->fd, - amount, (Llu)offset, errs.c_str()); + HT_ERRORF("pread failed: fd=%" PRIu32 " ceph_fd=%d amount=%d offset=%llu - %s", + fd, fdata->fd, amount, (Llu)offset, errs.c_str()); report_error(cb, nread); return; } @@ -409,11 +409,11 @@ int CephBroker::rmdir_recursive(const char *directory) { void CephBroker::flush(ResponseCallback *cb, uint32_t fd) { OpenFileDataCephPtr fdata; - HT_DEBUGF("flush fd=%d", fd); + HT_DEBUGF("flush fd=%" PRIu32, fd); if (!m_open_file_map.get(fd, fdata)) { char errbuf[32]; - sprintf(errbuf, "%d", fd); + sprintf(errbuf, "%" PRIu32, fd); cb->error(Error::DFSBROKER_BAD_FILE_HANDLE, errbuf); return; } @@ -421,7 +421,7 @@ void CephBroker::flush(ResponseCallback *cb, uint32_t fd) { int r; if ((r = ceph_fsync(cmount, fdata->fd, true)) != 0) { std::string errs(cpp_strerror(r)); - HT_ERRORF("flush failed: fd=%d ceph_fd=%d - %s", fd, fdata->fd, errs.c_str()); + HT_ERRORF("flush failed: fd=%" PRIu32 " ceph_fd=%d - %s", fd, fdata->fd, errs.c_str()); report_error(cb, -r); return; } -- 2.39.5