From a4841e12c0e3865a585774b118e7b9840bc1b253 Mon Sep 17 00:00:00 2001 From: KWSys Upstream Date: Mon, 14 Jan 2019 07:36:32 -0500 Subject: KWSys 2019-01-14 (1541d849) Code extracted from: https://gitlab.kitware.com/utils/kwsys.git at commit 1541d8496d0ae0e7c10eabcedb55db95f72afa4a (master). Upstream Shortlog ----------------- Sean McBride (1): f44cbf93 Fixed clang -Wextra-semi-stmt warnings --- ProcessUNIX.c | 2 +- testCommandLineArguments.cxx | 35 ++++++++++++++++++----------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/ProcessUNIX.c b/ProcessUNIX.c index 094c2ee..f65690b 100644 --- a/ProcessUNIX.c +++ b/ProcessUNIX.c @@ -1162,7 +1162,7 @@ static int kwsysProcessWaitForPipe(kwsysProcess* cp, char** data, int* length, case KWSYSPE_PIPE_STDERR: wd->PipeId = kwsysProcess_Pipe_STDERR; break; - }; + } return 1; } } else if (n < 0 && errno == EAGAIN) { diff --git a/testCommandLineArguments.cxx b/testCommandLineArguments.cxx index ef87436..15f9c02 100644 --- a/testCommandLineArguments.cxx +++ b/testCommandLineArguments.cxx @@ -165,25 +165,26 @@ int testCommandLineArguments(int argc, char* argv[]) } size_t cc; #define CompareTwoLists(list1, list_valid, lsize) \ - if (list1.size() != lsize) { \ - std::cerr << "Problem setting " #list1 ". Size is: " << list1.size() \ - << " should be: " << lsize << std::endl; \ - res = 1; \ - } else { \ - std::cout << #list1 " argument set:"; \ - for (cc = 0; cc < lsize; ++cc) { \ - std::cout << " " << list1[cc]; \ - if (!CompareTwoItemsOnList(list1[cc], list_valid[cc])) { \ - std::cerr << "Problem setting " #list1 ". Value of " << cc \ - << " is: [" << list1[cc] << "] <> [" << list_valid[cc] \ - << "]" << std::endl; \ - res = 1; \ - break; \ + do { \ + if (list1.size() != lsize) { \ + std::cerr << "Problem setting " #list1 ". Size is: " << list1.size() \ + << " should be: " << lsize << std::endl; \ + res = 1; \ + } else { \ + std::cout << #list1 " argument set:"; \ + for (cc = 0; cc < lsize; ++cc) { \ + std::cout << " " << list1[cc]; \ + if (!CompareTwoItemsOnList(list1[cc], list_valid[cc])) { \ + std::cerr << "Problem setting " #list1 ". Value of " << cc \ + << " is: [" << list1[cc] << "] <> [" << list_valid[cc] \ + << "]" << std::endl; \ + res = 1; \ + break; \ + } \ } \ + std::cout << std::endl; \ } \ - std::cout << std::endl; \ - } - + } while (0) CompareTwoLists(numbers_argument, valid_numbers, 10); CompareTwoLists(doubles_argument, valid_doubles, 3); CompareTwoLists(bools_argument, valid_bools, 3); -- cgit v0.12