From 85df1df3c34115efa0e18d116f7923b88ec1dadf Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Fri, 11 Jan 2013 14:24:52 -0800
Subject: [PATCH] SH-3406 WIP convert fast timers to lltrace system gcc 4.1
 fixes

---
 indra/llcommon/llunit.h                 | 12 +++++++++---
 indra/newview/llviewerstatsrecorder.cpp | 10 ++++++++--
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/indra/llcommon/llunit.h b/indra/llcommon/llunit.h
index c6008836075..c43ca2ba187 100644
--- a/indra/llcommon/llunit.h
+++ b/indra/llcommon/llunit.h
@@ -75,9 +75,9 @@ struct LLUnit
 	typedef LLUnit<UNIT_TYPE, STORAGE_TYPE> self_t;
 	typedef STORAGE_TYPE storage_t;
 
-	// value initialization
-	LLUnit(storage_t value = storage_t())
-	:	mValue(value)
+	// default initialization
+	LLUnit()
+	:	mValue(storage_t())
 	{}
 
 	// unit initialization and conversion
@@ -85,6 +85,12 @@ struct LLUnit
 	LLUnit(LLUnit<OTHER_UNIT, OTHER_STORAGE> other)
 	:	mValue(convert(other))
 	{}
+
+	// value initialization
+	template<typename CONVERTABLE_TYPE>
+	LLUnit(CONVERTABLE_TYPE value)
+	: mValue(value)
+	{}
 	
 	// value assignment
 	self_t& operator = (storage_t value)
diff --git a/indra/newview/llviewerstatsrecorder.cpp b/indra/newview/llviewerstatsrecorder.cpp
index 91e485d01b7..cdb7bde1237 100644
--- a/indra/newview/llviewerstatsrecorder.cpp
+++ b/indra/newview/llviewerstatsrecorder.cpp
@@ -216,7 +216,10 @@ void LLViewerStatsRecorder::writeToLog( F32 interval )
 				<< "Texture Fetch bps\t"
 				<< "\n";
 
-			fwrite(data_msg.str().c_str(), 1, data_msg.str().size(), mObjectCacheFile );
+			if (fwrite(data_msg.str().c_str(), 1, data_msg.str().size(), mObjectCacheFile ) != data_msg.str().size())
+			{
+				llwarns << "Failed to write log file." << llendl;
+			}
 		}
 		else
 		{
@@ -249,7 +252,10 @@ void LLViewerStatsRecorder::writeToLog( F32 interval )
 		<< "\t" << (mTextureFetchSize * 8 / delta_time)
 		<< "\n";
 
-	fwrite(data_msg.str().c_str(), 1, data_msg.str().size(), mObjectCacheFile );
+	if (fwrite(data_msg.str().c_str(), 1, data_msg.str().size(), mObjectCacheFile ) != data_msg.str().size())
+	{
+		llwarns << "Failed to write log file." << llendl;
+	}
 	clearStats();
 }
 
-- 
GitLab