diff runtime/func.h @ 151:b75ec364cecc

Fix conflict between name of proviling variable and time function in C stdlib
author Mike Pavone <pavone@retrodev.com>
date Sun, 05 Dec 2010 18:04:19 -0500
parents 7bbdc034e347
children d1e206ff75f9
line wrap: on
line diff
--- a/runtime/func.h	Wed Nov 24 02:28:01 2010 +0000
+++ b/runtime/func.h	Sun Dec 05 18:04:19 2010 -0500
@@ -38,21 +38,21 @@
 #ifdef ENABLE_PROFILING
 
 #define START_PROFILE \
-		gettimeofday(&time, NULL);\
+		gettimeofday(&proftime, NULL);\
 		cdata->accum = cdata->self_accum = 0;\
-		cdata->self_start = cdata->start = ((uint64_t)time.tv_sec) * 1000000ULL + ((uint64_t)time.tv_usec);
+		cdata->self_start = cdata->start = ((uint64_t)proftime.tv_sec) * 1000000ULL + ((uint64_t)proftime.tv_usec);
 
 #define PAUSE_SELF \
-		gettimeofday(&time, NULL);\
-		my_cdata->self_accum += ((uint64_t)time.tv_sec) * 1000000ULL + ((uint64_t)time.tv_usec) - my_cdata->self_start;
+		gettimeofday(&proftime, NULL);\
+		my_cdata->self_accum += ((uint64_t)proftime.tv_sec) * 1000000ULL + ((uint64_t)proftime.tv_usec) - my_cdata->self_start;
 		
 #define AND_TOTAL \
 		*(my_cdata->myactivationlevel)--;\
-		my_cdata->accum += ((uint64_t)time.tv_sec) * 1000000ULL + ((uint64_t)time.tv_usec) - my_cdata->start;
+		my_cdata->accum += ((uint64_t)proftime.tv_sec) * 1000000ULL + ((uint64_t)proftime.tv_usec) - my_cdata->start;
 
 #define RESUME_SELF \
-		gettimeofday(&time, NULL);\
-		my_cdata->self_start = ((uint64_t)time.tv_sec) * 1000000ULL + ((uint64_t)time.tv_usec);
+		gettimeofday(&proftime, NULL);\
+		my_cdata->self_start = ((uint64_t)proftime.tv_sec) * 1000000ULL + ((uint64_t)proftime.tv_usec);
 		
 #define AND_RESUME_TOTAL \
 		*(my_cdata->myactivationlevel)++;\
@@ -62,15 +62,15 @@
 		free_stack(ct, lv_ ## name);\
 		func = cdata->func;\
 		profile_activationlevel[FUNC_ ## name]--;\
-		gettimeofday(&time, NULL);\
+		gettimeofday(&proftime, NULL);\
 		if(profile_activationlevel[FUNC_ ## name])\
 		{\
 			profile_nestedcounts[FUNC_ ## name]++;\
 		} else {\
 			profile_counts[FUNC_ ## name]++;\
-			profile_totals[FUNC_ ## name] += ((uint64_t)time.tv_sec) * 1000000ULL + ((uint64_t)time.tv_usec) - cdata->start + cdata->accum;\
+			profile_totals[FUNC_ ## name] += ((uint64_t)proftime.tv_sec) * 1000000ULL + ((uint64_t)proftime.tv_usec) - cdata->start + cdata->accum;\
 		}\
-		profile_selftotals[FUNC_ ## name] +=  ((uint64_t)time.tv_sec) * 1000000ULL + ((uint64_t)time.tv_usec) - cdata->self_start + cdata->self_accum;
+		profile_selftotals[FUNC_ ## name] +=  ((uint64_t)proftime.tv_sec) * 1000000ULL + ((uint64_t)proftime.tv_usec) - cdata->self_start + cdata->self_accum;
 		
 #define Func(name,numparams) \
 f_ ## name:\