summaryrefslogtreecommitdiff
path: root/emulators/tme/patches
diff options
context:
space:
mode:
authorchristos <christos@pkgsrc.org>2011-10-07 01:12:51 +0000
committerchristos <christos@pkgsrc.org>2011-10-07 01:12:51 +0000
commit25312a6be1c978d1b4c81826e54583e02be845c1 (patch)
treeba9e2a66ae6b503d33a7c95a8c0e60cd18ed9f35 /emulators/tme/patches
parent242ae28b674fc8cc3a814b33b9e0d0a538d6818e (diff)
downloadpkgsrc-25312a6be1c978d1b4c81826e54583e02be845c1.tar.gz
Avoid a compiler bug (phantom integer oveflow) in gcc 4.5.3
It appears that the conditional expression with the 0x0100 constant triggers it no matter what casts we put around the expression.
Diffstat (limited to 'emulators/tme/patches')
-rw-r--r--emulators/tme/patches/patch-af29
1 files changed, 29 insertions, 0 deletions
diff --git a/emulators/tme/patches/patch-af b/emulators/tme/patches/patch-af
new file mode 100644
index 00000000000..92cacd87196
--- /dev/null
+++ b/emulators/tme/patches/patch-af
@@ -0,0 +1,29 @@
+$NetBSD: patch-af,v 1.3 2011/10/07 01:12:51 christos Exp $
+
+--- machine/sun/sun-bwtwo.c.orig 2009-11-08 12:03:58.000000000 -0500
++++ machine/sun/sun-bwtwo.c 2011-10-06 20:52:30.000000000 -0400
+@@ -339,6 +339,7 @@
+ {
+ struct tme_sunbw2 *sunbw2;
+ int rc;
++ tme_uint16_t v;
+
+ /* start the sunbw2 structure: */
+ sunbw2 = tme_new0(struct tme_sunbw2, 1);
+@@ -365,12 +366,10 @@
+ case TME_SUNBW2_TYPE_OLD_ONBOARD:
+
+ /* set our initial CSR: */
+- sunbw2->tme_sunbw2_csr
+- = tme_htobe_u16(TME_SUNBW2_CSR_ENABLE_VIDEO
+- | (sunbw2->tme_sunbw2_sunfb.tme_sunfb_size == TME_SUNFB_SIZE_1024_1024
+- ? TME_SUNBW2_CSR_JUMPER_HIRES
+- : 0));
+-
++ v = TME_SUNBW2_CSR_ENABLE_VIDEO | (sunbw2->tme_sunbw2_sunfb.tme_sunfb_size
++ == TME_SUNFB_SIZE_1024_1024
++ ? TME_SUNBW2_CSR_JUMPER_HIRES : 0);
++ sunbw2->tme_sunbw2_csr = tme_htobe_u16(v);
+ break;
+ }
+