From e87c37cd7f03c0b6202cf2ae89324ca8873ca495 Mon Sep 17 00:00:00 2001 From: schnetter Date: Fri, 5 Mar 2004 19:45:56 +0000 Subject: Check argument before setting it instead of afterwards. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Boundary/trunk@259 6a38eb6e-646e-4a02-a296-d141613ad6c4 --- src/Boundary.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Boundary.c b/src/Boundary.c index 48bb013..4e0c0e3 100644 --- a/src/Boundary.c +++ b/src/Boundary.c @@ -203,14 +203,6 @@ CCTK_INT Bdry_Boundary_RegisterPhysicalBC(CCTK_POINTER_TO_CONST _GH, "properly."); } - /* Check if NULL has been passed for fn_pointer */ - if (!fn_pointer) - { - /* Use dummy function if NULL function registered (e.g. for - non-local physical bcs) */ - fn_pointer = (phys_bc_fn_ptr) &BndNone; - } - /* Check input arguments */ if (!fn_pointer) { @@ -219,6 +211,14 @@ CCTK_INT Bdry_Boundary_RegisterPhysicalBC(CCTK_POINTER_TO_CONST _GH, "Is this intentional?"); } + /* Check if NULL has been passed for fn_pointer */ + if (!fn_pointer) + { + /* Use dummy function if NULL function registered (e.g. for + non-local physical bcs) */ + fn_pointer = (phys_bc_fn_ptr) &BndNone; + } + /* Create the registered routines table if necessary */ if (physbc_table_handle == -1) { -- cgit v1.2.3