diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-11-03 09:23:10 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-11-03 09:23:10 +0000 |
commit | f56ab00e21d175ef62608342f185c5e7977be078 (patch) | |
tree | 1bfc0473e7f51b54d1b276af0efb3ebe41238377 /src/util/CactusTimers.c | |
parent | 52b81606de9ddb65dd608424354a28a856a5daef (diff) |
Changing various things pointed to by compiling with -Wall.
Tom
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1129 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/util/CactusTimers.c')
-rw-r--r-- | src/util/CactusTimers.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/util/CactusTimers.c b/src/util/CactusTimers.c index c9f00c49..b331df7e 100644 --- a/src/util/CactusTimers.c +++ b/src/util/CactusTimers.c @@ -7,7 +7,7 @@ @enddesc @@*/ - +#include <stdio.h> #include <stdlib.h> #include <string.h> @@ -130,6 +130,11 @@ int CCTK_TimerCreate(const char *name) } retval = this_timer; } + else + { + free(timer); + retval = -2; + } } else { @@ -183,11 +188,9 @@ int CCTK_TimerCreateI(void) void CCTK_TimerDestroy(const char *name) { t_Timer *timer; - t_TimerFuncs *funcs; int this_timer; - int handle; - if(this_timer = Util_GetHandle(timers, name, (void **)&timer)) + if((this_timer = Util_GetHandle(timers, name, (void **)&timer)) > -1) { CCTKi_TimerDestroy(this_timer, timer); } @@ -211,7 +214,7 @@ void CCTK_TimerDestroyI(int this_timer) { t_Timer *timer; - if(timer = Util_GetHandledData(timers, this_timer)) + if((timer = Util_GetHandledData(timers, this_timer)) > -1) { CCTKi_TimerDestroy(this_timer, timer); } @@ -272,7 +275,7 @@ void CCTK_TimerStart(const char *name) t_Timer *timer; int this_timer; - if(this_timer = Util_GetHandle(timers, name, (void **)&timer)) + if((this_timer = Util_GetHandle(timers, name, (void **)&timer)) > -1) { CCTKi_TimerStart(this_timer, timer); } @@ -282,7 +285,7 @@ void CCTK_TimerStartI(int this_timer) { t_Timer *timer; - if(timer = Util_GetHandledData(timers, this_timer)) + if((timer = Util_GetHandledData(timers, this_timer)) > -1) { CCTKi_TimerStart(this_timer, timer); } @@ -326,7 +329,7 @@ void CCTK_TimerStop(const char *name) t_Timer *timer; int this_timer; - if(this_timer = Util_GetHandle(timers, name, (void **)&timer)) + if((this_timer = Util_GetHandle(timers, name, (void **)&timer)) > -1) { CCTKi_TimerStop(this_timer, timer); } @@ -336,7 +339,7 @@ void CCTK_TimerStopI(int this_timer) { t_Timer *timer; - if(timer = Util_GetHandledData(timers, this_timer)) + if((timer = Util_GetHandledData(timers, this_timer)) > -1) { CCTKi_TimerStop(this_timer, timer); } @@ -380,7 +383,7 @@ void CCTK_TimerReset(const char *name) t_Timer *timer; int this_timer; - if(this_timer = Util_GetHandle(timers, name, (void **)&timer)) + if((this_timer = Util_GetHandle(timers, name, (void **)&timer)) > -1) { CCTKi_TimerReset(this_timer, timer); } @@ -390,7 +393,7 @@ void CCTK_TimerResetI(int this_timer) { t_Timer *timer; - if(timer = Util_GetHandledData(timers, this_timer)) + if((timer = Util_GetHandledData(timers, this_timer)) > -1) { CCTKi_TimerReset(this_timer, timer); } @@ -434,7 +437,7 @@ void CCTK_TimerGet(const char *name, t_TimerInfo *info) t_Timer *timer; int this_timer; - if(this_timer = Util_GetHandle(timers, name, (void **)&timer)) + if((this_timer = Util_GetHandle(timers, name, (void **)&timer)) > -1) { CCTKi_TimerGet(this_timer, timer, info); } @@ -447,7 +450,7 @@ void CCTK_TimerGetI(int this_timer, t_TimerInfo *info) { t_Timer *timer; - if(timer = Util_GetHandledData(timers, this_timer)) + if((timer = Util_GetHandledData(timers, this_timer)) > -1) { CCTKi_TimerGet(this_timer, timer, info); } @@ -466,9 +469,9 @@ static void CCTKi_TimerGet(int this_timer, t_Timer *timer, t_TimerInfo *info) if(timer) { + total_vars = 0; if(timer->data) { - total_vars = 0; /* Start the timer info for this timer */ for(handle = 0; handle < n_timertypes; handle++) { |