diff options
author | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-10-26 09:41:56 +0000 |
---|---|---|
committer | goodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 1999-10-26 09:41:56 +0000 |
commit | 7705998b5d3af452b1caf07c2a6a3640bc8e64ff (patch) | |
tree | b4e01bbb5c05cfd188e03e71b0a3c264cce2c32d | |
parent | eaa42008a9190a6a82d50a1fb49e1279d1304ff0 (diff) |
A bugfix in creating anonymous timers.
Tom
git-svn-id: http://svn.cactuscode.org/flesh/trunk@1105 17b73243-c579-4c4c-a9d2-2d5706c11dac
-rw-r--r-- | src/util/CactusTimers.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/util/CactusTimers.c b/src/util/CactusTimers.c index faf60d3d..c9f00c49 100644 --- a/src/util/CactusTimers.c +++ b/src/util/CactusTimers.c @@ -128,12 +128,16 @@ int CCTK_TimerCreate(const char *name) timer->data[handle] = funcs->create(this_timer); } - retval = this_timer; + retval = this_timer; } } + else + { + retval = -2; + } } - return this_timer; + return retval; } /*@@ @@ -155,7 +159,7 @@ int CCTK_TimerCreateI(void) int retval; char name[20]; - sprintf(name, "timer_%d", n_timers); + sprintf(name, "timer_%d", n_timers++); retval = CCTK_TimerCreate(name); @@ -474,6 +478,11 @@ static void CCTKi_TimerGet(int this_timer, t_Timer *timer, t_TimerInfo *info) total_vars += funcs->info.n_vals; } } + info->n_vals = total_vars; + } + else + { + info->n_vals = 0; } } |