summaryrefslogtreecommitdiff
path: root/emulators/palmosemulator
diff options
context:
space:
mode:
authordsainty <dsainty@pkgsrc.org>2004-08-16 12:36:38 +0000
committerdsainty <dsainty@pkgsrc.org>2004-08-16 12:36:38 +0000
commit6d650c60d563b98edcf2612bec850c547f64fdbf (patch)
tree1578342d503edbde1d13021e395fe3a573e385e6 /emulators/palmosemulator
parentabb73c1311242e813f8479675f8121cf296bff94 (diff)
downloadpkgsrc-6d650c60d563b98edcf2612bec850c547f64fdbf.tar.gz
Building POSE under gcc 3.3.3 with optimisation as default (g++ -O2) leads to
a malfunction where POSE will go into an apparent infinite loop after the first pen operation. This patch codes around the problem.
Diffstat (limited to 'emulators/palmosemulator')
-rw-r--r--emulators/palmosemulator/patches/patch-an35
1 files changed, 35 insertions, 0 deletions
diff --git a/emulators/palmosemulator/patches/patch-an b/emulators/palmosemulator/patches/patch-an
new file mode 100644
index 00000000000..a12161fb9a8
--- /dev/null
+++ b/emulators/palmosemulator/patches/patch-an
@@ -0,0 +1,35 @@
+$NetBSD: patch-an,v 1.1 2004/08/16 12:36:38 dsainty Exp $
+
+Building POSE under gcc 3.3.3 with optimisation as default (g++ -O2) leads to
+a malfunction where POSE will go into an apparent infinite loop after the
+first pen operation.
+
+This appears to be due to pointer coordinate corruption, fixed by the patch
+below.
+
+The only user of the patched type coercion is
+SrcShared/Patches/EmPatchMgr.cpp, which says:
+
+PointType palmPen = pen;
+
+I haven't entirely traced this through, but I suspect that the palmPen
+coordinates are corrupted on the "pen up" event, leading the hosted Palm OS to
+believe the stylus is being perpetually dragged around the screen.
+
+The issue appears to be resolved by the below patch, which is a somewhat less
+dodgy (but only just!) implementation, and appears to be enough to convince
+the compiler to keep the target class uncorrupted.
+
+Another option is: EmPatchMgr.cpp: PointType palmPen = { pen.fX, pen.fY };
+
+--- SrcShared/EmPoint.cpp.orig 2002-03-30 01:11:14.000000000 +1200
++++ SrcShared/EmPoint.cpp 2004-08-16 00:11:31.000000000 +1200
+@@ -233,7 +233,7 @@
+ #undef FOR_POINT
+ #define FOR_POINT(cls, size, x, y) \
+ EmPoint::operator cls() const \
+- { size pt[2]; pt[x] = fX; pt[y] = fY; return *(cls*) pt; }
++ { union { size pt[2]; cls bar; } foo; foo.pt[x] = fX; foo.pt[y] = fY; return foo.bar; }
+
+ POINT_LIST_XY_LONG
+ POINT_LIST_YX_LONG