From b738988168f0f33eb3bfabd27b0f854a14043d16 Mon Sep 17 00:00:00 2001 From: goodale Date: Tue, 26 Oct 1999 23:50:59 +0000 Subject: Various things pointed out by running Insure on the code. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@1109 17b73243-c579-4c4c-a9d2-2d5706c11dac --- src/main/CactusDefaultEvolve.c | 1 + src/main/Coord.c | 9 +++++++-- src/main/DefaultTimers.c | 3 ++- src/main/ScheduleInterface.c | 1 + src/schedule/ScheduleSorter.c | 8 ++++++-- src/util/File.c | 11 +++++++---- 6 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/main/CactusDefaultEvolve.c b/src/main/CactusDefaultEvolve.c index 7ee8d090..03467ced 100644 --- a/src/main/CactusDefaultEvolve.c +++ b/src/main/CactusDefaultEvolve.c @@ -69,6 +69,7 @@ static int iteration = 0; int CCTK_SetMainLoopIndex (int main_loop_index) { iteration = main_loop_index; + return 0; } diff --git a/src/main/Coord.c b/src/main/Coord.c index 716d30d8..bc29f0bf 100644 --- a/src/main/Coord.c +++ b/src/main/Coord.c @@ -9,6 +9,8 @@ /*#define DEBUG_COORD*/ +static char *rcsid = "$Header$"; + #include #include @@ -29,7 +31,8 @@ struct Coordprops int direction; }; -typedef struct COORD_RANGE { +typedef struct COORD_RANGE +{ cGH *GH; @@ -396,9 +399,11 @@ int CCTK_CoordRange(cGH *GH, CCTK_REAL *lower, CCTK_REAL *upper, const char *nam printf("Returning range (%f,%f) for %s (from %x)\n",*lower,*upper,name,curr); #endif - return; + return 0; } } + + return -1; } diff --git a/src/main/DefaultTimers.c b/src/main/DefaultTimers.c index 40778301..523ccd3b 100644 --- a/src/main/DefaultTimers.c +++ b/src/main/DefaultTimers.c @@ -64,7 +64,8 @@ int CCTKi_RegisterDefaultTimerFunctions(void) CCTKi_RegisterTimersGetrUsage(); #endif -} + return 0; +} diff --git a/src/main/ScheduleInterface.c b/src/main/ScheduleInterface.c index d02d8dc5..4e0ba47a 100644 --- a/src/main/ScheduleInterface.c +++ b/src/main/ScheduleInterface.c @@ -757,6 +757,7 @@ static int SchedulePrint(const char *where) data.GH = NULL; data.schedpoint = schedpoint_misc; + data.whiling = 0; if(where) { diff --git a/src/schedule/ScheduleSorter.c b/src/schedule/ScheduleSorter.c index a3332742..56dad523 100644 --- a/src/schedule/ScheduleSorter.c +++ b/src/schedule/ScheduleSorter.c @@ -191,9 +191,13 @@ void CCTKi_ScheduleDestroyArray(int size, signed char **array) { int i; - for(i=size-1; i >=0; i--) + if(array) { - free(array[i]); + for(i=size-1; i >=0; i--) + { + free(array[i]); + } + free(array); } } diff --git a/src/util/File.c b/src/util/File.c index 67fdfd55..b3adf8a6 100644 --- a/src/util/File.c +++ b/src/util/File.c @@ -9,8 +9,8 @@ @enddesc @@*/ -#include #include +#include #include "cctk_WarnLevel.h" #include "cctk_FortranString.h" @@ -75,10 +75,13 @@ int CCTK_mkdir(char *dir) retval = system(command); retval = 0; - free(command); - - } else + } + else + { retval = -1; + } + + free(command); return retval; -- cgit v1.2.3