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:
@@ -25,6 +25,7 @@ namespace rocksdb {
|
||||
// Path to the database on file system
|
||||
const std::string kDbName = "/tmp/mergetestdb";
|
||||
|
||||
namespace {
|
||||
// OpenDb opens a (possibly new) rocksdb database with a StringAppendOperator
|
||||
std::shared_ptr<DB> OpenNormalDb(char delim_char) {
|
||||
DB* db;
|
||||
@@ -44,6 +45,7 @@ std::shared_ptr<DB> OpenTtlDb(char delim_char) {
|
||||
ASSERT_OK(UtilityDB::OpenTtlDB(options, kDbName, &db, 123456));
|
||||
return std::shared_ptr<DB>(db);
|
||||
}
|
||||
} // namespace
|
||||
|
||||
/// StringLists represents a set of string-lists, each with a key-index.
|
||||
/// Supports Append(list, string) and Get(list)
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// Copyright (c) 2013, Facebook, Inc. All rights reserved.
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree. An additional grant
|
||||
// of patent rights can be found in the PATENTS file in the same directory.
|
||||
/**
|
||||
* A test harness for the Redis API built on rocksdb.
|
||||
*
|
||||
@@ -9,7 +13,6 @@
|
||||
* TODO: Add LARGE random test cases to verify efficiency and scalability
|
||||
*
|
||||
* @author Deon Nicholas (dnicholas@fb.com)
|
||||
* Copyright 2013 Facebook
|
||||
*/
|
||||
|
||||
|
||||
@@ -41,6 +44,7 @@ Options RedisListsTest::options = Options();
|
||||
// operator== and operator<< are defined below for vectors (lists)
|
||||
// Needed for ASSERT_EQ
|
||||
|
||||
namespace {
|
||||
void AssertListEq(const std::vector<std::string>& result,
|
||||
const std::vector<std::string>& expected_result) {
|
||||
ASSERT_EQ(result.size(), expected_result.size());
|
||||
@@ -48,6 +52,7 @@ void AssertListEq(const std::vector<std::string>& result,
|
||||
ASSERT_EQ(result[i], expected_result[i]);
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
// PushRight, Length, Index, Range
|
||||
TEST(RedisListsTest, SimpleTest) {
|
||||
@@ -738,6 +743,7 @@ TEST(RedisListsTest, PersistenceMultiKeyTest) {
|
||||
/// THE manual REDIS TEST begins here
|
||||
/// THIS WILL ONLY OCCUR IF YOU RUN: ./redis_test -m
|
||||
|
||||
namespace {
|
||||
void MakeUpper(std::string* const s) {
|
||||
int len = s->length();
|
||||
for(int i=0; i<len; ++i) {
|
||||
@@ -842,6 +848,7 @@ int manual_redis_test(bool destructive){
|
||||
}
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
} // namespace rocksdb
|
||||
|
||||
@@ -851,6 +858,7 @@ int manual_redis_test(bool destructive){
|
||||
// "./redis_test -m -d" for destructive manual test (erase db before use)
|
||||
|
||||
|
||||
namespace {
|
||||
// Check for "want" argument in the argument list
|
||||
bool found_arg(int argc, char* argv[], const char* want){
|
||||
for(int i=1; i<argc; ++i){
|
||||
@@ -860,6 +868,7 @@ bool found_arg(int argc, char* argv[], const char* want){
|
||||
}
|
||||
return false;
|
||||
}
|
||||
} // namespace
|
||||
|
||||
// Will run unit tests.
|
||||
// However, if -m is specified, it will do user manual/interactive testing
|
||||
|
||||
Reference in New Issue
Block a user