mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Turn on -Wmissing-prototypes
Summary: Compiling for iOS has by default turned on -Wmissing-prototypes, which causes rocksdb to fail compiling. This diff turns on -Wmissing-prototypes in our compile options and cleans up all functions with missing prototypes. Test Plan: compiles Reviewers: dhruba, haobo, ljin, sdong Reviewed By: ljin CC: leveldb Differential Revision: https://reviews.facebook.net/D17649
This commit is contained in:
@@ -954,11 +954,14 @@ Status BlockBasedTable::Get(
|
||||
return s;
|
||||
}
|
||||
|
||||
namespace {
|
||||
bool SaveDidIO(void* arg, const ParsedInternalKey& key, const Slice& value,
|
||||
bool didIO) {
|
||||
*reinterpret_cast<bool*>(arg) = didIO;
|
||||
return false;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
bool BlockBasedTable::TEST_KeyInCache(const ReadOptions& options,
|
||||
const Slice& key) {
|
||||
// We use Get() as it has logic that checks whether we read the
|
||||
|
||||
@@ -41,24 +41,4 @@ class MinIteratorComparator {
|
||||
const Comparator* comparator_;
|
||||
};
|
||||
|
||||
typedef std::priority_queue<
|
||||
IteratorWrapper*,
|
||||
std::vector<IteratorWrapper*>,
|
||||
MaxIteratorComparator> MaxIterHeap;
|
||||
|
||||
typedef std::priority_queue<
|
||||
IteratorWrapper*,
|
||||
std::vector<IteratorWrapper*>,
|
||||
MinIteratorComparator> MinIterHeap;
|
||||
|
||||
// Return's a new MaxHeap of IteratorWrapper's using the provided Comparator.
|
||||
MaxIterHeap NewMaxIterHeap(const Comparator* comparator) {
|
||||
return MaxIterHeap(MaxIteratorComparator(comparator));
|
||||
}
|
||||
|
||||
// Return's a new MinHeap of IteratorWrapper's using the provided Comparator.
|
||||
MinIterHeap NewMinIterHeap(const Comparator* comparator) {
|
||||
return MinIterHeap(MinIteratorComparator(comparator));
|
||||
}
|
||||
|
||||
} // namespace rocksdb
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
|
||||
#include "table/merger.h"
|
||||
|
||||
#include <vector>
|
||||
#include <queue>
|
||||
|
||||
#include "rocksdb/comparator.h"
|
||||
#include "rocksdb/iterator.h"
|
||||
#include "rocksdb/options.h"
|
||||
@@ -17,12 +20,29 @@
|
||||
#include "util/stop_watch.h"
|
||||
#include "util/perf_context_imp.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace rocksdb {
|
||||
|
||||
namespace {
|
||||
|
||||
typedef std::priority_queue<
|
||||
IteratorWrapper*,
|
||||
std::vector<IteratorWrapper*>,
|
||||
MaxIteratorComparator> MaxIterHeap;
|
||||
|
||||
typedef std::priority_queue<
|
||||
IteratorWrapper*,
|
||||
std::vector<IteratorWrapper*>,
|
||||
MinIteratorComparator> MinIterHeap;
|
||||
|
||||
// Return's a new MaxHeap of IteratorWrapper's using the provided Comparator.
|
||||
MaxIterHeap NewMaxIterHeap(const Comparator* comparator) {
|
||||
return MaxIterHeap(MaxIteratorComparator(comparator));
|
||||
}
|
||||
|
||||
// Return's a new MinHeap of IteratorWrapper's using the provided Comparator.
|
||||
MinIterHeap NewMinIterHeap(const Comparator* comparator) {
|
||||
return MinIterHeap(MinIteratorComparator(comparator));
|
||||
}
|
||||
|
||||
class MergingIterator : public Iterator {
|
||||
public:
|
||||
MergingIterator(const Comparator* comparator, Iterator** children, int n)
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
#include "util/testutil.h"
|
||||
|
||||
namespace rocksdb {
|
||||
|
||||
namespace {
|
||||
// Make a key that i determines the first 4 characters and j determines the
|
||||
// last 4 characters.
|
||||
static std::string MakeKey(int i, int j, bool through_db) {
|
||||
@@ -43,6 +45,7 @@ static bool DummySaveValue(void* arg, const ParsedInternalKey& ikey,
|
||||
uint64_t Now(Env* env, bool measured_by_nanosecond) {
|
||||
return measured_by_nanosecond ? env->NowNanos() : env->NowMicros();
|
||||
}
|
||||
} // namespace
|
||||
|
||||
// A very simple benchmark that.
|
||||
// Create a table with roughly numKey1 * numKey2 keys,
|
||||
@@ -57,6 +60,7 @@ uint64_t Now(Env* env, bool measured_by_nanosecond) {
|
||||
//
|
||||
// If for_terator=true, instead of just query one key each time, it queries
|
||||
// a range sharing the same prefix.
|
||||
namespace {
|
||||
void TableReaderBenchmark(Options& opts, EnvOptions& env_options,
|
||||
ReadOptions& read_options, int num_keys1,
|
||||
int num_keys2, int num_iter, int prefix_len,
|
||||
@@ -215,6 +219,7 @@ void TableReaderBenchmark(Options& opts, EnvOptions& env_options,
|
||||
DestroyDB(dbname, opts);
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
} // namespace rocksdb
|
||||
|
||||
DEFINE_bool(query_empty, false, "query non-existing keys instead of existing "
|
||||
@@ -264,10 +269,10 @@ int main(int argc, char** argv) {
|
||||
|
||||
options.table_factory =
|
||||
std::shared_ptr<rocksdb::TableFactory>(tf);
|
||||
TableReaderBenchmark(options, env_options, ro, FLAGS_num_keys1,
|
||||
FLAGS_num_keys2, FLAGS_iter, FLAGS_prefix_len,
|
||||
FLAGS_query_empty, FLAGS_iterator, FLAGS_through_db,
|
||||
measured_by_nanosecond);
|
||||
rocksdb::TableReaderBenchmark(options, env_options, ro, FLAGS_num_keys1,
|
||||
FLAGS_num_keys2, FLAGS_iter, FLAGS_prefix_len,
|
||||
FLAGS_query_empty, FLAGS_iterator,
|
||||
FLAGS_through_db, measured_by_nanosecond);
|
||||
delete tf;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user