From 1f621e6abc982d2b316ee692b35ec4a1e192789c Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Tue, 11 Nov 2014 14:09:10 -0800 Subject: [PATCH] Fix additional -Wshorten-64-to-32 errros --- util/posix_logger.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/util/posix_logger.h b/util/posix_logger.h index 6aba769f1..e4a2c8456 100644 --- a/util/posix_logger.h +++ b/util/posix_logger.h @@ -123,14 +123,15 @@ class PosixLogger : public Logger { // space, pre-allocate more space to avoid overly large // allocations from filesystem allocsize options. const size_t log_size = log_size_; - const int last_allocation_chunk = + const size_t last_allocation_chunk = ((kDebugLogChunkSize - 1 + log_size) / kDebugLogChunkSize); - const int desired_allocation_chunk = + const size_t desired_allocation_chunk = ((kDebugLogChunkSize - 1 + log_size + write_size) / kDebugLogChunkSize); if (last_allocation_chunk != desired_allocation_chunk) { - fallocate(fd_, FALLOC_FL_KEEP_SIZE, 0, - desired_allocation_chunk * kDebugLogChunkSize); + fallocate( + fd_, FALLOC_FL_KEEP_SIZE, 0, + static_cast(desired_allocation_chunk * kDebugLogChunkSize)); } #endif