aboutsummaryrefslogtreecommitdiff
path: root/src/Interpolate.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Interpolate.c')
-rw-r--r--src/Interpolate.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/Interpolate.c b/src/Interpolate.c
index dc6bc5a..b387b19 100644
--- a/src/Interpolate.c
+++ b/src/Interpolate.c
@@ -18,13 +18,14 @@
@@*/
#include <stdlib.h>
+#include <string.h>
#include "cctk.h"
#include "cctk_Parameters.h"
#include "pughInterpGH.h"
/* the rcs ID and its dummy function to use it */
-static const char *rcsid = "$Id$";
+static const char *rcsid = "$Header$";
CCTK_FILEVERSION(CactusPUGH_PUGHInterp_Interpolate_c)
@@ -39,7 +40,7 @@ CCTK_FILEVERSION(CactusPUGH_PUGHInterp_Interpolate_c)
order, point, dims, n, coeff) \
{ \
int ii, jj, kk; \
- cctk_type *fi; \
+ const cctk_type *fi; \
/* for some reason (probably loop unrolling & pipelining) the compiler \
produces faster code if arrays are used instead of scalars */ \
cctk_subtype interp_result, fj[1], fk[1]; \
@@ -54,7 +55,7 @@ CCTK_FILEVERSION(CactusPUGH_PUGHInterp_Interpolate_c)
for (jj = 0; jj <= order; jj++) \
{ \
/* NOTE: for >3D arrays adapt the index calculation here */ \
- fi = (cctk_type *) in_array + \
+ fi = (const cctk_type *) in_array + \
point[0] + dims[0]*(point[1]+jj + dims[1]*(point[2]+kk)); \
fj[0] = 0; \
for (ii = 0; ii <= order; ii++) \
@@ -164,14 +165,14 @@ int PUGHInterp_Interpolate (int order,
int num_points,
int num_dims,
int num_arrays,
- int dims[ /* num_dims */ ],
- CCTK_REAL coord[ /* num_dims * num_points */ ],
- CCTK_REAL origin[ /* num_dims */ ],
- CCTK_REAL delta[ /* num_dims */ ],
- int in_types[ /* num_arrays */ ],
- void *in_arrays[ /* num_arrays */ ],
- int out_types[ /* num_arrays */ ],
- void *out_arrays[ /* num_arrays */ ])
+ const int dims[],
+ const CCTK_REAL coord[],
+ const CCTK_REAL origin[],
+ const CCTK_REAL delta[],
+ const int in_types[],
+ const void *const in_arrays[],
+ const int out_types[],
+ void *const out_arrays[])
{
int retval;
int i, a, n, out_of_bounds, shift;