[glom] Avoid a comparison of bool with -1.



commit a908481b63c99caa71bc7c4567833a585674936b
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Oct 26 14:14:44 2015 +0100

    Avoid a comparison of bool with -1.
    
    This seems to be a (useful) new check in g++ 5.2.

 tests/test_selfhosting_new_then_image.cc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/tests/test_selfhosting_new_then_image.cc b/tests/test_selfhosting_new_then_image.cc
index ef938e7..4ff886f 100644
--- a/tests/test_selfhosting_new_then_image.cc
+++ b/tests/test_selfhosting_new_then_image.cc
@@ -67,7 +67,7 @@ static bool test(Glom::Document::HostingMode hosting_mode)
     Glom::Utils::build_sql_update_with_where_clause(table_name,
       field, value_set, where_clause);
   const auto rows_affected = Glom::DbUtils::query_execute(builder_set);
-  if(rows_affected == -1)
+  if(!rows_affected)
   {
     std::cerr << G_STRFUNC << ": Failure: UPDATE failed." << std::endl;
     return false;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]