[GIT] ppl/ppl(master): Added an assert(false) for unreachable code.
Module: ppl/ppl Branch: master Commit: 1734ba44f5b535206d0642daa5fef274eb7b19aa URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=1734ba44f5b53... Author: Abramo Bagnara <abramo.bagnara@gmail.com> Date: Fri May 15 16:23:19 2009 +0200 Added an assert(false) for unreachable code. --- src/checked_int.inlines.hh | 2 ++ src/checked_mpz.inlines.hh | 2 ++ 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/checked_int.inlines.hh b/src/checked_int.inlines.hh index 8b9e75c..43557e5 100644 --- a/src/checked_int.inlines.hh +++ b/src/checked_int.inlines.hh @@ -515,6 +515,8 @@ assign_int_float(To& to, const From from, Rounding_Dir dir) { return round_lt_int<To_Policy>(to, dir); if (from > i_from) return round_gt_int<To_Policy>(to, dir); + assert(false); + return V_NAN; } PPL_SPECIALIZE_ASSIGN(assign_int_float, signed char, float) diff --git a/src/checked_mpz.inlines.hh b/src/checked_mpz.inlines.hh index 5ba5433..2272c57 100644 --- a/src/checked_mpz.inlines.hh +++ b/src/checked_mpz.inlines.hh @@ -280,6 +280,8 @@ assign_mpz_float(mpz_class& to, const From from, Rounding_Dir dir) { return round_lt_mpz<To_Policy>(to, dir); if (from > i_from) return round_gt_mpz<To_Policy>(to, dir); + assert(false); + return V_NAN; } PPL_SPECIALIZE_ASSIGN(assign_mpz_float, mpz_class, float)
participants (1)
-
Abramo Bagnara