aboutsummaryrefslogtreecommitdiff
path: root/target-ppc/op_helper.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-06-13 08:44:31 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-06-13 08:44:31 +0000
commitc5b76b381081680633e2e0a91216507430409fb2 (patch)
tree193b8be4f6c9dac6664e03c7cdcf2bce8eb3bf16 /target-ppc/op_helper.c
parent487fefdb1e94098ea734cb10e9e17d5860dde2d1 (diff)
Fix mingw32 build warnings
Work around buffer and ioctlsocket argument type signedness problems Suppress a prototype which is unused on mingw32 Expand a macro to avoid warnings from some GCC versions Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'target-ppc/op_helper.c')
-rw-r--r--target-ppc/op_helper.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
index 56fab9cb06..94e530327a 100644
--- a/target-ppc/op_helper.c
+++ b/target-ppc/op_helper.c
@@ -1974,7 +1974,21 @@ target_ulong helper_dlmzb (target_ulong high, target_ulong low, uint32_t update_
SATCVT(sh, sb, int16_t, int8_t, INT8_MIN, INT8_MAX, 1, 1)
SATCVT(sw, sh, int32_t, int16_t, INT16_MIN, INT16_MAX, 1, 1)
SATCVT(sd, sw, int64_t, int32_t, INT32_MIN, INT32_MAX, 1, 1)
-SATCVT(uh, ub, uint16_t, uint8_t, 0, UINT8_MAX, 0, 1)
+
+/* Work around gcc problems with the macro version */
+static always_inline uint8_t cvtuhub(uint16_t x, int *sat)
+{
+ uint8_t r;
+
+ if (x > UINT8_MAX) {
+ r = UINT8_MAX;
+ *sat = 1;
+ } else {
+ r = x;
+ }
+ return r;
+}
+//SATCVT(uh, ub, uint16_t, uint8_t, 0, UINT8_MAX, 0, 1)
SATCVT(uw, uh, uint32_t, uint16_t, 0, UINT16_MAX, 0, 1)
SATCVT(ud, uw, uint64_t, uint32_t, 0, UINT32_MAX, 0, 1)
SATCVT(sh, ub, int16_t, uint8_t, 0, UINT8_MAX, 1, 1)