freepooma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix breakage from previous patch


From: Richard Guenther
Subject: [PATCH] Fix breakage from previous patch
Date: Tue, 14 Oct 2003 17:11:17 +0200 (CEST)

Hi!

This patch fixes the breakage caused by constifying the evaluators.

Tested and will commit as obvious.

Richard.


2003Oct14  Richard Guenther <address@hidden>

        * src/Field/tests/ScalarCode.cpp: mark operator() in ScalarCode
        functor const, mark reduction variable mutable.
        src/Functions/PackUnpack.h: mark operator()s in stencil functors
        const, mark reduction variable mutable.

Index: Field/tests/ScalarCode.cpp
===================================================================
RCS file: /home/pooma/Repository/r2/src/Field/tests/ScalarCode.cpp,v
retrieving revision 1.1
diff -u -u -r1.1 ScalarCode.cpp
--- Field/tests/ScalarCode.cpp  30 Aug 2001 01:15:18 -0000      1.1
+++ Field/tests/ScalarCode.cpp  14 Oct 2003 15:07:37 -0000
@@ -193,7 +193,7 @@

   template<class F1, class F2>
   inline
-  void operator()(F1 &f1, const F2 &f2, const Loc<Dim> &loc)
+  void operator()(F1 &f1, const F2 &f2, const Loc<Dim> &loc) const
   {
     int i;
     store_m = 0.0;
@@ -204,7 +204,7 @@
     f1(loc) = factor_m * store_m;
   }

-  double store_m;
+  mutable double store_m;
   Loc<Dim> off_m[Dim];
   double factor_m;
 };
Index: Functions/PackUnpack.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Functions/PackUnpack.h,v
retrieving revision 1.3
diff -u -u -r1.3 PackUnpack.h
--- Functions/PackUnpack.h      1 Oct 2001 16:55:21 -0000       1.3
+++ Functions/PackUnpack.h      14 Oct 2003 15:07:37 -0000
@@ -100,32 +100,32 @@
   {
   }

-  void operator()(int i0)
+  void operator()(int i0) const
   {
     *block_m = field_m.read(i0);
     ++block_m;
   }

-  void operator()(int i0, int i1)
+  void operator()(int i0, int i1) const
   {
     *block_m = field_m.read(i0, i1);
     ++block_m;
   }

-  void operator()(int i0, int i1, int i2)
+  void operator()(int i0, int i1, int i2) const
   {
     *block_m = field_m.read(i0, i1, i2);
     ++block_m;
   }

-  void operator()(int i0, int i1, int i2, int i3)
+  void operator()(int i0, int i1, int i2, int i3) const
   {
     *block_m = field_m.read(i0, i1, i2, i3);
     ++block_m;
   }

   InputField field_m;
-  RefCountedBlockPtr<Element_t> block_m;
+  mutable RefCountedBlockPtr<Element_t> block_m;
 };

 template<class InputField>
@@ -175,32 +175,32 @@
   {
   }

-  void operator()(int i0)
+  void operator()(int i0) const
   {
     field_m(i0) = *block_m;
     ++block_m;
   }

-  void operator()(int i0, int i1)
+  void operator()(int i0, int i1) const
   {
     field_m(i0, i1) = *block_m;
     ++block_m;
   }

-  void operator()(int i0, int i1, int i2)
+  void operator()(int i0, int i1, int i2) const
   {
     field_m(i0, i1, i2) = *block_m;
     ++block_m;
   }

-  void operator()(int i0, int i1, int i2, int i3)
+  void operator()(int i0, int i1, int i2, int i3) const
   {
     field_m(i0, i1, i2, i3) = *block_m;
     ++block_m;
   }

   InputField field_m;
-  RefCountedBlockPtr<Element_t> block_m;
+  mutable RefCountedBlockPtr<Element_t> block_m;
 };

 template<class InputField, class T>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]