From 57c7577fa91ffc024e5c696a91abe19f5547a787 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 3 Nov 2016 15:58:11 +0300 Subject: Fix Clang and VC warnings --- build2/test/script/runner.cxx | 6 +++++- build2/test/script/script.cxx | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'build2/test/script') diff --git a/build2/test/script/runner.cxx b/build2/test/script/runner.cxx index 29f7a37..b071cf3 100644 --- a/build2/test/script/runner.cxx +++ b/build2/test/script/runner.cxx @@ -526,7 +526,11 @@ namespace build2 // stderr (if cached), print the proper diagnostics and fail. // optional status (move (pr.status)); - bool valid_status (status && *status >= 0 && *status < 256); + + // Comparison *status >= 0 causes "always true" warning on Windows + // where process::status_type is defined as uint32_t. + // + bool valid_status (status && *status + 1 > 0 && *status < 256); bool eq (c.exit.comparison == exit_comparison::eq); bool correct_status (valid_status && diff --git a/build2/test/script/script.cxx b/build2/test/script/script.cxx index e453d44..2679cb7 100644 --- a/build2/test/script/script.cxx +++ b/build2/test/script/script.cxx @@ -433,7 +433,7 @@ namespace build2 if (const value* v = p->vars.find (var)) return lookup (v, &p->vars); } - while (p->parent != nullptr ? (p = p->parent) : nullptr); + while ((p->parent != nullptr ? (p = p->parent) : nullptr) != nullptr); // Switch to the corresponding buildfile variable. Note that we don't // want to insert a new variable into the pool (we might be running -- cgit v1.1