Merge pull request #269 from huahang/patch-2

fix a few compile warnings
This commit is contained in:
Igor Canadi 2014-09-04 09:43:00 -07:00
commit f7f973d354
7 changed files with 13 additions and 8 deletions

View File

@ -244,7 +244,7 @@ class IterKey {
Slice GetKey() const { return Slice(key_, key_size_); }
const size_t Size() { return key_size_; }
size_t Size() { return key_size_; }
void Clear() { key_size_ = 0; }

View File

@ -71,7 +71,7 @@ class SnapshotList {
}
// get the sequence number of the most recent snapshot
const SequenceNumber GetNewest() {
SequenceNumber GetNewest() {
if (empty()) {
return 0;
}

View File

@ -210,8 +210,8 @@ Status BlockPrefixIndex::Create(const SliceTransform* internal_prefix_extractor,
return s;
}
const uint32_t BlockPrefixIndex::GetBlocks(const Slice& key,
uint32_t** blocks) {
uint32_t BlockPrefixIndex::GetBlocks(const Slice& key,
uint32_t** blocks) {
Slice prefix = internal_prefix_extractor_->Transform(key);
uint32_t bucket = PrefixToBucket(prefix, num_buckets_);

View File

@ -23,7 +23,7 @@ class BlockPrefixIndex {
// the key, based on the prefix.
// Returns the total number of relevant blocks, 0 means the key does
// not exist.
const uint32_t GetBlocks(const Slice& key, uint32_t** blocks);
uint32_t GetBlocks(const Slice& key, uint32_t** blocks);
size_t ApproximateMemoryUsage() const {
return sizeof(BlockPrefixIndex) +

View File

@ -53,7 +53,7 @@ HistogramBucketMapper::HistogramBucketMapper()
}
}
const size_t HistogramBucketMapper::IndexForValue(const uint64_t value) const {
size_t HistogramBucketMapper::IndexForValue(const uint64_t value) const {
if (value >= maxBucketValue_) {
return bucketValues_.size() - 1;
} else if ( value >= minBucketValue_ ) {

View File

@ -23,10 +23,10 @@ class HistogramBucketMapper {
HistogramBucketMapper();
// converts a value to the bucket index.
const size_t IndexForValue(const uint64_t value) const;
size_t IndexForValue(const uint64_t value) const;
// number of buckets required.
const size_t BucketCount() const {
size_t BucketCount() const {
return bucketValues_.size();
}
@ -65,6 +65,8 @@ class HistogramImpl {
virtual double StandardDeviation() const;
virtual void Data(HistogramData * const data) const;
virtual ~HistogramImpl() {}
private:
// To be able to use HistogramImpl as thread local variable, its constructor
// has to be static. That's why we're using manually values from BucketMapper

View File

@ -7,7 +7,10 @@
#include "rocksdb/utilities/spatial_db.h"
#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
#endif
#include <inttypes.h>
#include <string>
#include <vector>