aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@6a38eb6e-646e-4a02-a296-d141613ad6c4>2003-09-01 12:58:24 +0000
committertradke <tradke@6a38eb6e-646e-4a02-a296-d141613ad6c4>2003-09-01 12:58:24 +0000
commitfaab81ea098788284978174b7df1e881083404cf (patch)
treeff9affa219329d48debf6c5d4cf4ce56ffd2e41c
parentd6fce9d9ab97b13a97252d2cd991ffeb3327889d (diff)
Declare the cGH pointer in aliased routines as CCTK_POINTER_TO_CONST
so that it matches the CST-generated function prototype. Fixed also a few other function argument datatype mismatches. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Boundary/trunk@243 6a38eb6e-646e-4a02-a296-d141613ad6c4
-rw-r--r--src/Boundary.c89
1 files changed, 49 insertions, 40 deletions
diff --git a/src/Boundary.c b/src/Boundary.c
index 8598cb8..360b57c 100644
--- a/src/Boundary.c
+++ b/src/Boundary.c
@@ -77,40 +77,42 @@ static void print_selected_faces(void);
***************** Aliased Routine Prototypes ***********************
********************************************************************/
-CCTK_INT Bdry_Boundary_RegisterPhysicalBC(CCTK_POINTER GH,
- CCTK_FPOINTER fn_pointer,
+CCTK_INT Bdry_Boundary_RegisterPhysicalBC(CCTK_POINTER_TO_CONST _GH,
+ phys_bc_fn_ptr fn_pointer,
CCTK_STRING bc_name);
-CCTK_INT Bdry_Boundary_SelectVarForBC(CCTK_POINTER GH,
+CCTK_INT Bdry_Boundary_SelectVarForBC(CCTK_POINTER_TO_CONST _GH,
CCTK_INT faces,
CCTK_INT boundary_width,
CCTK_INT table_handle,
CCTK_STRING var_name,
CCTK_STRING bc_name);
-CCTK_INT Bdry_Boundary_SelectVarForBCI(CCTK_POINTER GH,
+CCTK_INT Bdry_Boundary_SelectVarForBCI(CCTK_POINTER_TO_CONST _GH,
CCTK_INT faces,
CCTK_INT boundary_width,
CCTK_INT table_handle,
CCTK_INT var_index,
CCTK_STRING bc_name);
-CCTK_INT Bdry_Boundary_SelectGroupForBC(CCTK_POINTER GH,
+CCTK_INT Bdry_Boundary_SelectGroupForBC(CCTK_POINTER_TO_CONST _GH,
CCTK_INT faces,
CCTK_INT boundary_width,
CCTK_INT table_handle,
CCTK_STRING group_name,
CCTK_STRING bc_name);
-CCTK_INT Bdry_Boundary_SelectGroupForBCI(CCTK_POINTER GH,
+CCTK_INT Bdry_Boundary_SelectGroupForBCI(CCTK_POINTER_TO_CONST _GH,
CCTK_INT faces,
CCTK_INT boundary_width,
CCTK_INT table_handle,
CCTK_INT group_index,
CCTK_STRING bc_name);
-CCTK_INT Bdry_Boundary_SelectedGVs(CCTK_POINTER GH, CCTK_INT array_size,
- CCTK_POINTER var_indices,
- CCTK_POINTER faces,
- CCTK_POINTER boundary_widths,
- CCTK_POINTER table_handles,
+CCTK_INT Bdry_Boundary_SelectedGVs(CCTK_POINTER_TO_CONST _GH,
+ CCTK_INT array_size,
+ CCTK_INT *var_indices,
+ CCTK_INT *faces,
+ CCTK_INT *boundary_widths,
+ CCTK_INT *table_handles,
CCTK_STRING bc_name);
+
/********************************************************************
***************** Scheduled Routine Prototypes *********************
********************************************************************/
@@ -134,11 +136,11 @@ static struct BCDATA *bcdata_list = NULL;
/* Array of (number of variables) faces specifications, for checking
for duplicate bc selection */
-static CCTK_INT *selected_faces;
-static int num_cctk_vars;
+static CCTK_INT *selected_faces = NULL;
+static int num_cctk_vars = 0;
/* 'The' GH, i.e. to check that there is not more than one... */
-static CCTK_POINTER theGH;
+static CCTK_POINTER_TO_CONST theGH = NULL;
/********************************************************************
********************* Aliased Routines **********************
@@ -155,14 +157,14 @@ static CCTK_POINTER theGH;
@calls
@history
@endhistory
- @var GH
+ @var _GH
@vdesc cctkGH *
- @vtype CCTK_POINTER
+ @vtype CCTK_POINTER_TO_CONST
@vio in
@endvar
@var fn_pointer
@vdesc pointer to function which implements boundary condition bc_name
- @vtype CCTK_FPOINTER
+ @vtype phys_bc_fn_ptr
@vio in
@endvar
@var bc_name
@@ -178,11 +180,12 @@ static CCTK_POINTER theGH;
-3 error adding bc to table
@endreturndesc
@@*/
-CCTK_INT Bdry_Boundary_RegisterPhysicalBC(CCTK_POINTER GH,
- CCTK_FPOINTER fn_pointer,
+CCTK_INT Bdry_Boundary_RegisterPhysicalBC(CCTK_POINTER_TO_CONST _GH,
+ phys_bc_fn_ptr fn_pointer,
CCTK_STRING bc_name)
{
int retval;
+ const cGH *GH = _GH;
#ifdef DEBUG
printf("Boundary_RegisterPhysicalBC: called with GH=%p\n", GH);
@@ -206,7 +209,7 @@ CCTK_INT Bdry_Boundary_RegisterPhysicalBC(CCTK_POINTER GH,
{
/* Use dummy function if NULL function registered (e.g. for
non-local physical bcs) */
- fn_pointer = (CCTK_FPOINTER) &BndNone;
+ fn_pointer = (phys_bc_fn_ptr) &BndNone;
}
/* Check input arguments */
@@ -241,7 +244,8 @@ CCTK_INT Bdry_Boundary_RegisterPhysicalBC(CCTK_POINTER GH,
else
{
/* Add boundary condition to table */
- if (Util_TableSetFnPointer(physbc_table_handle, fn_pointer, bc_name)<0)
+ if (Util_TableSetFnPointer(physbc_table_handle, (CCTK_FPOINTER) fn_pointer,
+ bc_name)<0)
{
CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING,
"Error adding boundary condition to table");
@@ -264,9 +268,9 @@ CCTK_INT Bdry_Boundary_RegisterPhysicalBC(CCTK_POINTER GH,
@calls
@history
@endhistory
- @var GH
+ @var _GH
@vdesc cctkGH *
- @vtype CCTK_POINTER
+ @vtype CCTK_POINTER_TO_CONST
@vio in
@endvar
@var faces
@@ -301,7 +305,7 @@ CCTK_INT Bdry_Boundary_RegisterPhysicalBC(CCTK_POINTER GH,
or the returncode of @seeroutine Bdry_Boundary_SelectVarForBCI
@endreturndesc
@@*/
-CCTK_INT Bdry_Boundary_SelectVarForBC(CCTK_POINTER GH,
+CCTK_INT Bdry_Boundary_SelectVarForBC(CCTK_POINTER_TO_CONST _GH,
CCTK_INT faces,
CCTK_INT width,
CCTK_INT table_handle,
@@ -309,6 +313,7 @@ CCTK_INT Bdry_Boundary_SelectVarForBC(CCTK_POINTER GH,
CCTK_STRING bc_name)
{
int retval, var_index;
+ const cGH *GH = _GH;
#ifdef DEBUG
printf("Boundary_SelectVarForBC:\n");
@@ -346,9 +351,9 @@ CCTK_INT Bdry_Boundary_SelectVarForBC(CCTK_POINTER GH,
@calls
@history
@endhistory
- @var GH
+ @var _GH
@vdesc cctkGH *
- @vtype CCTK_POINTER
+ @vtype CCTK_POINTER_TO_CONST
@vio in
@endvar
@var faces
@@ -384,7 +389,7 @@ CCTK_INT Bdry_Boundary_SelectVarForBC(CCTK_POINTER GH,
-5 new value for GH passed in
@endreturndesc
@@*/
-CCTK_INT Bdry_Boundary_SelectVarForBCI(CCTK_POINTER GH,
+CCTK_INT Bdry_Boundary_SelectVarForBCI(CCTK_POINTER_TO_CONST _GH,
CCTK_INT faces,
CCTK_INT width,
CCTK_INT table_handle,
@@ -398,6 +403,7 @@ CCTK_INT Bdry_Boundary_SelectVarForBCI(CCTK_POINTER GH,
struct BCDATA *current_bcdata;
struct BCDATA *previous_bcdata;
struct BCDATA *new_bcdata;
+ const cGH *GH = _GH;
retval = 0;
current = NULL;
@@ -659,9 +665,9 @@ CCTK_INT Bdry_Boundary_SelectVarForBCI(CCTK_POINTER GH,
@calls
@history
@endhistory
- @var GH
+ @var _GH
@vdesc cctkGH *
- @vtype CCTK_POINTER
+ @vtype CCTK_POINTER_TO_CONST
@vio in
@endvar
@var faces
@@ -696,7 +702,7 @@ CCTK_INT Bdry_Boundary_SelectVarForBCI(CCTK_POINTER GH,
or the returncode of @seeroutine Bdry_Boundary_SelectGroupForBCI
@endreturndesc
@@*/
-CCTK_INT Bdry_Boundary_SelectGroupForBC(CCTK_POINTER GH,
+CCTK_INT Bdry_Boundary_SelectGroupForBC(CCTK_POINTER_TO_CONST _GH,
CCTK_INT faces,
CCTK_INT width,
CCTK_INT table_handle,
@@ -704,6 +710,7 @@ CCTK_INT Bdry_Boundary_SelectGroupForBC(CCTK_POINTER GH,
CCTK_STRING bc_name)
{
int retval, gi;
+ const cGH *GH = _GH;
#ifdef DEBUG
printf("Boundary_SelectGroupForBC: called for group %s\n", group_name);
@@ -738,9 +745,9 @@ CCTK_INT Bdry_Boundary_SelectGroupForBC(CCTK_POINTER GH,
@calls
@history
@endhistory
- @var GH
+ @var _GH
@vdesc cctkGH *
- @vtype CCTK_POINTER
+ @vtype CCTK_POINTER_TO_CONST
@vio in
@endvar
@var faces
@@ -776,7 +783,7 @@ CCTK_INT Bdry_Boundary_SelectGroupForBC(CCTK_POINTER GH,
or the returncode of @seeroutine Bdry_Boundary_SelectVarForBCI
@endreturndesc
@@*/
-CCTK_INT Bdry_Boundary_SelectGroupForBCI(CCTK_POINTER GH,
+CCTK_INT Bdry_Boundary_SelectGroupForBCI(CCTK_POINTER_TO_CONST _GH,
CCTK_INT faces,
CCTK_INT width,
CCTK_INT table_handle,
@@ -784,6 +791,7 @@ CCTK_INT Bdry_Boundary_SelectGroupForBCI(CCTK_POINTER GH,
CCTK_STRING bc_name)
{
int num_vars, vi, max_vi, retval;
+ const cGH *GH = _GH;
retval = -8;
@@ -824,9 +832,9 @@ CCTK_INT Bdry_Boundary_SelectGroupForBCI(CCTK_POINTER GH,
@calls
@history
@endhistory
- @var GH
+ @var _GH
@vdesc cctkGH *
- @vtype CCTK_POINTER
+ @vtype CCTK_POINTER_TO_CONST
@vio in
@endvar
@var array_size
@@ -870,17 +878,18 @@ CCTK_INT Bdry_Boundary_SelectGroupForBCI(CCTK_POINTER GH,
number of variables selected for bc_name
@endreturndesc
@@*/
-CCTK_INT Bdry_Boundary_SelectedGVs(CCTK_POINTER GH,
+CCTK_INT Bdry_Boundary_SelectedGVs(CCTK_POINTER_TO_CONST _GH,
CCTK_INT array_size,
- CCTK_POINTER var_indices,
- CCTK_POINTER faces,
- CCTK_POINTER widths,
- CCTK_POINTER table_handles,
+ CCTK_INT *var_indices,
+ CCTK_INT *faces,
+ CCTK_INT *widths,
+ CCTK_INT *table_handles,
CCTK_STRING bc_name)
{
int retval, i;
struct BCVAR *current;
struct BCDATA *current_bcdata;
+ const cGH *GH = _GH;
current = NULL;
retval = 0;