diff options
author | Sean McBride <sean@rogue-research.com> | 2021-10-18 10:01:05 -0400 |
---|---|---|
committer | Sean McBride <sean@rogue-research.com> | 2021-10-25 12:27:09 -0400 |
commit | 1cf14f8c03be76f39e60ccad5049a6f2cd00aa04 (patch) | |
tree | 1cdcd647478e605952ddf4e1f1591715384e3c2c /Tests | |
parent | 319944b3d289871c4cd21ee11aba1f5785d4b626 (diff) | |
download | cmake-1cf14f8c03be76f39e60ccad5049a6f2cd00aa04.tar.gz |
Source: fix many -Wmissing-prototypes warnings by marking functions static
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLib/testCTestBinPacker.cxx | 2 | ||||
-rw-r--r-- | Tests/CMakeLib/testCTestResourceAllocator.cxx | 8 | ||||
-rw-r--r-- | Tests/CMakeLib/testCTestResourceGroups.cxx | 2 | ||||
-rw-r--r-- | Tests/CMakeLib/testOptional.cxx | 14 | ||||
-rw-r--r-- | Tests/CMakeLib/testRST.cxx | 3 | ||||
-rw-r--r-- | Tests/CMakeLib/testUVProcessChain.cxx | 18 | ||||
-rw-r--r-- | Tests/CMakeLib/testUVProcessChainHelper.cxx | 2 | ||||
-rw-r--r-- | Tests/CMakeLib/testUVStreambuf.cxx | 17 |
8 files changed, 36 insertions, 30 deletions
diff --git a/Tests/CMakeLib/testCTestBinPacker.cxx b/Tests/CMakeLib/testCTestBinPacker.cxx index abdbefb231..772f41715d 100644 --- a/Tests/CMakeLib/testCTestBinPacker.cxx +++ b/Tests/CMakeLib/testCTestBinPacker.cxx @@ -224,7 +224,7 @@ static const std::vector<AllocationComparison> comparisons{ /* clang-format on */ }; -bool TestExpectedPackResult(const ExpectedPackResult& expected) +static bool TestExpectedPackResult(const ExpectedPackResult& expected) { std::vector<cmCTestBinPackerAllocation> roundRobinAllocations; roundRobinAllocations.reserve(expected.SlotsNeeded.size()); diff --git a/Tests/CMakeLib/testCTestResourceAllocator.cxx b/Tests/CMakeLib/testCTestResourceAllocator.cxx index 33d6b913df..72e06e5d40 100644 --- a/Tests/CMakeLib/testCTestResourceAllocator.cxx +++ b/Tests/CMakeLib/testCTestResourceAllocator.cxx @@ -12,7 +12,7 @@ static const cmCTestResourceSpec spec{ { { /* clang-format on */ } } }; -bool testInitializeFromResourceSpec() +static bool testInitializeFromResourceSpec() { bool retval = true; @@ -39,7 +39,7 @@ bool testInitializeFromResourceSpec() return retval; } -bool testAllocateResource() +static bool testAllocateResource() { bool retval = true; @@ -216,7 +216,7 @@ bool testAllocateResource() return retval; } -bool testDeallocateResource() +static bool testDeallocateResource() { bool retval = true; @@ -370,7 +370,7 @@ bool testDeallocateResource() return retval; } -bool testResourceFree() +static bool testResourceFree() { bool retval = true; diff --git a/Tests/CMakeLib/testCTestResourceGroups.cxx b/Tests/CMakeLib/testCTestResourceGroups.cxx index c3532a68d7..776d65d956 100644 --- a/Tests/CMakeLib/testCTestResourceGroups.cxx +++ b/Tests/CMakeLib/testCTestResourceGroups.cxx @@ -104,7 +104,7 @@ static const std::vector<ExpectedParseResult> expectedResults{ /* clang-format on */ }; -bool TestExpectedParseResult(const ExpectedParseResult& expected) +static bool TestExpectedParseResult(const ExpectedParseResult& expected) { std::vector<std::vector<cmCTestTestHandler::cmCTestTestResourceRequirement>> result; diff --git a/Tests/CMakeLib/testOptional.cxx b/Tests/CMakeLib/testOptional.cxx index 9d4b72aa42..2007fffc49 100644 --- a/Tests/CMakeLib/testOptional.cxx +++ b/Tests/CMakeLib/testOptional.cxx @@ -116,7 +116,7 @@ public: # define END_IGNORE_UNINITIALIZED #endif -void swap(EventLogger& e1, EventLogger& e2) +static void swap(EventLogger& e1, EventLogger& e2) { BEGIN_IGNORE_UNINITIALIZED events.push_back({ Event::SWAP, &e1, &e2, e2.Value }); @@ -180,37 +180,37 @@ EventLogger& EventLogger::operator=(int value) return *this; } -bool operator==(const EventLogger& lhs, const EventLogger& rhs) +static bool operator==(const EventLogger& lhs, const EventLogger& rhs) { events.push_back({ Event::COMPARE_EE_EQ, &lhs, &rhs, lhs.Value }); return lhs.Value == rhs.Value; } -bool operator!=(const EventLogger& lhs, const EventLogger& rhs) +static bool operator!=(const EventLogger& lhs, const EventLogger& rhs) { events.push_back({ Event::COMPARE_EE_NE, &lhs, &rhs, lhs.Value }); return lhs.Value != rhs.Value; } -bool operator<(const EventLogger& lhs, const EventLogger& rhs) +static bool operator<(const EventLogger& lhs, const EventLogger& rhs) { events.push_back({ Event::COMPARE_EE_LT, &lhs, &rhs, lhs.Value }); return lhs.Value < rhs.Value; } -bool operator<=(const EventLogger& lhs, const EventLogger& rhs) +static bool operator<=(const EventLogger& lhs, const EventLogger& rhs) { events.push_back({ Event::COMPARE_EE_LE, &lhs, &rhs, lhs.Value }); return lhs.Value <= rhs.Value; } -bool operator>(const EventLogger& lhs, const EventLogger& rhs) +static bool operator>(const EventLogger& lhs, const EventLogger& rhs) { events.push_back({ Event::COMPARE_EE_GT, &lhs, &rhs, lhs.Value }); return lhs.Value > rhs.Value; } -bool operator>=(const EventLogger& lhs, const EventLogger& rhs) +static bool operator>=(const EventLogger& lhs, const EventLogger& rhs) { events.push_back({ Event::COMPARE_EE_GE, &lhs, &rhs, lhs.Value }); return lhs.Value >= rhs.Value; diff --git a/Tests/CMakeLib/testRST.cxx b/Tests/CMakeLib/testRST.cxx index 28d80a5f61..77f2a662af 100644 --- a/Tests/CMakeLib/testRST.cxx +++ b/Tests/CMakeLib/testRST.cxx @@ -8,7 +8,8 @@ #include "cmRST.h" #include "cmSystemTools.h" -void reportLine(std::ostream& os, bool ret, std::string const& line, bool eol) +static void reportLine(std::ostream& os, bool ret, std::string const& line, + bool eol) { if (ret) { os << "\"" << line << "\" (" << (eol ? "with EOL" : "without EOL") << ")"; diff --git a/Tests/CMakeLib/testUVProcessChain.cxx b/Tests/CMakeLib/testUVProcessChain.cxx index a003205c2d..c924083eb4 100644 --- a/Tests/CMakeLib/testUVProcessChain.cxx +++ b/Tests/CMakeLib/testUVProcessChain.cxx @@ -64,14 +64,15 @@ bool operator==(const cmUVProcessChain::Status* actual, return true; } -bool resultsMatch(const std::vector<const cmUVProcessChain::Status*>& actual, - const std::vector<ExpectedStatus>& expected) +static bool resultsMatch( + const std::vector<const cmUVProcessChain::Status*>& actual, + const std::vector<ExpectedStatus>& expected) { return actual.size() == expected.size() && std::equal(actual.begin(), actual.end(), expected.begin()); } -std::string getInput(std::istream& input) +static std::string getInput(std::istream& input) { char buffer[1024]; std::ostringstream str; @@ -103,8 +104,9 @@ std::ostream& operator<<( return func(stream); } -void printResults(const std::vector<const cmUVProcessChain::Status*>& actual, - const std::vector<ExpectedStatus>& expected) +static void printResults( + const std::vector<const cmUVProcessChain::Status*>& actual, + const std::vector<ExpectedStatus>& expected) { std::cout << "Expected: " << std::endl; for (auto const& e : expected) { @@ -129,8 +131,8 @@ void printResults(const std::vector<const cmUVProcessChain::Status*>& actual, } } -bool checkExecution(cmUVProcessChainBuilder& builder, - std::unique_ptr<cmUVProcessChain>& chain) +static bool checkExecution(cmUVProcessChainBuilder& builder, + std::unique_ptr<cmUVProcessChain>& chain) { std::vector<const cmUVProcessChain::Status*> status; @@ -171,7 +173,7 @@ bool checkExecution(cmUVProcessChainBuilder& builder, return true; } -bool checkOutput(std::istream& outputStream, std::istream& errorStream) +static bool checkOutput(std::istream& outputStream, std::istream& errorStream) { std::string output = getInput(outputStream); if (output != "HELO WRD!") { diff --git a/Tests/CMakeLib/testUVProcessChainHelper.cxx b/Tests/CMakeLib/testUVProcessChainHelper.cxx index 9c258342eb..bc0ef8e8e9 100644 --- a/Tests/CMakeLib/testUVProcessChainHelper.cxx +++ b/Tests/CMakeLib/testUVProcessChainHelper.cxx @@ -7,7 +7,7 @@ #include <string> #include <thread> -std::string getStdin() +static std::string getStdin() { char buffer[1024]; std::ostringstream str; diff --git a/Tests/CMakeLib/testUVStreambuf.cxx b/Tests/CMakeLib/testUVStreambuf.cxx index b86ed76ea1..760fa29e0e 100644 --- a/Tests/CMakeLib/testUVStreambuf.cxx +++ b/Tests/CMakeLib/testUVStreambuf.cxx @@ -15,9 +15,10 @@ #define TEST_STR_LINE_3 "with libuv's uv_stream_t." #define TEST_STR TEST_STR_LINE_1 "\n" TEST_STR_LINE_2 "\n" TEST_STR_LINE_3 -bool writeDataToStreamPipe(uv_loop_t& loop, cm::uv_pipe_ptr& inputPipe, - char* outputData, unsigned int outputDataLength, - const char* /* unused */) +static bool writeDataToStreamPipe(uv_loop_t& loop, cm::uv_pipe_ptr& inputPipe, + char* outputData, + unsigned int outputDataLength, + const char* /* unused */) { int err; @@ -66,9 +67,11 @@ bool writeDataToStreamPipe(uv_loop_t& loop, cm::uv_pipe_ptr& inputPipe, return true; } -bool writeDataToStreamProcess(uv_loop_t& loop, cm::uv_pipe_ptr& inputPipe, - char* outputData, unsigned int /* unused */, - const char* cmakeCommand) +static bool writeDataToStreamProcess(uv_loop_t& loop, + cm::uv_pipe_ptr& inputPipe, + char* outputData, + unsigned int /* unused */, + const char* cmakeCommand) { int err; @@ -130,7 +133,7 @@ bool writeDataToStreamProcess(uv_loop_t& loop, cm::uv_pipe_ptr& inputPipe, return true; } -bool testUVStreambufRead( +static bool testUVStreambufRead( bool (*cb)(uv_loop_t& loop, cm::uv_pipe_ptr& inputPipe, char* outputData, unsigned int outputDataLength, const char* cmakeCommand), const char* cmakeCommand) |