Index: integre/ChangeLog
from Nicolas Burrus <burrus_n(a)lrde.epita.fr>
* ntg/enum/bin.hh: Fix assignment from a real_value.
Index: tools/swilena/ChangeLog
from Nicolas Burrus <burrus_n(a)epita.fr>
* meta/swilena_ntg_macros.i: New.
* meta/swilena_ntg.i: Include it.
Index: tools/swilena/meta/swilena_ntg.i
--- tools/swilena/meta/swilena_ntg.i Thu, 09 Oct 2003 16:21:55 +0200 burrus_n
(oln/s/33_swilena_nt 1.6 640)
+++ tools/swilena/meta/swilena_ntg.i Mon, 10 Nov 2003 11:19:49 +0100 burrus_n
(oln/s/33_swilena_nt 1.7 640)
@@ -1,7 +1,6 @@
%module swilena_ntg
%include swilena_exception.i
-
/***** Generic class declaration for scalars ******/
/* Predecls */
@@ -225,32 +224,17 @@
everywhere. ntg_uint is just a convenient macro.
*/
-#define ntg_bin ntg::bin
-#define ntg_bin_value bool
+%include swilena_ntg_macros.i
%template(int_u32) ntg::int_u< 32, ntg::strict >;
-#define ntg_int_u32 ntg::int_u< 32, ntg::strict >
-#define ntg_int_u32_value unsigned long
%template(int_s32) ntg::int_s< 32, ntg::strict >;
-#define ntg_int_s32 ntg::int_s< 32, ntg::strict >
-#define ntg_int_s32_value long
%template(int_u8) ntg::int_u< 8, ntg::strict >;
-#define ntg_int_u8 ntg::int_u< 8, ntg::strict >
-#define ntg_int_u8_value unsigned long
%template(int_s8) ntg::int_s< 8, ntg::strict >;
-#define ntg_int_s8 ntg::int_s< 8, ntg::strict >
-#define ntg_int_s8_value long
-
-#define ntg_float ntg::float_d
-#define ntg_float_value ntg_float
%template(cplx_rect) ntg::cplx< ntg::rect, ntg_float >;
-#define ntg_cplx_rect ntg::cplx< ntg::rect, ntg_float >
-#define ntg_cplx_rect_value ntg_cplx_rect
%template(cplx_polar) ntg::cplx< ntg::polar, ntg_float >;
-#define ntg_cplx_polar ntg::cplx< ntg::polar, ntg_float >
-#define ntg_cplx_polar_value ntg_cplx_polar
+
Index: integre/ntg/enum/bin.hh
--- integre/ntg/enum/bin.hh Thu, 24 Jul 2003 17:46:03 +0200 burrus_n (oln/t/21_bin.hh 1.4
640)
+++ integre/ntg/enum/bin.hh Mon, 10 Nov 2003 11:19:49 +0100 burrus_n (oln/t/21_bin.hh 1.5
640)
@@ -105,14 +105,14 @@
bin (const real_value<T>& val)
{
ntg_assert(val < 2);
- this->val_ = val;
+ this->val_ = val.val();
}
template <class T>
bin&
operator=(const real_value<T>& val)
{
ntg_assert(val < 2);
- this->val_ = val;
+ this->val_ = val.val();
return *this;
}
Index: tools/swilena/meta/swilena_ntg_macros.i
--- tools/swilena/meta/swilena_ntg_macros.i Mon, 10 Nov 2003 14:13:46 +0100 burrus_n ()
+++ tools/swilena/meta/swilena_ntg_macros.i Mon, 10 Nov 2003 11:19:49 +0100 burrus_n
(oln/v/39_swilena_nt 1.1 600)
@@ -0,0 +1,57 @@
+// FIXME: avoid code repetitions!
+
+#define ntg_bin ntg::bin
+#define ntg_bin_value bool
+%inline %{
+#define ntg_bin ntg::bin
+#define ntg_bin_value bool
+%}
+
+#define ntg_int_u32 ntg::int_u< 32, ntg::strict >
+#define ntg_int_u32_value unsigned long
+%inline %{
+#define ntg_int_u32 ntg::int_u< 32, ntg::strict >
+#define ntg_int_u32_value unsigned long
+%}
+
+#define ntg_int_s32 ntg::int_s< 32, ntg::strict >
+#define ntg_int_s32_value long
+%inline %{
+#define ntg_int_s32 ntg::int_s< 32, ntg::strict >
+#define ntg_int_s32_value long
+%}
+
+#define ntg_int_u8 ntg::int_u< 8, ntg::strict >
+#define ntg_int_u8_value unsigned long
+%inline %{
+#define ntg_int_u8 ntg::int_u< 8, ntg::strict >
+#define ntg_int_u8_value unsigned long
+%}
+
+#define ntg_int_s8 ntg::int_s< 8, ntg::strict >
+#define ntg_int_s8_value long
+%inline %{
+#define ntg_int_s8 ntg::int_s< 8, ntg::strict >
+#define ntg_int_s8_value long
+%}
+
+#define ntg_float ntg::float_d
+#define ntg_float_value ntg_float
+%inline %{
+#define ntg_float ntg::float_d
+#define ntg_float_value ntg_float
+%}
+
+#define ntg_cplx_rect ntg::cplx< ntg::rect, ntg_float >
+#define ntg_cplx_rect_value ntg_cplx_rect
+%inline %{
+#define ntg_cplx_rect ntg::cplx< ntg::rect, ntg_float >
+#define ntg_cplx_rect_value ntg_cplx_rect
+%}
+
+#define ntg_cplx_polar ntg::cplx< ntg::polar, ntg_float >
+#define ntg_cplx_polar_value ntg_cplx_polar
+%inline %{
+#define ntg_cplx_polar ntg::cplx< ntg::polar, ntg_float >
+#define ntg_cplx_polar_value ntg_cplx_polar
+%}