aboutsummaryrefslogtreecommitdiff
path: root/src/Operator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Operator.c')
-rw-r--r--src/Operator.c71
1 files changed, 35 insertions, 36 deletions
diff --git a/src/Operator.c b/src/Operator.c
index 51da9dc..58e8c74 100644
--- a/src/Operator.c
+++ b/src/Operator.c
@@ -73,13 +73,13 @@ static int PUGHInterp_CheckArguments (cGH *GH,
int num_points,
int num_in_arrays,
int num_out_arrays,
- int interp_coord_array_types[]);
+ const int interp_coord_array_types[]);
#ifdef CCTK_MPI
static int GetLocalCoords (cGH *GH,
int num_points,
const char *coord_system,
- pGExtras *extras,
- CCTK_REAL *coords[],
+ const pGExtras *extras,
+ const CCTK_REAL *coords[],
int *num_local_points,
CCTK_REAL **local_coords);
#endif
@@ -134,7 +134,7 @@ static int GetLocalCoords (cGH *GH,
@endvar
@var interp_coord_arrays
@vdesc coordinates of points to interpolate at
- @vtype void *[num_dims]
+ @vtype void *const [num_dims]
@vio in
@endvar
@var interp_coord_array_types
@@ -154,7 +154,7 @@ static int GetLocalCoords (cGH *GH,
@endvar
@var out_arrays
@vdesc list of output arrays to interpolate to
- @vtype void *[num_out_arrays]
+ @vtype void *const [num_out_arrays]
@vio out
@endvar
@var out_array_types
@@ -175,13 +175,14 @@ int PUGHInterp_InterpGV (cGH *GH,
int num_points,
int num_in_array_indices,
int num_out_arrays,
- void *interp_coord_arrays[],
- int interp_coord_array_types[],
- int in_array_indices[],
- void *out_arrays[],
- int out_array_types[])
+ const void *const interp_coord_arrays[],
+ const int interp_coord_array_types[],
+ const int in_array_indices[],
+ void *const out_arrays[],
+ const int out_array_types[])
{
- CCTK_REAL **data, *interp_local_coords;
+ const CCTK_REAL **data;
+ CCTK_REAL *interp_local_coords;
CCTK_REAL *origin, *delta;
int nprocs;
int timelevel;
@@ -189,7 +190,7 @@ int PUGHInterp_InterpGV (cGH *GH,
int array;
int point;
int retval;
- void **in_arrays;
+ const void **in_arrays;
pGH *pughGH;
pGExtras *extras;
cGroupDynamicData group_data;
@@ -308,7 +309,7 @@ int PUGHInterp_InterpGV (cGH *GH,
/* sort the individual interpolation coordinate arrays into a single one */
interp_local_coords = (CCTK_REAL *) malloc (num_dims * num_points *
sizeof (CCTK_REAL));
- data = (CCTK_REAL **) interp_coord_arrays;
+ data = (const CCTK_REAL **) interp_coord_arrays;
for (point = 0; point < num_points; point++)
{
for (dim = 0; dim < num_dims; dim++)
@@ -426,7 +427,7 @@ int PUGHInterp_InterpGV (cGH *GH,
the number of processor-local points is returned in num_local_points,
their coordinates in interp_local_coords */
retval = GetLocalCoords (GH, num_points, coord_system, extras,
- (CCTK_REAL **) interp_coord_arrays,
+ (const CCTK_REAL **) interp_coord_arrays,
&num_local_points, &interp_local_coords);
if (retval)
{
@@ -737,7 +738,7 @@ int PUGHInterp_InterpGV (cGH *GH,
@endvar
@var coord_arrays
@vdesc list of grid coordinate arrays
- @vtype void *[num_dims]
+ @vtype void *const [num_dims]
@vio in
@endvar
@var coord_array_types
@@ -747,7 +748,7 @@ int PUGHInterp_InterpGV (cGH *GH,
@endvar
@var interp_coord_arrays
@vdesc coordinates of points to interpolate at
- @vtype void *[num_dims]
+ @vtype void *const [num_dims]
@vio in
@endvar
@var interp_coord_array_types
@@ -757,7 +758,7 @@ int PUGHInterp_InterpGV (cGH *GH,
@endvar
@var in_arrays
@vdesc list of input arrays to interpolate on
- @vtype void *[num_in_arrays]
+ @vtype void *const [num_in_arrays]
@vio in
@endvar
@var in_array_types
@@ -767,7 +768,7 @@ int PUGHInterp_InterpGV (cGH *GH,
@endvar
@var out_arrays
@vdesc list of output arrays to interpolate to
- @vtype void *[num_out_arrays]
+ @vtype void *const [num_out_arrays]
@vio out
@endvar
@var out_array_types
@@ -788,21 +789,19 @@ int PUGHInterp_InterpLocal (cGH *GH,
int num_dims,
int num_in_arrays,
int num_out_arrays,
- int coord_dims[],
- void *coord_arrays[],
- int coord_array_types[],
- void *interp_coord_arrays[],
- int interp_coord_array_types[],
- void *in_arrays[],
- int in_array_types[],
- void *out_arrays[],
- int out_array_types[])
+ const int coord_dims[],
+ const void *const coord_arrays[],
+ const int coord_array_types[],
+ const void *const interp_coord_arrays[],
+ const int interp_coord_array_types[],
+ const void *const in_arrays[],
+ const int in_array_types[],
+ void *const out_arrays[],
+ const int out_array_types[])
{
int dim, point, retval;
CCTK_REAL *coords, *origin, *delta;
-/* FIXME: the volatile qualifier is just a workaround for compiler bug
- on the Hitachi SR8000 machine, without it optimized code will crash */
- volatile CCTK_REAL **data;
+ const CCTK_REAL *const *data;
/* check arguments */
@@ -830,7 +829,7 @@ int PUGHInterp_InterpLocal (cGH *GH,
/* get the grid spacings - this assumes a cartesian grid */
origin = (CCTK_REAL *) malloc (2 * num_dims * sizeof (CCTK_REAL));
delta = origin + num_dims;
- data = (volatile CCTK_REAL **) coord_arrays;
+ data = (const CCTK_REAL *const *) coord_arrays;
for (dim = 0; dim < num_dims; dim++)
{
origin[dim] = data[dim][0];
@@ -839,7 +838,7 @@ int PUGHInterp_InterpLocal (cGH *GH,
/* sort the individual interpolation coordinate arrays into a single one */
coords = (CCTK_REAL *) malloc (num_dims * num_points * sizeof (CCTK_REAL));
- data = (volatile CCTK_REAL **) interp_coord_arrays;
+ data = (const CCTK_REAL *const *) interp_coord_arrays;
for (point = 0; point < num_points; point++)
{
for (dim = 0; dim < num_dims; dim++)
@@ -897,7 +896,7 @@ int PUGHInterp_InterpLocal (cGH *GH,
@var GH
@vdesc Pointer to CCTK grid hierarchy
- @vtype cGH
+ @vtype cGH *
@vio in
@endvar
@var num_points
@@ -936,8 +935,8 @@ int PUGHInterp_InterpLocal (cGH *GH,
static int GetLocalCoords (cGH *GH,
int num_points,
const char *coord_system,
- pGExtras *extras,
- CCTK_REAL *coords[],
+ const pGExtras *extras,
+ const CCTK_REAL *coords[],
int *num_local_points,
CCTK_REAL **local_coords)
{
@@ -1259,7 +1258,7 @@ static int PUGHInterp_CheckArguments (cGH *GH,
int num_points,
int num_in_arrays,
int num_out_arrays,
- int interp_coord_array_types[])
+ const int interp_coord_array_types[])
{
int i;