Roland Levillain <roland(a)lrde.epita.fr> writes:
> Thierry GERAUD <theo(a)lrde.epita.fr> writes:
>
>> Index: oln/core/abstract/image.hh
>> ===================================================================
>> --- oln/core/abstract/image.hh (revision 526)
>> +++ oln/core/abstract/image.hh (working copy)
>> @@ -29,216 +29,11 @@
>
> [...]
>
>> + /// Typedefs.
>> + typedef oln_type_of(E, topo) topo_t;
>> + typedef oln_type_of(E, psite) psite_t;
>> + typedef oln_type_of(E, rvalue) rvalue_t;
>
> Shouldn't we use type names ending in `_type', rather than `_t', in
> accordance with
>
> https://olena.lrde.epita.fr/cgi-bin/twiki/view/Olena/CodingStyle
>
> ?
We've discussed this point with Théo; he said names ending in `_type'
are for public types, while the ones ending in `_t' are for private
types. That makes sense to me, so I suggest sticking to this
convention.
(BTW, we have to create a new coding style for Olena 1.0 on the Wiki,
derived from Olena 0.10's.)
I haven't checked whether this bug has been fixed in SWIG's
Subversion repository yet (but it wasn't present in SWIG 1.3.28).
2006-07-04 Roland Levillain <roland(a)lrde.epita.fr>
Work around a bug in SWIG 1.3.29.
* generate_arith_instantiations.py (write_algorithms)
* generate_morpho_instantiations.py (write_algorithms): Work
around a bug in SWIG 1.3.29 in the generation of C++ wrappers.
Index: 10.229/tools/swilena/generate_morpho_instantiations.py
--- 10.229/tools/swilena/generate_morpho_instantiations.py Fri, 30 Jun 2006 17:26:15 +0200 levill_r (oln/v/24_generate_m 1.8.1.1 700)
+++ 10.229(w)/tools/swilena/generate_morpho_instantiations.py Mon, 03 Jul 2006 12:23:42 +0200 levill_r (oln/v/24_generate_m 1.8.1.1 700)
@@ -57,7 +57,13 @@
"ntg_int_u8", "ntg_int_u32",
"ntg_int_s8", "ntg_int_s32",
"ntg_float" ]:
- img_type = "::oln::image%(dim)sd< %(type)s >" % vars()
+ # FIXME: SWIG 1.3.29 Bug. We used to refer to `oln::image' from
+ # the global (top-level) namespace, i.e. `::oln::image',
+ # but it makes swig 1.3.29 generate invalid C++ code when
+ # used ad a template argument: the space between `<' and
+ # `::' is eaten by swig, and `<:' is understood as a
+ # trigraph (for `[') by the C++ compiler.
+ img_type = "oln::image%(dim)sd< %(type)s >" % vars()
win_type = "::oln::window%(dim)sd" % vars()
neighb_type = "::oln::neighborhood%(dim)sd" % vars()
@@ -135,10 +141,12 @@
instantiate(idx, "top_hat_contrast_op", img_type, img_type, win_type)
instantiate(idx, "fast_top_hat_contrast_op", img_type, img_type, win_type)
# Watershed
- img_ret_type = "::oln::image%(dim)sd< ntg_int_u32 >" % vars()
+ # FIXME: SWIG 1.3.29 Bug (same as above).
+ img_ret_type = "oln::image%(dim)sd< ntg_int_u32 >" % vars()
instantiate(idx, "watershed_seg", img_ret_type, img_type, neighb_type)
instantiate(idx, "watershed_con", img_ret_type, img_type, neighb_type)
- bin_img_type = "::oln::image%(dim)sd< ntg_bin >" % vars()
+ # FIXME: SWIG 1.3.29 Bug (same as above).
+ bin_img_type = "oln::image%(dim)sd< ntg_bin >" % vars()
instantiate(idx, "sure_minima_imposition", img_type, img_type, bin_img_type, neighb_type)
instantiate(idx, "sequential_minima_imposition", img_type, img_type, bin_img_type, neighb_type)
instantiate(idx, "hybrid_minima_imposition", img_type, img_type, bin_img_type, neighb_type)
Index: 10.229/tools/swilena/generate_arith_instantiations.py
--- 10.229/tools/swilena/generate_arith_instantiations.py Fri, 30 Jun 2006 17:26:15 +0200 levill_r (oln/v/51_generate_a 1.1.1.1 700)
+++ 10.229(w)/tools/swilena/generate_arith_instantiations.py Mon, 03 Jul 2006 11:44:33 +0200 levill_r (oln/v/51_generate_a 1.1.1.1 700)
@@ -59,13 +59,19 @@
"ntg_int_u8", "ntg_int_u32",
"ntg_int_s8", "ntg_int_s32",
"ntg_float" ]:
- img_type = "::oln::image%(dim)sd< %(type)s >" % vars()
+ # FIXME: SWIG 1.3.29 Bug. We used to refer to `oln::image' from
+ # the global (top-level) namespace, i.e. `::oln::image',
+ # but it makes swig 1.3.29 generate invalid C++ code when
+ # used ad a template argument: the space between `<' and
+ # `::' is eaten by swig, and `<:' is understood as a
+ # trigraph (for `[') by the C++ compiler.
+ img_type = "oln::image%(dim)sd< %(type)s >" % vars()
bigger_type = get_bigger_type(type)
- return_img_type = "::oln::image%(dim)sd< %(bigger_type)s >" % vars()
+ return_img_type = "oln::image%(dim)sd< %(bigger_type)s >" % vars()
# FIXME: these algorithms do not work with bin
if type != "ntg_bin":
- for algo in [ "plus", "minus", "times", "div" ]:
+ for algo in [ "plus", "minus", "times", "div" ]:
instantiate(dim, algo, return_img_type, img_type, img_type)
instantiate(dim, "min", return_img_type, img_type, img_type)
https://svn.lrde.epita.fr/svn/oln/trunk
Index: ChangeLog
from Roland Levillain <roland(a)lrde.epita.fr>
Create a configure variable for C++ compiler flags used for the
tests.
* configure.ac (TESTS_CXXFLAGS): New variable.
configure.ac | 7 +++++++
1 file changed, 7 insertions(+)
Index: configure.ac
--- configure.ac (revision 591)
+++ configure.ac (working copy)
@@ -32,6 +32,13 @@
CXXFLAGS="$CXXFLAGS -pipe"
fi
+# C++ compiler flags for tests.
+AC_ARG_VAR([TESTS_CXXFLAGS])
+# We want no optimization for the tests (too slow), and a lot of debugging.
+if test "$GXX" = yes && test -z "$TESTS_CXXFLAGS"; then
+ TESTS_CXXFLAGS="-O0 -ggdb -Wall -pipe"
+fi
+
## ------- ##
## Tests. ##
2006-09-29 Thierry GERAUD <theo(a)tegucigalpa.lrde.epita.fr>
Add a temporary simple version of xtd_is_binary for use in oln.
* xtd/valtraits.hh: New.
* xtd/Makefile.am (nobase_xtd_HEADERS): Update.
Index: xtd/valtraits.hh
===================================================================
--- xtd/valtraits.hh (revision 0)
+++ xtd/valtraits.hh (revision 0)
@@ -0,0 +1,61 @@
+// Copyright (C) 2006 EPITA Research and Development Laboratory
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef XTD_VALTRAITS_HH
+# define XTD_VALTRAITS_HH
+
+// # include <xtd/traits.hh>
+// # include <xtd/builtin/traits.hh>
+
+
+
+namespace xtd
+{
+
+ template <typename T>
+ struct is_binary
+ {
+ typedef mlc::false_ ret;
+ };
+
+
+ template <>
+ struct is_binary <bool>
+ {
+ typedef mlc::true_ ret;
+ };
+
+
+} // end of namespace xtd
+
+
+
+# define xtd_is_binary(T) typename xtd::is_binary<T>::ret
+
+
+
+#endif // ! XTD_VALTRAITS_HH
Index: xtd/Makefile.am
===================================================================
--- xtd/Makefile.am (revision 588)
+++ xtd/Makefile.am (working copy)
@@ -56,4 +56,5 @@
optraits.hh \
res.hh \
traits.hh \
+ valtraits.hh \
vec.hh