[GIT] ppl/ppl(master): Prefer explicit tests against zero.

Module: ppl/ppl Branch: master Commit: ed45790955fc4f20ef69774b573dd8b505a71d78 URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=ed45790955fc4...
Author: Enea Zaffanella zaffanella@cs.unipr.it Date: Sat Feb 25 10:15:43 2012 +0100
Prefer explicit tests against zero. Detected by ECLAIR service utypflag.
---
src/globals.defs.hh | 4 ++-- src/globals.inlines.hh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/globals.defs.hh b/src/globals.defs.hh index 314194d..2c54772 100644 --- a/src/globals.defs.hh +++ b/src/globals.defs.hh @@ -175,12 +175,12 @@ extern unsigned int in_assert; #define WEIGHT_BEGIN() #define WEIGHT_ADD(delta) \ do { \ - if (!Implementation::in_assert) \ + if (Implementation::in_assert == 0) \ Weightwatch_Traits::weight += delta; \ } while (false) #define WEIGHT_ADD_MUL(delta, factor) \ do { \ - if (!Implementation::in_assert) \ + if (Implementation::in_assert == 0) \ Weightwatch_Traits::weight += delta * factor; \ } while (false) #endif diff --git a/src/globals.inlines.hh b/src/globals.inlines.hh index 09936ec..d176bb0 100644 --- a/src/globals.inlines.hh +++ b/src/globals.inlines.hh @@ -64,7 +64,7 @@ Throwable::~Throwable() { inline void maybe_abandon() { #ifndef NDEBUG - if (Implementation::in_assert) + if (Implementation::in_assert != 0) return; #endif if (Weightwatch_Traits::check_function != 0)
participants (1)
-
Enea Zaffanella