From a558830f8f5740253fda130540a66b0bf0ff5457 Mon Sep 17 00:00:00 2001 From: Yueh-Hsuan Chiang Date: Thu, 31 Mar 2016 16:01:47 -0700 Subject: [PATCH] Fixed compile warnings in posix_logger.h and coding.h Summary: Fixed the following compile warnings: /Users/yhchiang/rocksdb/util/posix_logger.h:32:11: error: unused variable 'kDebugLogChunkSize' [-Werror,-Wunused-const-variable] const int kDebugLogChunkSize = 128 * 1024; ^ /Users/yhchiang/rocksdb/util/coding.h:24:20: error: unused variable 'kMaxVarint32Length' [-Werror,-Wunused-const-variable] const unsigned int kMaxVarint32Length = 5; ^ 2 errors generated. Test Plan: make clean rocksdb Reviewers: igor, sdong, anthony, IslamAbdelRahman, rven, kradhakrishnan, adamretter Reviewed By: adamretter Subscribers: andrewkr, dhruba, leveldb Differential Revision: https://reviews.facebook.net/D56223 --- port/win/win_logger.h | 2 -- util/coding.h | 3 +-- util/posix_logger.h | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/port/win/win_logger.h b/port/win/win_logger.h index 87c4dfe46..a85f24c83 100644 --- a/port/win/win_logger.h +++ b/port/win/win_logger.h @@ -23,8 +23,6 @@ namespace rocksdb { class Env; -const int kDebugLogChunkSize = 128 * 1024; - class WinLogger : public rocksdb::Logger { public: WinLogger(uint64_t (*gettid)(), Env* env, HANDLE file, diff --git a/util/coding.h b/util/coding.h index 6aaf403a3..078a03c2f 100644 --- a/util/coding.h +++ b/util/coding.h @@ -23,8 +23,7 @@ namespace rocksdb { -// The maximum length of a varint in bytes for 32 and 64 bits respectively. -const unsigned int kMaxVarint32Length = 5; +// The maximum length of a varint in bytes for 64-bit. const unsigned int kMaxVarint64Length = 10; // Standard Put... routines append to a string diff --git a/util/posix_logger.h b/util/posix_logger.h index 61bb9e38a..f9b93afdb 100644 --- a/util/posix_logger.h +++ b/util/posix_logger.h @@ -30,8 +30,6 @@ namespace rocksdb { -const int kDebugLogChunkSize = 128 * 1024; - class PosixLogger : public Logger { private: FILE* file_; @@ -129,6 +127,8 @@ class PosixLogger : public Logger { const size_t write_size = p - base; #ifdef ROCKSDB_FALLOCATE_PRESENT + const int kDebugLogChunkSize = 128 * 1024; + // If this write would cross a boundary of kDebugLogChunkSize // space, pre-allocate more space to avoid overly large // allocations from filesystem allocsize options.