From cdf2f1aedf4cc666081ca06badb59098770e77f0 Mon Sep 17 00:00:00 2001 From: rideout Date: Thu, 27 Feb 2003 15:51:22 +0000 Subject: Eliminate "possible uninitialized variable" warnings on OSF1. git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Boundary/trunk@210 6a38eb6e-646e-4a02-a296-d141613ad6c4 --- src/Boundary.c | 8 ++++++-- src/CopyBoundary.c | 2 +- src/FlatBoundary.c | 2 +- src/RadiationBoundary.c | 2 +- src/RobinBoundary.c | 2 +- src/ScalarBoundary.c | 2 +- src/StaticBoundary.c | 2 +- 7 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Boundary.c b/src/Boundary.c index f190d19..c7ae95d 100644 --- a/src/Boundary.c +++ b/src/Boundary.c @@ -362,6 +362,7 @@ CCTK_INT Bdry_Boundary_SelectVarForBCI(CCTK_POINTER GH, retval = 0; current = NULL; previous = NULL; + previous_bcdata = NULL; #ifdef DEBUG printf("Boundary_SelectVarForBCI: called with table_handle=%d, var_index=%d, bc_name=%s\n", table_handle, var_index, bc_name); @@ -581,8 +582,6 @@ CCTK_INT Bdry_Boundary_SelectGroupForBC(CCTK_POINTER GH, { int retval, gi; - retval = 0; - #ifdef DEBUG printf("Boundary_SelectGroupForBC: called for group %s\n", group_name); #endif @@ -644,6 +643,7 @@ CCTK_INT Bdry_Boundary_SelectGroupForBC(CCTK_POINTER GH, @returndesc 0 success -7 invalid group index + -8 group has zero vars or the returncode of @seeroutine Bdry_Boundary_SelectVarForBCI @endreturndesc @@*/ @@ -655,6 +655,8 @@ CCTK_INT Bdry_Boundary_SelectGroupForBCI(CCTK_POINTER GH, { int num_vars, vi, max_vi, retval; + retval = -8; + /* Get var indices from group name */ num_vars = CCTK_NumVarsInGroupI(group_index); if (num_vars<0) @@ -878,6 +880,8 @@ void Boundary_ApplyPhysicalBCs(CCTK_ARGUMENTS) max_num_vars = 0; vars = NULL; /* so that it won't be freed if it was never malloced */ + faces = NULL; /* avoids a compiler warning */ + tables = NULL; /* avoids a compiler warning */ /* Step through each requested physical boundary condition */ for (current_bcdata = bcdata_list; diff --git a/src/CopyBoundary.c b/src/CopyBoundary.c index 864a490..8b3f85c 100644 --- a/src/CopyBoundary.c +++ b/src/CopyBoundary.c @@ -96,7 +96,7 @@ int BndCopy(const cGH *GH, int num_vars, int *vars, int *faces, int *tables) int dir; /* direction in which to apply bc */ int copy_from; /* variable (index) from which to copy the boundary data */ - retval = 0; stencil_alldirs = NULL; + retval = 0; stencil_alldirs = NULL; max_gdim = 0; /* loop through variables, j at a time */ for (i=0; i