changeset 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 50c97b448f44
children e9a8269384bb
files cbackend_c.rhope runtime/func.h
diffstat 2 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/cbackend_c.rhope	Wed Nov 24 02:28:01 2010 +0000
+++ b/cbackend_c.rhope	Sun Dec 05 18:04:19 2010 -0500
@@ -1651,7 +1651,7 @@
 int32_t rhope(uint32_t func, object ** params, uint16_t numparams, uint16_t callspace)
 {
 #ifdef ENABLE_PROFILING
-	struct timeval time;
+	struct timeval proftime;
 #endif
 	uint16_t resume,idx, vcparam_offset, last_vcparam;
 	context *ct,*temp_ct;
--- 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:\