From 08551ca9cca444ca79db81c05c548d986e0c4a54 Mon Sep 17 00:00:00 2001 From: tradke Date: Mon, 5 Nov 2001 15:03:07 +0000 Subject: Added const qualifier to the 'cGH *' argument of some more PUGHSlab functions. git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHSlab/trunk@60 10716dce-81a3-4424-a2c8-48026a0d3035 --- src/CollectData1D.c | 2 +- src/Hyperslab.c | 27 +++++++++++++-------------- src/NewHyperslab.c | 42 +++++++++++++++++++++--------------------- src/NewPUGHSlab.h | 30 +++++++++++++++--------------- src/PUGHSlab.h | 4 ++-- 5 files changed, 52 insertions(+), 53 deletions(-) diff --git a/src/CollectData1D.c b/src/CollectData1D.c index 8331bce..ea5a052 100644 --- a/src/CollectData1D.c +++ b/src/CollectData1D.c @@ -10,7 +10,7 @@ static const char *rcsid = "$Header$"; CCTK_FILEVERSION(CactusPUGH_PUGHSlab_CollectData1D_c) -/*#define DEBUGME 1*/ +/* #define DEBUGME 1 */ #define PICKUP_LINE_DATA(GH, cctk_type, vsize, start, directions, vdata, hdata)\ diff --git a/src/Hyperslab.c b/src/Hyperslab.c index f793592..6342fcb 100644 --- a/src/Hyperslab.c +++ b/src/Hyperslab.c @@ -14,7 +14,7 @@ static const char *rcsid = "$Header$"; CCTK_FILEVERSION(CactusPUGH_PUGHSlab_Hyperslab_c) /* enable debugging output */ -/*#define DEBUG 1*/ +/* #define DEBUG 1 */ /* macros for getting the minimum/maximum value */ #ifdef MIN @@ -123,17 +123,16 @@ CCTK_FILEVERSION(CactusPUGH_PUGHSlab_Hyperslab_c) /*** local function prototypes ***/ /* Gerd's routine to get 1D lines from a 3D array */ -int Hyperslab_CollectData1D (cGH *GH, int vindex, int vtimelvl, +int Hyperslab_CollectData1D (const cGH *GH, int vindex, int vtimelvl, const int *origin, const int *directions, - int downsampling, int length, void **hdata, int *hsize, int proc); /* routine to check parameters passed to the Hyperslab routines */ -static const char *checkParameters (cGH *GH, int vindex, int vtimelvl, +static const char *checkParameters (const cGH *GH, int vindex, int vtimelvl, int hdim, const int global_startpoint[/*vdim*/], const int directions[/*vdim*/], @@ -164,7 +163,7 @@ static const char *checkParameters (cGH *GH, int vindex, int vtimelvl, @var GH @vdesc Pointer to CCTK grid hierarchy - @vtype cGH + @vtype const cGH * @vio in @endvar @var vindex @@ -231,7 +230,7 @@ static const char *checkParameters (cGH *GH, int vindex, int vtimelvl, @vio out @endvar @@*/ -int Hyperslab_GetLocalHyperslab (cGH *GH, int vindex, int vtimelvl, +int Hyperslab_GetLocalHyperslab (const cGH *GH, int vindex, int vtimelvl, int hdim, const int global_startpoint[/*vdim*/], const int directions[/*vdim*/], @@ -360,7 +359,7 @@ int Hyperslab_GetLocalHyperslab (cGH *GH, int vindex, int vtimelvl, npoints++; } my_global_startpoint[vdim] = global_startpoint[vdim] + - npoints*downsample[vdim]; + npoints*downsample[vdim]; } else { @@ -381,10 +380,10 @@ int Hyperslab_GetLocalHyperslab (cGH *GH, int vindex, int vtimelvl, if (my_global_startpoint[vdim] >= 0 && my_global_startpoint[vdim] < MY_GLOBAL_EP (GA->extras, myproc, - stagger_index, vdim)) + stagger_index, vdim)) { startpoint[vdim] = my_global_startpoint[vdim] - - GA->extras->lb[myproc][vdim]; + GA->extras->lb[myproc][vdim]; } else { @@ -392,10 +391,10 @@ int Hyperslab_GetLocalHyperslab (cGH *GH, int vindex, int vtimelvl, } if (global_endpoint[vdim] > MY_GLOBAL_SP (GA->extras, myproc, - stagger_index, vdim)) + stagger_index, vdim)) { endpoint[vdim] = MIN (MY_LOCAL_EP (GA->extras, stagger_index, vdim), - global_endpoint[vdim] - GA->extras->lb[myproc][vdim]); + global_endpoint[vdim] - GA->extras->lb[myproc][vdim]); } else { @@ -612,7 +611,7 @@ int Hyperslab_GetLocalHyperslab (cGH *GH, int vindex, int vtimelvl, @var GH @vdesc Pointer to CCTK grid hierarchy - @vtype cGH + @vtype const cGH * @vio in @endvar @var vindex @@ -668,7 +667,7 @@ int Hyperslab_GetLocalHyperslab (cGH *GH, int vindex, int vtimelvl, @vio out @endvar @@*/ -int Hyperslab_GetHyperslab (cGH *GH, int target_proc, int vindex, int vtimelvl, +int Hyperslab_GetHyperslab (const cGH *GH, int target_proc, int vindex, int vtimelvl, int hdim, const int global_startpoint[/*vdim*/], const int directions[/*vdim*/], @@ -1017,7 +1016,7 @@ int Hyperslab_GetHyperslab (cGH *GH, int target_proc, int vindex, int vtimelvl, /********************** local routines ************************************/ -static const char *checkParameters (cGH *GH, int vindex, int vtimelvl, +static const char *checkParameters (const cGH *GH, int vindex, int vtimelvl, int hdim, const int global_startpoint[/*vdim*/], const int directions[/*vdim*/], diff --git a/src/NewHyperslab.c b/src/NewHyperslab.c index a03186b..c92ac13 100644 --- a/src/NewHyperslab.c +++ b/src/NewHyperslab.c @@ -51,7 +51,7 @@ CCTK_FILEVERSION(CactusPUGH_PUGHSlab_NewHyperslab_c) ******************** External Routines ************************ ********************************************************************/ /* Gerd's routine to get 1D lines from a 3D array */ -int Hyperslab_CollectData1D (cGH *GH, int vindex, int vtimelvl, +int Hyperslab_CollectData1D (const cGH *GH, int vindex, int vtimelvl, const int *origin, const int *directions, int downsampling, @@ -69,7 +69,7 @@ static int checkFullHyperslab (pGA *GA, const int global_startpoint[/* vdim */], const int extents[/* hdim */], const int downsample_[/* hdim */]); -static const char *checkParameters (cGH *GH, int vindex, int vtimelvl, +static const char *checkParameters (const cGH *GH, int vindex, int vtimelvl, int hdim, const int global_startpoint[/* vdim */], const int directions[/* hdim*vdim */], @@ -123,7 +123,7 @@ static const char *checkParameters (cGH *GH, int vindex, int vtimelvl, @var GH @vdesc Pointer to CCTK grid hierarchy - @vtype cGH * + @vtype const cGH * @vio in @endvar @var vindex @@ -201,21 +201,21 @@ static const char *checkParameters (cGH *GH, int vindex, int vtimelvl, @vio out @endvar @@*/ -int NewHyperslab_GetLocalHyperslab (cGH *GH, - int vindex, - int vtimelvl, - int hdim, - int htype, - PUGHSlab_conversion_fn conversion_fn, - const int global_startpoint[/* vdim */], - const int directions[/* hdim*vdim */], - const int extents[/* hdim */], - const int downsample_[/* hdim */], - void **hdata, - int *free_hdata, - int hsize[/* hdim */], - int hsize_global[/* hdim */], - int hoffset_global[/* hdim */]) +int NewHyperslab_GetLocalHyperslab (const cGH *GH, + int vindex, + int vtimelvl, + int hdim, + int htype, + PUGHSlab_conversion_fn conversion_fn, + const int global_startpoint[/* vdim */], + const int directions[/* hdim*vdim */], + const int extents[/* hdim */], + const int downsample_[/* hdim */], + void **hdata, + int *free_hdata, + int hsize[/* hdim */], + int hsize_global[/* hdim */], + int hoffset_global[/* hdim */]) { int *point; /* looper over hyperslab dimensions */ int *startpoint, /* hyperslab's local start and endpoint */ @@ -662,7 +662,7 @@ int NewHyperslab_GetLocalHyperslab (cGH *GH, @var GH @vdesc Pointer to CCTK grid hierarchy - @vtype cGH * + @vtype const cGH * @vio in @endvar @var vindex @@ -729,7 +729,7 @@ int NewHyperslab_GetLocalHyperslab (cGH *GH, @vio out @endvar @@*/ -int NewHyperslab_GetHyperslab (cGH *GH, +int NewHyperslab_GetHyperslab (const cGH *GH, int target_proc, int vindex, int vtimelvl, @@ -1124,7 +1124,7 @@ static int checkFullHyperslab (pGA *GA, } -static const char *checkParameters (cGH *GH, int vindex, int vtimelvl, +static const char *checkParameters (const cGH *GH, int vindex, int vtimelvl, int hdim, const int global_startpoint[/* vdim */], const int directions[/* hdim*vdim */], diff --git a/src/NewPUGHSlab.h b/src/NewPUGHSlab.h index 1daef6a..7fcffcb 100644 --- a/src/NewPUGHSlab.h +++ b/src/NewPUGHSlab.h @@ -25,21 +25,21 @@ typedef void (*PUGHSlab_conversion_fn) (void *hdata, /* function prototypes */ -int NewHyperslab_GetLocalHyperslab (cGH *GH, - int vindex, - int vtimelvl, - int hdim, - int htype, - PUGHSlab_conversion_fn copy_fn, - const int global_startpoint[/* vdim */], - const int directions[/* hdim * vdim */], - const int lengths[/* hdim */], - const int downsample_[/* hdim */], - void **hdata, - int *free_hdata, - int hsize[/* hdim */], - int hsize_global[/* hdim */], - int hoffset_global[/* hdim */]); +int NewHyperslab_GetLocalHyperslab (const cGH *GH, + int vindex, + int vtimelvl, + int hdim, + int htype, + PUGHSlab_conversion_fn copy_fn, + const int global_startpoint[/* vdim */], + const int directions[/* hdim * vdim */], + const int lengths[/* hdim */], + const int downsample_[/* hdim */], + void **hdata, + int *free_hdata, + int hsize[/* hdim */], + int hsize_global[/* hdim */], + int hoffset_global[/* hdim */]); #if 0 int NewHyperslab_GetHyperslab (cGH *GH, int target_proc, diff --git a/src/PUGHSlab.h b/src/PUGHSlab.h index cfc41f0..c401602 100644 --- a/src/PUGHSlab.h +++ b/src/PUGHSlab.h @@ -11,7 +11,7 @@ /* function prototypes */ -int Hyperslab_GetLocalHyperslab (cGH *GH, int vindex, int vtimelvl, +int Hyperslab_GetLocalHyperslab (const cGH *GH, int vindex, int vtimelvl, int hdim, const int global_startpoint [/*vdim*/], const int directions [/*vdim*/], @@ -20,7 +20,7 @@ int Hyperslab_GetLocalHyperslab (cGH *GH, int vindex, int vtimelvl, void **hdata, int hsize [/*hdim*/], int ghsize [/*hdim*/], int hoffset [/*hdim*/]); -int Hyperslab_GetHyperslab (cGH *GH, int target_proc, int vindex, int vtimelvl, +int Hyperslab_GetHyperslab (const cGH *GH, int target_proc, int vindex, int vtimelvl, int hdim, const int global_startpoint [/*vdim*/], const int directions [/*vdim*/], -- cgit v1.2.3