Index: soft/giet_vm/applications/rosenfeld/nrc2/src/nrset3.c
===================================================================
--- soft/giet_vm/applications/rosenfeld/nrc2/src/nrset3.c	(revision 772)
+++ soft/giet_vm/applications/rosenfeld/nrc2/src/nrset3.c	(revision 826)
@@ -21,212 +21,73 @@
 #include "nrset3.h"
 
-/* ------------------------------------------------------------------------------------- */
-IMAGE_EXPORT(void) zero_si8cube(sint8 ***c, int k0, int k1, int i0, int i1, int j0, int j1)
-/* ------------------------------------------------------------------------------------- */
+
+#undef zero_type_cube
+#define zero_type_cube(t) \
+void short_name(t,zero_,cube)(t *** c, int32_t k0, int32_t k1, int32_t i0, int32_t i1, int32_t j0, int32_t j1) \
+{                                                         \
+    for (int32_t k = k0; k <= k1; k++) {                  \
+        short_name(t,zero_,matrix)(c[k], i0, i1, j0, j1); \
+    }                                                     \
+}
+
+zero_type_cube(int8_t);
+zero_type_cube(uint8_t);
+zero_type_cube(int16_t);
+zero_type_cube(uint16_t);
+zero_type_cube(int32_t);
+zero_type_cube(uint32_t);
+zero_type_cube(int64_t);
+zero_type_cube(uint64_t);
+zero_type_cube(float);
+zero_type_cube(double);
+zero_type_cube(rgb8);
+zero_type_cube(rgbx8);
+
+#undef set_type_cube_param
+#define set_type_cube_param(t) \
+void short_name(t,set_,cube_param)(t *** c, int32_t k0, int32_t k1, int32_t i0, int32_t i1, int32_t j0, int32_t j1, t x, t xstep, t ystep, t zstep) \
+{                                        \
+    for (int32_t k = k0; k <= k1; k++) { \
+        short_name(t,set_,matrix_param)(c[k], i0, i1, j0, j1, x, xstep, ystep); \
+        x += zstep;                      \
+    }                                    \
+}
+
+set_type_cube_param(int8_t);
+set_type_cube_param(uint8_t);
+set_type_cube_param(int16_t);
+set_type_cube_param(uint16_t);
+set_type_cube_param(int32_t);
+set_type_cube_param(uint32_t);
+set_type_cube_param(int64_t);
+set_type_cube_param(uint64_t);
+set_type_cube_param(float);
+set_type_cube_param(double);
+
+
+void set_rgb8cube_param(rgb8 *** c, int32_t k0, int32_t k1, int32_t i0, int32_t i1, int32_t j0, int32_t j1, rgb8 x, rgb8 xstep, rgb8 ystep, rgb8 zstep)
 {
-	int k;
-	for(k=k0; k<=k1; k++) {
-		zero_si8matrix(c[k], i0, i1, j0, j1);
-	}
+    for (int32_t k = k0; k <= k1; k++) {
+        set_rgb8matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
+        RGB8_ADD(x, xstep, x);
+    }
 }
-/* ------------------------------------------------------------------------------------- */
-IMAGE_EXPORT(void) zero_ui8cube(uint8 ***c, int k0, int k1, int i0, int i1, int j0, int j1)
-/* ------------------------------------------------------------------------------------- */
+
+void set_rgbx8cube_param(rgbx8 *** c, int32_t k0, int32_t k1, int32_t i0, int32_t i1, int32_t j0, int32_t j1, rgbx8 x, rgbx8 xstep, rgbx8 ystep, rgbx8 zstep)
 {
-	int k;
-	for(k=k0; k<=k1; k++) {
-		zero_ui8matrix(c[k], i0, i1, j0, j1);
-	}
+    for (int32_t k = k0; k <= k1; k++) {
+        set_rgbx8matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
+        RGBX8_ADD(x, xstep, x);
+    }
 }
-/* --------------------------------------------------------------------------------------- */
-IMAGE_EXPORT(void) zero_si16cube(sint16 ***c, int k0, int k1, int i0, int i1, int j0, int j1)
-/* --------------------------------------------------------------------------------------- */
-{
-	int k;
-	for(k=k0; k<=k1; k++) {
-		zero_si16matrix(c[k], i0, i1, j0, j1);
-	}
-}
-/* --------------------------------------------------------------------------------------- */
-IMAGE_EXPORT(void) zero_ui16cube(uint16 ***c, int k0, int k1, int i0, int i1, int j0, int j1)
-/* --------------------------------------------------------------------------------------- */
-{
-	int k;
-	for(k=k0; k<=k1; k++) {
-		zero_ui16matrix(c[k], i0, i1, j0, j1);
-	}
-}
-/* --------------------------------------------------------------------------------------- */
-IMAGE_EXPORT(void) zero_si32cube(sint32 ***c, int k0, int k1, int i0, int i1, int j0, int j1)
-/* --------------------------------------------------------------------------------------- */
-{
-	int k;
-	for(k=k0; k<=k1; k++) {
-		zero_si32matrix(c[k], i0, i1, j0, j1);
-	}
-}
-/* ---------------------------------------------------------------------------------------- */
-IMAGE_EXPORT(void) zero_ui32cube( uint32 ***c, int k0, int k1, int i0, int i1, int j0, int j1)
-/* ---------------------------------------------------------------------------------------- */
-{
-	int k;
-	for(k=k0; k<=k1; k++) {
-		zero_ui32matrix(c[k], i0, i1, j0, j1);
-	}
-}
-/* --------------------------------------------------------------------------------------- */
-IMAGE_EXPORT(void) zero_si64cube(sint64 ***c, int k0, int k1, int i0, int i1, int j0, int j1)
-/* --------------------------------------------------------------------------------------- */
-{
-	int k;
-	for(k=k0; k<=k1; k++) {
-		zero_si64matrix(c[k], i0, i1, j0, j1);
-	}
-}
-/* --------------------------------------------------------------------------------------- */
-IMAGE_EXPORT(void) zero_ui64cube(uint64 ***c, int k0, int k1, int i0, int i1, int j0, int j1)
-/* --------------------------------------------------------------------------------------- */
-{
-	int k;
-	for(k=k0; k<=k1; k++) {
-		zero_ui64matrix(c[k], i0, i1, j0, j1);
-	}
-}
-/* --------------------------------------------------------------------------------------- */
-IMAGE_EXPORT(void) zero_f32cube(float32 ***c, int k0, int k1, int i0, int i1, int j0, int j1)
-/* --------------------------------------------------------------------------------------- */
-{
-	int k;
-	for(k=k0; k<=k1; k++) {
-		zero_f32matrix(c[k], i0, i1, j0, j1);
-	}
-}
-/* --------------------------------------------------------------------------------------- */
-IMAGE_EXPORT(void) zero_f64cube(float64 ***c, int k0, int k1, int i0, int i1, int j0, int j1)
-/* --------------------------------------------------------------------------------------- */
-{
-	int k;
-	for(k=k0; k<=k1; k++) {
-		zero_f64matrix(c[k], i0, i1, j0, j1);
-	}
-}
-/* ------------------------------------------------------------------------------------------------------------------------------------------ */
-IMAGE_EXPORT(void) set_si8cube_param(sint8 ***c, int k0, int k1, int i0, int i1, int j0, int j1, sint8 x, sint8 xstep, sint8 ystep, sint8 zstep)
-/* ------------------------------------------------------------------------------------------------------------------------------------------ */
-{
-	int k;
-	for(k=k0; k<=k1; k++) {
-		set_si8matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
-        x += zstep;
-	}
-}
-/* ------------------------------------------------------------------------------------------------------------------------------------------ */
-IMAGE_EXPORT(void) set_ui8cube_param(uint8 ***c, int k0, int k1, int i0, int i1, int j0, int j1, uint8 x, uint8 xstep, uint8 ystep, uint8 zstep)
-/* ------------------------------------------------------------------------------------------------------------------------------------------ */
-{
-    int k;
-	for(k=k0; k<=k1; k++) {
-		set_ui8matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
-        x += zstep;
-	}
-}
-/* ------------------------------------------------------------------------------------------------------------------------------------------------ */
-IMAGE_EXPORT(void) set_si16cube_param(sint16 ***c, int k0, int k1, int i0, int i1, int j0, int j1, sint16 x, sint16 xstep, sint16 ystep, sint16 zstep)
-/* ------------------------------------------------------------------------------------------------------------------------------------------------ */
-{
-	int k;
-	for(k=k0; k<=k1; k++) {
-		set_si16matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
-        x += zstep;
-	}
-}
-/* ------------------------------------------------------------------------------------------------------------------------------------------------ */
-IMAGE_EXPORT(void) set_ui16cube_param(uint16 ***c, int k0, int k1, int i0, int i1, int j0, int j1, uint16 x, uint16 xstep, uint16 ystep, uint16 zstep)
-/* ------------------------------------------------------------------------------------------------------------------------------------------------ */
-{
-	int k;
-	for(k=k0; k<=k1; k++) {
-		set_ui16matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
-        x += zstep;
-	}
-}
-/* ------------------------------------------------------------------------------------------------------------------------------------------------ */
-IMAGE_EXPORT(void) set_si32cube_param(sint32 ***c, int k0, int k1, int i0, int i1, int j0, int j1, sint32 x, sint32 xstep, sint32 ystep, sint32 zstep)
-/* ------------------------------------------------------------------------------------------------------------------------------------------------ */
-{
-	int k;
-	for(k=k0; k<=k1; k++) {
-		set_si32matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
-        x += zstep;
-	}
-}
-/* ------------------------------------------------------------------------------------------------------------------------------------------------ */
-IMAGE_EXPORT(void) set_ui32cube_param(uint32 ***c, int k0, int k1, int i0, int i1, int j0, int j1, uint32 x, uint32 xstep, uint32 ystep, uint32 zstep)
-/* ------------------------------------------------------------------------------------------------------------------------------------------------ */
-{
-	int k;
-	for(k=k0; k<=k1; k++) {
-		set_ui32matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
-        x += zstep;
-	}
-}
-/* ------------------------------------------------------------------------------------------------------------------------------------------------ */
-IMAGE_EXPORT(void) set_si64cube_param(sint64 ***c, int k0, int k1, int i0, int i1, int j0, int j1, sint64 x, sint64 xstep, sint64 ystep, sint64 zstep)
-/* ------------------------------------------------------------------------------------------------------------------------------------------------ */
-{
-	int k;
-	for(k=k0; k<=k1; k++) {
-		set_si64matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
-        x += zstep;
-	}
-}
-/* ------------------------------------------------------------------------------------------------------------------------------------------------ */
-IMAGE_EXPORT(void) set_ui64cube_param(uint64 ***c, int k0, int k1, int i0, int i1, int j0, int j1, uint64 x, uint64 xstep, uint64 ystep, uint64 zstep)
-/* ------------------------------------------------------------------------------------------------------------------------------------------------ */
-{
-	int k;
-	for(k=k0; k<=k1; k++) {
-		set_ui64matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
-        x += zstep;
-	}
-}
-/* ---------------------------------------------------------------------------------------------------------------------------------------------------- */
-IMAGE_EXPORT(void) set_f32cube_param(float32 ***c, int k0, int k1, int i0, int i1, int j0, int j1, float32 x, float32 xstep, float32 ystep, float32 zstep)
-/* ---------------------------------------------------------------------------------------------------------------------------------------------------- */
-{
-	int k;
-	for(k=k0; k<=k1; k++) {
-		set_f32matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
-        x += zstep;
-	}
-}
-/* ---------------------------------------------------------------------------------------------------------------------------------------------------- */
-IMAGE_EXPORT(void) set_f64cube_param(float64 ***c, int k0, int k1, int i0, int i1, int j0, int j1, float64 x, float64 xstep, float64 ystep, float64 zstep)
-/* ---------------------------------------------------------------------------------------------------------------------------------------------------- */
-{
-	int k;
-	for(k=k0; k<=k1; k++) {
-		set_f64matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
-        x += zstep;
-	}
-}
-/* --------------------------------------------------------------------------------------------------------------------------------------- */
-IMAGE_EXPORT(void) set_rgb8cube_param(rgb8 ***c, int k0, int k1, int i0, int i1, int j0, int j1, rgb8 x, rgb8 xstep, rgb8 ystep, rgb8 zstep)
-/* --------------------------------------------------------------------------------------------------------------------------------------- */
-{
-	int k;
-	for(k=k0; k<=k1; k++) {
-		set_rgb8matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
-        RGB8_ADD(x,xstep,x);
-	}
-}
-/* -------------------------------------------------------------------------------------------------------------------------------------------- */
-IMAGE_EXPORT(void) set_rgbx8cube_param(rgbx8 ***c, int k0, int k1, int i0, int i1, int j0, int j1, rgbx8 x, rgbx8 xstep, rgbx8 ystep, rgbx8 zstep)
-/* -------------------------------------------------------------------------------------------------------------------------------------------- */
-{
-	int k;
-	for(k=k0; k<=k1; k++) {
-		set_rgbx8matrix_param(c[k], i0, i1, j0, j1, x, xstep, ystep);
-        RGBX8_ADD(x,xstep,x);
-	}
-}
+
+
+// Local Variables:
+// tab-width: 4
+// c-basic-offset: 4
+// c-file-offsets:((innamespace . 0)(inline-open . 0))
+// indent-tabs-mode: nil
+// End:
+
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
+
