Discussion:
Valgrind: r16286 - /trunk/memcheck/tests/unit_oset.c
(too old to reply)
s***@valgrind.org
2017-03-24 02:07:14 UTC
Permalink
Raw Message
Author: bart
Date: Fri Mar 24 02:07:14 2017
New Revision: 16286

Log:
memcheck/tests/unit_oset.c: Fix compiler warnings

Avoid that the compiler warns about using the result of an assignment
as a truth value.

Modified:
trunk/memcheck/tests/unit_oset.c

Modified: trunk/memcheck/tests/unit_oset.c
==============================================================================
--- trunk/memcheck/tests/unit_oset.c (original)
+++ trunk/memcheck/tests/unit_oset.c Fri Mar 24 02:07:14 2017
@@ -208,7 +208,8 @@
// 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 @@

// 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 @@
// 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] );
}

Loading...