From 7705998b5d3af452b1caf07c2a6a3640bc8e64ff Mon Sep 17 00:00:00 2001 From: goodale Date: Tue, 26 Oct 1999 09:41:56 +0000 Subject: A bugfix in creating anonymous timers. Tom git-svn-id: http://svn.cactuscode.org/flesh/trunk@1105 17b73243-c579-4c4c-a9d2-2d5706c11dac --- src/util/CactusTimers.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/util') 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; } } -- cgit v1.2.3