From e427c671f036de1addf90fa9a2ed09035b099392 Mon Sep 17 00:00:00 2001
From: Richard Nelson <none@none>
Date: Fri, 13 Aug 2010 16:00:14 -0700
Subject: [PATCH] fixed fast timer average frame time rollover error

---
 indra/llcommon/llfasttimer_class.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/indra/llcommon/llfasttimer_class.cpp b/indra/llcommon/llfasttimer_class.cpp
index dfbae098643..e9ac7092544 100644
--- a/indra/llcommon/llfasttimer_class.cpp
+++ b/indra/llcommon/llfasttimer_class.cpp
@@ -474,9 +474,9 @@ void LLFastTimer::NamedTimer::accumulateTimings()
 			int hidx = cur_frame % HISTORY_NUM;
 
 			timerp->mCountHistory[hidx] = timerp->mTotalTimeCounter;
-			timerp->mCountAverage = (timerp->mCountAverage * cur_frame + timerp->mTotalTimeCounter) / (cur_frame+1);
+			timerp->mCountAverage = ((U64)timerp->mCountAverage * cur_frame + timerp->mTotalTimeCounter) / (cur_frame+1);
 			timerp->mCallHistory[hidx] = timerp->getFrameState().mCalls;
-			timerp->mCallAverage = (timerp->mCallAverage * cur_frame + timerp->getFrameState().mCalls) / (cur_frame+1);
+			timerp->mCallAverage = ((U64)timerp->mCallAverage * cur_frame + timerp->getFrameState().mCalls) / (cur_frame+1);
 		}
 	}
 }
-- 
GitLab