提交 f7f973d3 编写于 作者: I Igor Canadi

Merge pull request #269 from huahang/patch-2

fix a few compile warnings
......@@ -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; }
......
......@@ -71,7 +71,7 @@ class SnapshotList {
}
// get the sequence number of the most recent snapshot
const SequenceNumber GetNewest() {
SequenceNumber GetNewest() {
if (empty()) {
return 0;
}
......
......@@ -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_);
......
......@@ -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) +
......
......@@ -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_ ) {
......
......@@ -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
......
......@@ -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>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册