>From bb566ea876a12b2e45b3e69eb8d745196e5b119a Mon Sep 17 00:00:00 2001
From: Bertram Felgenhauer <int-e@gmx.de>
Date: Sat, 21 Feb 2009 13:07:23 +0100
Subject: [PATCH 3/4] fix compile errors and warnings when sizeof(size_t) != sizeof(uint)

---
 nel/include/nel/misc/polygon.h        |    2 +-
 nel/include/nel/sound/u_audio_mixer.h |    4 ++--
 nel/src/3d/zone.cpp                   |    2 +-
 nel/src/sound/audio_mixer_user.cpp    |    4 ++--
 nel/src/sound/audio_mixer_user.h      |    4 ++--
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/nel/include/nel/misc/polygon.h b/nel/include/nel/misc/polygon.h
index 1a2b60b..57c4760 100644
--- a/nel/include/nel/misc/polygon.h
+++ b/nel/include/nel/misc/polygon.h
@@ -221,7 +221,7 @@ private:
 	const CVector2f &getSegRef1(uint index) const
 	{
 		nlassert(index < Vertices.size());
-		return index == Vertices.size() - 1 ?
+		return index + 1 == Vertices.size() ?
 			   Vertices[0]                 :
 		       Vertices[index + 1];
 	}
diff --git a/nel/include/nel/sound/u_audio_mixer.h b/nel/include/nel/sound/u_audio_mixer.h
index 27fe510..b6de263 100644
--- a/nel/include/nel/sound/u_audio_mixer.h
+++ b/nel/include/nel/sound/u_audio_mixer.h
@@ -179,7 +179,7 @@ public:
 	 *	for the HighestPri source.
 	 *	By default, reserve are set for each channel to the number of available tracks.
 	 */
-	virtual void		setPriorityReserve(TSoundPriority priorityChannel, uint reserve) = 0;
+	virtual void		setPriorityReserve(TSoundPriority priorityChannel, size_t reserve) = 0;
 	/** Set the Low water mark.
 	 *	This value is use to mute sound source that try to play when their priority
 	 *	channel is full (see setPriorityReserve).
@@ -192,7 +192,7 @@ public:
 	 *	available tracks (which is almost always the case). But this value will help
 	 *	the mixer make its best.
 	 */
-	virtual void		setLowWaterMark(uint value) = 0;
+	virtual void		setLowWaterMark(size_t value) = 0;
 	/** Change the number of tracks in RealTime. If the number is lowered, random tracks are deleted.
 	 *	Any playing sources of such deleted track will be stopped
 	 */
diff --git a/nel/src/3d/zone.cpp b/nel/src/3d/zone.cpp
index 441e630..ebe1444 100644
--- a/nel/src/3d/zone.cpp
+++ b/nel/src/3d/zone.cpp
@@ -1418,7 +1418,7 @@ void CZone::setTileColor(bool monochrome, float factor)
 void			CZone::debugBinds(FILE *f)
 {
 	fprintf(f, "*****************************\n");
-	fprintf(f, "ZoneId: %d. NPatchs:%d\n", ZoneId, PatchConnects.size());
+	fprintf(f, "ZoneId: %d. NPatchs:%zu\n", ZoneId, PatchConnects.size());
 	sint i;
 	for(i=0;i<(sint)PatchConnects.size();i++)
 	{
diff --git a/nel/src/sound/audio_mixer_user.cpp b/nel/src/sound/audio_mixer_user.cpp
index cd6e484..a34f0c0 100644
--- a/nel/src/sound/audio_mixer_user.cpp
+++ b/nel/src/sound/audio_mixer_user.cpp
@@ -181,12 +181,12 @@ void CAudioMixerUser::initClusteredSound(NL3D::CScene *scene, float minGain, flo
 }
 
 
-void CAudioMixerUser::setPriorityReserve(TSoundPriority priorityChannel, uint reserve)
+void CAudioMixerUser::setPriorityReserve(TSoundPriority priorityChannel, size_t reserve)
 {
 	_PriorityReserve[priorityChannel] = min(_Tracks.size(), reserve);
 }
 
-void CAudioMixerUser::setLowWaterMark(uint value)
+void CAudioMixerUser::setLowWaterMark(size_t value)
 {
 	_LowWaterMark = min(_Tracks.size(), value);
 }
diff --git a/nel/src/sound/audio_mixer_user.h b/nel/src/sound/audio_mixer_user.h
index 618a68b..2a94933 100644
--- a/nel/src/sound/audio_mixer_user.h
+++ b/nel/src/sound/audio_mixer_user.h
@@ -144,7 +144,7 @@ public:
 	 *	for the HighestPri source.
 	 *	By default, reserve are set for each channel to the number of available tracks.
 	 */
-	virtual void		setPriorityReserve(TSoundPriority priorityChannel, uint reserve);
+	virtual void		setPriorityReserve(TSoundPriority priorityChannel, size_t reserve);
 	/** Set the Low water mark.
 	 *	This value is use to mute sound source that try to play when there priority
 	 *	channel is full (see setPriorityReserve).
@@ -157,7 +157,7 @@ public:
 	 *	available tracks (witch is almos alwais the case). But this value will help
 	 *	the mixer make it's best.
 	 */
-	virtual void		setLowWaterMark(uint value);
+	virtual void		setLowWaterMark(size_t value);
 
 	virtual	void		changeMaxTrack(uint maxTrack);
 
-- 
1.6.1.3

