From 60f01c9e62ad6cd7f91d557bcff4a7a1596e3858 Mon Sep 17 00:00:00 2001
From: Amorilia <amorilia@users.sourceforge.net>
Date: Wed, 29 Jun 2011 16:29:32 +0100
Subject: [PATCH] Fixed compilation errors on gcc 4.6.

---
 NvTriStrip/NvTriStrip.cpp      |  1 +
 NvTriStrip/NvTriStripObjects.h |  1 +
 TriStripper/detail/policy.h    | 12 ++++++------
 TriStripper/detail/types.h     | 16 ++++++++--------
 TriStripper/policy.cpp         |  2 +-
 TriStripper/public_types.h     |  2 +-
 6 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/NvTriStrip/NvTriStrip.cpp b/NvTriStrip/NvTriStrip.cpp
index d825fc22..8d0afca6 100644
--- a/NvTriStrip/NvTriStrip.cpp
+++ b/NvTriStrip/NvTriStrip.cpp
@@ -2,6 +2,7 @@
 #include "NvTriStripObjects.h"
 #include "NvTriStrip.h"
 #include <string.h> // memset
+#include <cstddef> // NULL
 
 using namespace NvTriStrip;
 
diff --git a/NvTriStrip/NvTriStripObjects.h b/NvTriStrip/NvTriStripObjects.h
index c8588a74..f8d66a48 100644
--- a/NvTriStrip/NvTriStripObjects.h
+++ b/NvTriStrip/NvTriStripObjects.h
@@ -5,6 +5,7 @@
 #include <assert.h>
 #include <vector>
 #include <list>
+#include <cstddef> // NULL
 #include "VertexCache.h"
 
 //Wrap these types in a namespace
diff --git a/TriStripper/detail/policy.h b/TriStripper/detail/policy.h
index df4addbc..5726add6 100644
--- a/TriStripper/detail/policy.h
+++ b/TriStripper/detail/policy.h
@@ -26,17 +26,17 @@ namespace triangle_stripper {
 class policy
 {
 public:
-	policy(size_t MinStripSize, bool Cache);
+	policy(std::size_t MinStripSize, bool Cache);
 
 	strip BestStrip() const;
-	void Challenge(strip Strip, size_t Degree, size_t CacheHits);
+	void Challenge(strip Strip, std::size_t Degree, std::size_t CacheHits);
 
 private:
 	strip	m_Strip;
-	size_t	m_Degree;
-	size_t	m_CacheHits;
+	std::size_t	m_Degree;
+	std::size_t	m_CacheHits;
 
-	const size_t	m_MinStripSize;
+	const std::size_t	m_MinStripSize;
 	const bool		m_Cache;
 };
 
@@ -44,7 +44,7 @@ private:
 
 
 
-inline policy::policy(size_t MinStripSize, bool Cache)
+inline policy::policy(std::size_t MinStripSize, bool Cache)
 : m_Degree(0), m_CacheHits(0), m_MinStripSize(MinStripSize), m_Cache(Cache) { }
 
 
diff --git a/TriStripper/detail/types.h b/TriStripper/detail/types.h
index ff7b026a..8eb940e5 100644
--- a/TriStripper/detail/types.h
+++ b/TriStripper/detail/types.h
@@ -28,8 +28,8 @@ public:
 		: m_A(A), m_B(B), m_C(C), m_StripID(0) { }
 
 	void ResetStripID()							{ m_StripID = 0; }
-	void SetStripID(size_t StripID)				{ m_StripID = StripID; }	
-	size_t StripID() const						{ return m_StripID; }
+	void SetStripID(std::size_t StripID)				{ m_StripID = StripID; }	
+	std::size_t StripID() const						{ return m_StripID; }
 
 	index A() const								{ return m_A; }
 	index B() const								{ return m_B; }
@@ -40,7 +40,7 @@ private:
 	index	m_B;
 	index	m_C;
 
-	size_t	m_StripID;
+	std::size_t	m_StripID;
 };
 
 
@@ -75,17 +75,17 @@ public:
 	strip()
 		: m_Start(0), m_Order(ABC), m_Size(0) { }
 
-	strip(size_t Start, triangle_order Order, size_t Size)
+	strip(std::size_t Start, triangle_order Order, std::size_t Size)
 		: m_Start(Start), m_Order(Order), m_Size(Size) { }
 
-	size_t Start() const						{ return m_Start; }
+	std::size_t Start() const						{ return m_Start; }
 	triangle_order Order() const				{ return m_Order; }
-	size_t Size() const							{ return m_Size; }
+	std::size_t Size() const							{ return m_Size; }
 
 private:
-	size_t			m_Start;
+	std::size_t			m_Start;
 	triangle_order	m_Order;
-	size_t			m_Size;
+	std::size_t			m_Size;
 };
 
 
diff --git a/TriStripper/policy.cpp b/TriStripper/policy.cpp
index a0a8e101..224f6798 100644
--- a/TriStripper/policy.cpp
+++ b/TriStripper/policy.cpp
@@ -19,7 +19,7 @@ namespace triangle_stripper {
 
 
 
-void policy::Challenge(strip Strip, size_t Degree, size_t CacheHits)
+void policy::Challenge(strip Strip, std::size_t Degree, std::size_t CacheHits)
 {
 	if (Strip.Size() < m_MinStripSize)
 		return;
diff --git a/TriStripper/public_types.h b/TriStripper/public_types.h
index 66cca5cf..d6df1d1b 100644
--- a/TriStripper/public_types.h
+++ b/TriStripper/public_types.h
@@ -18,7 +18,7 @@
 namespace triangle_stripper
 {
 
-	typedef size_t index;
+	typedef std::size_t index;
 	typedef std::vector<index> indices;
 
 	enum primitive_type
-- 
GitLab