[GIT] ppl/ppl(master): Avoid implicit conversion from boolean to integral.

Module: ppl/ppl Branch: master Commit: b623cb806b22deb707f97a29995a26d464f5ba15 URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=b623cb806b22d...
Author: Enea Zaffanella zaffanella@cs.unipr.it Date: Mon Mar 12 11:39:12 2012 +0100
Avoid implicit conversion from boolean to integral. Detected by ECLAIR service utypflag.
---
interfaces/C/ppl_interface_generator_c_cc_code.m4 | 6 +++--- interfaces/Prolog/SWI/swi_cfli.hh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/interfaces/C/ppl_interface_generator_c_cc_code.m4 b/interfaces/C/ppl_interface_generator_c_cc_code.m4 index 478a36a..387cf2c 100644 --- a/interfaces/C/ppl_interface_generator_c_cc_code.m4 +++ b/interfaces/C/ppl_interface_generator_c_cc_code.m4 @@ -275,7 +275,7 @@ ppl_@CLASS@_frequency Coefficient& pfreq_d = *to_nonconst(freq_d); Coefficient& pval_n = *to_nonconst(val_n); Coefficient& pval_d = *to_nonconst(val_d); - return pph.frequency(lle, pfreq_n, pfreq_d, pval_n, pval_d); + return pph.frequency(lle, pfreq_n, pfreq_d, pval_n, pval_d) ? 1 : 0; } CATCH_ALL
@@ -1237,7 +1237,7 @@ ppl_termination_test_@TERMINATION_ID@_@TOPOLOGY@@CLASS@ (ppl_const_@CLASS@_t pset) try { const @TOPOLOGY@@CPP_CLASS@& ppset = *static_cast<const @TOPOLOGY@@CPP_CLASS@*>(to_const(pset)); - return termination_test_@TERMINATION_ID@(ppset); + return termination_test_@TERMINATION_ID@(ppset) ? 1 : 0; } CATCH_ALL
@@ -1252,7 +1252,7 @@ ppl_termination_test_@TERMINATION_ID@_@TOPOLOGY@@CLASS@_2 = *static_cast<const @TOPOLOGY@@CPP_CLASS@*>(to_const(pset_before)); const @TOPOLOGY@@CPP_CLASS@& ppset_after = *static_cast<const @TOPOLOGY@@CPP_CLASS@*>(to_const(pset_after)); - return termination_test_@TERMINATION_ID@_2(ppset_before, ppset_after); + return termination_test_@TERMINATION_ID@_2(ppset_before, ppset_after) ? 1 : 0; } CATCH_ALL
diff --git a/interfaces/Prolog/SWI/swi_cfli.hh b/interfaces/Prolog/SWI/swi_cfli.hh index 9581096..414d1f4 100644 --- a/interfaces/Prolog/SWI/swi_cfli.hh +++ b/interfaces/Prolog/SWI/swi_cfli.hh @@ -294,7 +294,7 @@ Prolog_is_compound(Prolog_term_ref t) { */ inline int Prolog_is_cons(Prolog_term_ref t) { - return !PL_is_atom(t) && PL_is_list(t); + return (!PL_is_atom(t) && PL_is_list(t)) ? 1 : 0; }
/*!
participants (1)
-
Enea Zaffanella