From c396a5ac576c172951e129f19a987398d53dc95c Mon Sep 17 00:00:00 2001
From: archshift <admin@archshift.com>
Date: Sat, 17 May 2014 10:55:45 -0700
Subject: [PATCH] Fixed vfp issues

---
 src/core/arm/interpreter/mmu/maverick.cpp  | 4 ++--
 src/core/arm/interpreter/vfp/vfp_helper.h  | 4 ++--
 src/core/arm/interpreter/vfp/vfpdouble.cpp | 8 ++++----
 src/core/arm/interpreter/vfp/vfpsingle.cpp | 4 ++--
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/core/arm/interpreter/mmu/maverick.cpp b/src/core/arm/interpreter/mmu/maverick.cpp
index 0e98ef22b9..adcc2efb5a 100644
--- a/src/core/arm/interpreter/mmu/maverick.cpp
+++ b/src/core/arm/interpreter/mmu/maverick.cpp
@@ -86,12 +86,12 @@ static union
 } reg_conv;
 
 static void
-printf_nothing (void *foo, ...)
+printf_nothing (const char *foo, ...)
 {
 }
 
 static void
-cirrus_not_implemented (char *insn)
+cirrus_not_implemented (const char *insn)
 {
 	fprintf (stderr, "Cirrus instruction '%s' not implemented.\n", insn);
 	fprintf (stderr, "aborting!\n");
diff --git a/src/core/arm/interpreter/vfp/vfp_helper.h b/src/core/arm/interpreter/vfp/vfp_helper.h
index 80f9a93f40..b222e79f18 100644
--- a/src/core/arm/interpreter/vfp/vfp_helper.h
+++ b/src/core/arm/interpreter/vfp/vfp_helper.h
@@ -50,7 +50,7 @@
 #define pr_info //printf
 #define pr_debug //printf
 
-static u32 fls(int x);
+static u32 vfp_fls(int x);
 #define do_div(n, base) {n/=base;}
 
 /* From vfpinstr.h */
@@ -508,7 +508,7 @@ struct op {
 	u32 flags;
 };
 
-static inline u32 fls(int x)
+static u32 vfp_fls(int x)
 {
 	int r = 32;
 
diff --git a/src/core/arm/interpreter/vfp/vfpdouble.cpp b/src/core/arm/interpreter/vfp/vfpdouble.cpp
index cd5b5afa4a..7f975cbeb8 100644
--- a/src/core/arm/interpreter/vfp/vfpdouble.cpp
+++ b/src/core/arm/interpreter/vfp/vfpdouble.cpp
@@ -69,9 +69,9 @@ static void vfp_double_dump(const char *str, struct vfp_double *d)
 
 static void vfp_double_normalise_denormal(struct vfp_double *vd)
 {
-	int bits = 31 - fls(vd->significand >> 32);
+	int bits = 31 - vfp_fls(vd->significand >> 32);
 	if (bits == 31)
-		bits = 63 - fls(vd->significand);
+		bits = 63 - vfp_fls(vd->significand);
 
 	vfp_double_dump("normalise_denormal: in", vd);
 
@@ -108,9 +108,9 @@ u32 vfp_double_normaliseround(ARMul_State* state, int dd, struct vfp_double *vd,
 	exponent = vd->exponent;
 	significand = vd->significand;
 
-	shift = 32 - fls(significand >> 32);
+	shift = 32 - vfp_fls(significand >> 32);
 	if (shift == 32)
-		shift = 64 - fls(significand);
+		shift = 64 - vfp_fls(significand);
 	if (shift) {
 		exponent -= shift;
 		significand <<= shift;
diff --git a/src/core/arm/interpreter/vfp/vfpsingle.cpp b/src/core/arm/interpreter/vfp/vfpsingle.cpp
index 05279f5ce5..602713cff7 100644
--- a/src/core/arm/interpreter/vfp/vfpsingle.cpp
+++ b/src/core/arm/interpreter/vfp/vfpsingle.cpp
@@ -69,7 +69,7 @@ static void vfp_single_dump(const char *str, struct vfp_single *s)
 
 static void vfp_single_normalise_denormal(struct vfp_single *vs)
 {
-	int bits = 31 - fls(vs->significand);
+	int bits = 31 - vfp_fls(vs->significand);
 
 	vfp_single_dump("normalise_denormal: in", vs);
 
@@ -111,7 +111,7 @@ u32 vfp_single_normaliseround(ARMul_State* state, int sd, struct vfp_single *vs,
 	 * bit 31, so we have VFP_SINGLE_LOW_BITS + 1 below the least
 	 * significant bit.
 	 */
-	shift = 32 - fls(significand);
+	shift = 32 - vfp_fls(significand);
 	if (shift < 32 && shift) {
 		exponent -= shift;
 		significand <<= shift;