Skip to content

Commit

Permalink
Merge pull request XRPLF#269 from huahang/patch-2
Browse files Browse the repository at this point in the history
fix a few compile warnings
  • Loading branch information
igorcanadi committed Sep 4, 2014
2 parents 2fd3806 + ef5b384 commit f7f973d
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion db/dbformat.h
Expand Up @@ -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; }

Expand Down
2 changes: 1 addition & 1 deletion db/snapshot.h
Expand Up @@ -71,7 +71,7 @@ class SnapshotList {
}

// get the sequence number of the most recent snapshot
const SequenceNumber GetNewest() {
SequenceNumber GetNewest() {
if (empty()) {
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions table/block_prefix_index.cc
Expand Up @@ -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_);
Expand Down
2 changes: 1 addition & 1 deletion table/block_prefix_index.h
Expand Up @@ -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) +
Expand Down
2 changes: 1 addition & 1 deletion util/histogram.cc
Expand Up @@ -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_ ) {
Expand Down
6 changes: 4 additions & 2 deletions util/histogram.h
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions utilities/spatialdb/spatial_db.cc
Expand Up @@ -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>
Expand Down

0 comments on commit f7f973d

Please sign in to comment.