* mln/value/interval.hh,
* mln/world/k2/converters.hh: Here.
---
milena/ChangeLog | 14 ++++++++++++++
milena/mln/value/interval.hh | 3 ++-
milena/mln/world/k2/converters.hh | 9 ++++++---
3 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index b248164..6433185 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,19 @@
2012-10-19 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Force abort() on unsafe conversions.
+
+ * mln/value/interval.hh,
+ * mln/world/k2/converters.hh: Here.
+
+2012-10-19 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Force abort() on unsafe conversions.
+
+ mln/value/interval.hh,
+ mln/world/k2/converters.hh: Here.
+
+2012-10-19 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Refine util::level operators.
* mln/util/level.hh: Add comparison operators with images.
diff --git a/milena/mln/value/interval.hh b/milena/mln/value/interval.hh
index d3cbbdd..a7cafc7 100644
--- a/milena/mln/value/interval.hh
+++ b/milena/mln/value/interval.hh
@@ -313,7 +313,8 @@ namespace mln
void
interval<T>::self_open()
{
- mln_precondition(! is_degenerated());
+ if (is_degenerated())
+ abort();
mln_precondition(nvalues_ > 2);
first += iota<T>::value();
diff --git a/milena/mln/world/k2/converters.hh b/milena/mln/world/k2/converters.hh
index de76087..0988326 100644
--- a/milena/mln/world/k2/converters.hh
+++ b/milena/mln/world/k2/converters.hh
@@ -166,7 +166,8 @@ namespace mln
int
interval_intsub_n_to_int<n>::operator()(const interval<intsub<n>
>& from) const
{
- mln_precondition(from.is_degenerated());
+ if (!from.is_degenerated())
+ abort();
return from.first();
}
@@ -181,7 +182,8 @@ namespace mln
value::int_u8
interval_intsub_n_to_int_u8<n>::operator()(const interval<intsub<n>
>& from) const
{
- mln_precondition(from.is_degenerated());
+ if (!from.is_degenerated())
+ abort();
return from.first().to_interop();
}
@@ -196,7 +198,8 @@ namespace mln
intsub<n/2>
interval_intsub_n_to_intsub_n_2<n>::operator()(const
interval<intsub<n> >& from) const
{
- mln_precondition(from.is_degenerated());
+ if (!from.is_degenerated())
+ abort();
return from.first().to_interop();
}
--
1.7.2.5
Show replies by date