From 4974124587ef10f1f47a8ee6a2172d5708a2556c Mon Sep 17 00:00:00 2001
From: "Unknown W. Brackets" <checkins@unknownbrackets.org>
Date: Fri, 5 Apr 2013 20:58:35 -0700
Subject: [PATCH] Fix some small constant-comparison type warnings.

---
 Core/HLE/sceMpeg.cpp       | 6 +++---
 Core/HLE/sceMpeg.h         | 2 +-
 Core/HW/MediaEngine.cpp    | 2 +-
 android/jni/TestRunner.cpp | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Core/HLE/sceMpeg.cpp b/Core/HLE/sceMpeg.cpp
index 9986606d4..6c9da35d1 100644
--- a/Core/HLE/sceMpeg.cpp
+++ b/Core/HLE/sceMpeg.cpp
@@ -56,7 +56,7 @@ static const int MPEG_DATA_STREAM = 3;      // Arbitrary user defined type. Can
 static const int MPEG_AUDIO_STREAM = 15;
 static const int MPEG_AU_MODE_DECODE = 0;
 static const int MPEG_AU_MODE_SKIP = 1;
-static const int MPEG_MEMSIZE = 0x10000;          // 64k.
+static const u32 MPEG_MEMSIZE = 0x10000;          // 64k.
 
 static const int MPEG_AVC_DECODE_SUCCESS = 1;       // Internal value.
 static const int MPEG_AVC_DECODE_ERROR_FATAL = -8;
@@ -968,7 +968,7 @@ int sceMpegInitAu(u32 mpeg, u32 bufferAddr, u32 auPointer)
 	SceMpegAu sceAu;
 	sceAu.read(auPointer);
 
-	if (bufferAddr >= 1 && bufferAddr <= NUM_ES_BUFFERS && ctx->esBuffers[bufferAddr - 1]) {
+	if (bufferAddr >= 1 && bufferAddr <= (u32)NUM_ES_BUFFERS && ctx->esBuffers[bufferAddr - 1]) {
 		// This esbuffer has been allocated for Avc.
 		sceAu.esBuffer = bufferAddr;   // Can this be right??? not much of a buffer pointer..
 		sceAu.esSize = MPEG_AVC_ES_SIZE;
@@ -1570,7 +1570,7 @@ int sceMp3Init(u32 mp3)
 
 	// 0 == VBR
 	int bitrate = ((header >> 10) & 0x3);
-	if(bitrate < sizeof(MP3_BITRATES) / sizeof(MP3_BITRATES[0]))
+	if(bitrate < (int)ARRAY_SIZE(MP3_BITRATES))
 		ctx->mp3Bitrate = MP3_BITRATES[bitrate];
 	else
 		ctx->mp3Bitrate = -1;
diff --git a/Core/HLE/sceMpeg.h b/Core/HLE/sceMpeg.h
index f30ad6adb..a5971dd91 100644
--- a/Core/HLE/sceMpeg.h
+++ b/Core/HLE/sceMpeg.h
@@ -43,7 +43,7 @@ enum {
 };
 
 // MPEG statics.
-static const int PSMF_MAGIC = 0x464D5350;
+static const u32 PSMF_MAGIC = 0x464D5350;
 static const int PSMF_VERSION_0012 = 0x32313030;
 static const int PSMF_VERSION_0013 = 0x33313030;
 static const int PSMF_VERSION_0014 = 0x34313030;
diff --git a/Core/HW/MediaEngine.cpp b/Core/HW/MediaEngine.cpp
index cb566affe..324dc2997 100644
--- a/Core/HW/MediaEngine.cpp
+++ b/Core/HW/MediaEngine.cpp
@@ -23,7 +23,7 @@ static const int modeBpp[4] = { 2, 2, 2, 4 };
 
 void MediaEngine::writeVideoImage(u32 bufferPtr, int frameWidth, int videoPixelMode)
 {
-	if (videoPixelMode > (sizeof(modeBpp) / sizeof(modeBpp[0])) || videoPixelMode < 0)
+	if (videoPixelMode > (int)(sizeof(modeBpp) / sizeof(modeBpp[0])) || videoPixelMode < 0)
 	{
 		ERROR_LOG(ME, "Unexpected videoPixelMode %d, using 0 instead.", videoPixelMode);
 		videoPixelMode = 0;
diff --git a/android/jni/TestRunner.cpp b/android/jni/TestRunner.cpp
index dd65b0af8..b47825b21 100644
--- a/android/jni/TestRunner.cpp
+++ b/android/jni/TestRunner.cpp
@@ -82,7 +82,7 @@ void RunTests()
 	std::string savedReportHost = g_Config.sReportHost;
 	g_Config.sReportHost = "";
 
-	for (int i = 0; i < ARRAY_SIZE(testsToRun); i++) {
+	for (size_t i = 0; i < ARRAY_SIZE(testsToRun); i++) {
 		const char *testName = testsToRun[i];
 		coreParam.fileToStart = baseDirectory + "pspautotests/tests/" + testName + ".prx";
 		std::string expectedFile = baseDirectory + "pspautotests/tests/" + testName + ".expected";