From 5c06ee788482b032fc3c45e62dacd055c727d8b6 Mon Sep 17 00:00:00 2001 From: tradke Date: Mon, 28 May 2001 15:28:21 +0000 Subject: Use const pointers wherever possible. Also removed volatile qualifiers for some pointers which were needed on the Hitachi. The compiler bug there seems to be fixed now. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHInterp/trunk@15 1c20744c-e24a-42ec-9533-f5004cb800e5 --- src/Interpolate.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/Interpolate.c') 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 +#include #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; -- cgit v1.2.3