Skip to content

Commit

Permalink
Fixed compile warnings in posix_logger.h and coding.h
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yhchiang committed Mar 31, 2016
1 parent 51c9464 commit a558830
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 0 additions & 2 deletions port/win/win_logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions util/coding.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions util/posix_logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@

namespace rocksdb {

const int kDebugLogChunkSize = 128 * 1024;

class PosixLogger : public Logger {
private:
FILE* file_;
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit a558830

Please sign in to comment.