aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrideout <rideout@6a38eb6e-646e-4a02-a296-d141613ad6c4>2003-02-27 15:51:22 +0000
committerrideout <rideout@6a38eb6e-646e-4a02-a296-d141613ad6c4>2003-02-27 15:51:22 +0000
commitcdf2f1aedf4cc666081ca06badb59098770e77f0 (patch)
treeb0c805621be752b48f11ca1921a598e3f602a929
parent2fe53a06bb672a339eb43c6c3bb2d179354f309f (diff)
Eliminate "possible uninitialized variable" warnings on OSF1.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/Boundary/trunk@210 6a38eb6e-646e-4a02-a296-d141613ad6c4
-rw-r--r--src/Boundary.c8
-rw-r--r--src/CopyBoundary.c2
-rw-r--r--src/FlatBoundary.c2
-rw-r--r--src/RadiationBoundary.c2
-rw-r--r--src/RobinBoundary.c2
-rw-r--r--src/ScalarBoundary.c2
-rw-r--r--src/StaticBoundary.c2
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<num_vars; i+=j) {
diff --git a/src/FlatBoundary.c b/src/FlatBoundary.c
index 08657d5..5d6458d 100644
--- a/src/FlatBoundary.c
+++ b/src/FlatBoundary.c
@@ -93,7 +93,7 @@ int BndFlat(const cGH *GH, int num_vars, int *vars, int *faces, int *tables)
int *stencil_alldirs; /* width of stencil in all directions */
int dir; /* direction in which to apply bc */
- retval = 0; stencil_alldirs = NULL;
+ retval = 0; stencil_alldirs = NULL; max_gdim = 0;
/* loop through variables, j at a time */
for (i=0; i<num_vars; i+=j) {
diff --git a/src/RadiationBoundary.c b/src/RadiationBoundary.c
index aee8f52..a076f4e 100644
--- a/src/RadiationBoundary.c
+++ b/src/RadiationBoundary.c
@@ -157,7 +157,7 @@ int BndRadiative(const cGH *GH, int num_vars, int *vars, int *faces,
printf("BndRadiative(): got passed GH=%p, num_vars=%d, var_indices[0]=%d, table_handles[0]=%d\n", (const void *) GH, num_vars, var_indices[0], table_handles[0]);
#endif
- retval = 0; stencil_alldirs = NULL;
+ retval = 0; stencil_alldirs = NULL; max_gdim = 0;
/* loop through variables, j at a time */
for (i=0; i<num_vars; i+=j) {
diff --git a/src/RobinBoundary.c b/src/RobinBoundary.c
index 3efe8f4..b550025 100644
--- a/src/RobinBoundary.c
+++ b/src/RobinBoundary.c
@@ -96,7 +96,7 @@ int BndRobin(const cGH *GH, int num_vars, int *vars, int *faces, int *tables)
printf("BndRobin(): got passed GH=%p, num_vars=%d, var_indices[0]=%d, table_handles[0]=%d\n", (const void *) GH, num_vars, var_indices[0], table_handles[0]);
#endif
- retval = 0; stencil = NULL;
+ retval = 0; stencil = NULL; max_gdim = 0;
/* loop through variables, j at a time */
for (i=0; i<num_vars; i+=j) {
diff --git a/src/ScalarBoundary.c b/src/ScalarBoundary.c
index 88fa8c9..47e8602 100644
--- a/src/ScalarBoundary.c
+++ b/src/ScalarBoundary.c
@@ -93,7 +93,7 @@ int BndScalar(const cGH *GH, int num_vars, int *vars, int *faces, int *tables)
int dir; /* direction in which to apply bc */
CCTK_REAL scalar;
- retval = 0; stencil_alldirs = NULL;
+ retval = 0; stencil_alldirs = NULL; max_gdim = 0;
/* loop through variables, j at a time */
for (i=0; i<num_vars; i+=j) {
diff --git a/src/StaticBoundary.c b/src/StaticBoundary.c
index e36f95a..4c4abbe 100644
--- a/src/StaticBoundary.c
+++ b/src/StaticBoundary.c
@@ -89,7 +89,7 @@ int BndStatic(const cGH *GH, int num_vars, int *vars, int *faces, int *tables)
printf("BndStatic(): got passed GH=%p, num_vars=%d, var_indices[0]=%d, table_handles[0]=%d\n", (const void *) GH, num_vars, var_indices[0], table_handles[0]);
#endif
- retval = 0; stencil = NULL;
+ retval = 0; stencil = NULL; max_gdim = 0;
/* loop through variables, j at a time */
for (i=0; i<num_vars; i+=j) {