From fe14039aecb78c57c8e2144503ca256ba91edc14 Mon Sep 17 00:00:00 2001 From: rideout Date: Wed, 7 May 2003 15:46:01 +0000 Subject: Allow null pointers as arguments to Boundary_SelectedGVs. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Boundary/trunk@225 6a38eb6e-646e-4a02-a296-d141613ad6c4 --- src/Boundary.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/Boundary.c b/src/Boundary.c index 84c2f54..99ec619 100644 --- a/src/Boundary.c +++ b/src/Boundary.c @@ -831,12 +831,22 @@ CCTK_INT Bdry_Boundary_SelectedGVs(CCTK_POINTER GH, printf(" current->next is %p\n",current->next); #endif - /* One should be able to pass NULL to ignore the values in any of these - arrays... */ - ((int *) faces)[i] = current->faces; - ((int *) widths)[i] = current->width; - ((int *) table_handles)[i] = current->table; - ((int *) var_indices)[i] = current->var; + if (faces) + { + ((int *) faces)[i] = current->faces; + } + if (widths) + { + ((int *) widths)[i] = current->width; + } + if (table_handles) + { + ((int *) table_handles)[i] = current->table; + } + if (var_indices) + { + ((int *) var_indices)[i] = current->var; + } } } } -- cgit v1.2.3