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



commit 63c7d7cf3b0f0916bc0b3a4ab86fefc68fc140b4
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 |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/tests/test_selfhosting_new_then_image.cc b/tests/test_selfhosting_new_then_image.cc
index 6ca7f54..1b04646 100644
--- a/tests/test_selfhosting_new_then_image.cc
+++ b/tests/test_selfhosting_new_then_image.cc
@@ -66,8 +66,8 @@ static bool test(Glom::Document::HostingMode hosting_mode)
   const Glib::RefPtr<const Gnome::Gda::SqlBuilder> builder_set = 
     Glom::Utils::build_sql_update_with_where_clause(table_name,
       field, value_set, where_clause);
-  const int rows_affected = Glom::DbUtils::query_execute(builder_set);
-  if(rows_affected == -1)
+  const bool rows_affected = Glom::DbUtils::query_execute(builder_set);
+  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]