]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
memcheck/tests/unit_oset.c: Fix compiler warnings
authorBart Van Assche <bvanassche@acm.org>
Fri, 24 Mar 2017 02:07:14 +0000 (02:07 +0000)
committerBart Van Assche <bvanassche@acm.org>
Fri, 24 Mar 2017 02:07:14 +0000 (02:07 +0000)
Avoid that the compiler warns about using the result of an assignment
as a truth value.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16286

memcheck/tests/unit_oset.c

index eb7b34fc70a4b9f0b87c6e47b5f5dc7805a2935b..ff93398ae89bfe75eae339b67e3958c7368ec868 100644 (file)
@@ -208,7 +208,8 @@ void example1singleset(OSet* oset, char *descr)
    // Check that we can remove half of the elements, and that their values
    // are as expected.
    for (i = 0; i < NN; i += 2) {
-      assert( pv = VG_(OSetGen_Remove)(oset, vs[i]) );
+      pv = VG_(OSetGen_Remove)(oset, vs[i]);
+      assert( pv );
       assert( pv == vs[i] );
    }
 
@@ -217,7 +218,8 @@ void example1singleset(OSet* oset, char *descr)
 
    // Check we can find the remaining elements (with the right values).
    for (i = 1; i < NN; i += 2) {
-      assert( pv = VG_(OSetGen_LookupWithCmp)(oset, vs[i], NULL) );
+      pv = VG_(OSetGen_LookupWithCmp)(oset, vs[i], NULL);
+      assert( pv );
       assert( pv == vs[i] );
    }
 
@@ -229,7 +231,8 @@ void example1singleset(OSet* oset, char *descr)
    // Check that we can remove the remaining half of the elements, and that
    // their values are as expected.
    for (i = 1; i < NN; i += 2) {
-      assert( pv = VG_(OSetGen_Remove)(oset, vs[i]) );
+      pv = VG_(OSetGen_Remove)(oset, vs[i]);
+      assert( pv );
       assert( pv == vs[i] );
    }