[PPL-devel] [GIT] ppl/ppl(master): Prefer explicit tests against zero.
Enea Zaffanella
zaffanella at cs.unipr.it
Wed Feb 15 23:10:27 CET 2012
Module: ppl/ppl
Branch: master
Commit: 7c9fe958cb324b418ed19bba5ba6d99fba169cfe
URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=7c9fe958cb324b418ed19bba5ba6d99fba169cfe
Author: Enea Zaffanella <zaffanella at cs.unipr.it>
Date: Wed Feb 15 22:47:35 2012 +0100
Prefer explicit tests against zero.
Detected by ECLAIR service utypflag.
---
src/Grid_Status.inlines.hh | 2 +-
src/Result.inlines.hh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Grid_Status.inlines.hh b/src/Grid_Status.inlines.hh
index 1539605..935217a 100644
--- a/src/Grid_Status.inlines.hh
+++ b/src/Grid_Status.inlines.hh
@@ -43,7 +43,7 @@ Grid::Status::test_all(flags_t mask) const {
inline bool
Grid::Status::test_any(flags_t mask) const {
- return flags & mask;
+ return (flags & mask) != 0;
}
inline void
diff --git a/src/Result.inlines.hh b/src/Result.inlines.hh
index 4f0a97f..36e754d 100644
--- a/src/Result.inlines.hh
+++ b/src/Result.inlines.hh
@@ -71,7 +71,7 @@ result_overflow(Result r) {
inline bool
result_representable(Result r) {
- return !(r & V_UNREPRESENTABLE);
+ return (r & V_UNREPRESENTABLE) == 0;
}
inline Result operator|(Result a, Result b) {
More information about the PPL-devel
mailing list