pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/emulators/palmosemulator Casts to va_list are forbidde...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0e15d5315539
branches:  trunk
changeset: 573845:0e15d5315539
user:      dsainty <dsainty%pkgsrc.org@localhost>
date:      Tue Apr 06 04:36:00 2010 +0000

description:
Casts to va_list are forbidden by ISO C++.  Even if everything works as
intended, the format string parser that generates the va_list does not support
all formatting characters.

Make this code portable by failing to parse any format string at all, not just
the ones that aren't fully supported.

Bump PKGREVISION for the functional change, though this code is probably
generally unused anyway.  Unmark as BROKEN and NOT_FOR_PLATFORM - I think all
uses of va_list casts are inhibited.

diffstat:

 emulators/palmosemulator/Makefile         |   9 +--
 emulators/palmosemulator/distinfo         |   3 +-
 emulators/palmosemulator/patches/patch-as |  77 +++++++++++++++++++++++++++++++
 3 files changed, 81 insertions(+), 8 deletions(-)

diffs (129 lines):

diff -r 9a4db5d96289 -r 0e15d5315539 emulators/palmosemulator/Makefile
--- a/emulators/palmosemulator/Makefile Tue Apr 06 00:16:21 2010 +0000
+++ b/emulators/palmosemulator/Makefile Tue Apr 06 04:36:00 2010 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.30 2010/02/15 16:17:29 joerg Exp $
+# $NetBSD: Makefile,v 1.31 2010/04/06 04:36:00 dsainty Exp $
 #
 
 DISTNAME=      emulator_src_${POSE_VERSION}
 PKGNAME=       palmosemulator-${POSE_VERSION}
-PKGREVISION=   9
+PKGREVISION=   10
 CATEGORIES=    emulators x11
 MASTER_SITES=  http://www.palmos.com/dev/tools/emulator/sources/
 DISTFILES=     ${DISTNAME}${EXTRACT_SUFX} \
@@ -16,8 +16,6 @@
 
 PKG_DESTDIR_SUPPORT=   user-destdir
 
-BROKEN=                Casts to va_list are forbidden by ISO C++.
-
 POSE_VERSION=  3.5
 
 DIST_SUBDIR=   ${PKGBASE}
@@ -44,9 +42,6 @@
 
 REPLACE_PERL=  Scripting/Perl/*.pl
 
-# Assumes too much about how to build va_list's from scratch
-NOT_FOR_PLATFORM=      *-*-powerpc
-
 INSTALLATION_DIRS=     bin ${POSE_SHARE_DIR}/docs ${POSE_SHARE_DIR}/scripting
 INSTALLATION_DIRS+=    ${POSE_SHARE_DIR}/prc ${POSE_SKINS_DIR}
 
diff -r 9a4db5d96289 -r 0e15d5315539 emulators/palmosemulator/distinfo
--- a/emulators/palmosemulator/distinfo Tue Apr 06 00:16:21 2010 +0000
+++ b/emulators/palmosemulator/distinfo Tue Apr 06 04:36:00 2010 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.8 2007/10/24 14:28:14 dsainty Exp $
+$NetBSD: distinfo,v 1.9 2010/04/06 04:36:00 dsainty Exp $
 
 SHA1 (palmosemulator/emulator_src_3.5.tar.gz) = 2debd7690736397d0af41f7b2d482df65391fc65
 RMD160 (palmosemulator/emulator_src_3.5.tar.gz) = fbb6761e4c43ecc9fb20d90d2ae0ec6ccf1c3f27
@@ -24,3 +24,4 @@
 SHA1 (patch-ap) = 1fe9bf4a1d70230f2abb9375b9e439a3a163b4d7
 SHA1 (patch-aq) = f3d3a6bf278f71573fb7d45021305561c3dcc114
 SHA1 (patch-ar) = 50562522b9625e034b858439bd409b177f819f85
+SHA1 (patch-as) = 63d6db2db9f456193408d5e7407149fe4adf4cfb
diff -r 9a4db5d96289 -r 0e15d5315539 emulators/palmosemulator/patches/patch-as
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/palmosemulator/patches/patch-as Tue Apr 06 04:36:00 2010 +0000
@@ -0,0 +1,77 @@
+$NetBSD: patch-as,v 1.1 2010/04/06 04:36:00 dsainty Exp $
+
+Casts to va_list are forbidden by ISO C++.  Even if everything works as
+intended, the format string parser that generates the va_list does not support
+all formatting characters.
+
+Make this code portable by failing to parse any format string at all, not just
+the ones that aren't fully supported.
+
+--- SrcShared/HostControl.cpp.orig     2010-04-06 15:17:21.970083672 +1200
++++ SrcShared/HostControl.cpp  2010-04-06 15:22:12.868914553 +1200
+@@ -143,8 +143,10 @@
+ 
+ static HostHandler    PrvHostGetHandler               (HostControlSelectorType selector);
+ 
++#ifdef ILLEGAL_VA_LIST_CASTS
+ static Bool           PrvCollectParameters    (EmSubroutine& sub, const string& fmt,
+                                                                                        ByteList& stackData, StringList& stringData);
++#endif /* ILLEGAL_VA_LIST_CASTS */
+ static void           PrvPushShort                    (EmSubroutine& sub, ByteList& stackData);
+ static void           PrvPushLong                             (EmSubroutine& sub, ByteList& stackData);
+ static void           PrvPushDouble                   (EmSubroutine& sub, ByteList& stackData);
+@@ -228,6 +230,7 @@
+       return fgets (s, n, f);
+ }
+ 
++#ifdef ILLEGAL_VA_LIST_CASTS
+ inline int x_vfprintf (FILE* f, const char* fmt, va_list args)
+ {
+       if (f == hostLogFILE)
+@@ -237,6 +240,7 @@
+ 
+       return vfprintf (f, fmt, args);
+ }
++#endif /* ILLEGAL_VA_LIST_CASTS */
+ 
+ inline int x_fputc (int c, FILE* f)
+ {
+@@ -1119,11 +1123,14 @@
+       ByteList        stackData;
+       StringList stringData;
+ 
++#ifdef ILLEGAL_VA_LIST_CASTS
+       if (!::PrvCollectParameters (sub, string (fmt), stackData, stringData))
+       {
++#endif /* ILLEGAL_VA_LIST_CASTS */
+               PUT_RESULT_VAL (long, EOF);
+               errno = hostErrInvalidParameter;
+               return;
++#ifdef ILLEGAL_VA_LIST_CASTS
+       }
+ 
+       // Write everything out to the file using vfprintf.
+@@ -1133,6 +1140,7 @@
+       // Return the result.
+ 
+       PUT_RESULT_VAL (long, result);
++#endif /* ILLEGAL_VA_LIST_CASTS */
+ }
+ 
+ 
+@@ -4190,6 +4198,7 @@
+ //            ¥ PrvCollectParameters
+ // ---------------------------------------------------------------------------
+ 
++#ifdef ILLEGAL_VA_LIST_CASTS
+ Bool PrvCollectParameters (EmSubroutine& sub, const string& fmt, ByteList& stackData, StringList& stringData)
+ {
+       // Start parsing up the format string.
+@@ -4473,6 +4482,7 @@
+       stackData.insert (stackData.end (), sizeof (char*), 0); // Make space for a "char*"
+       *(const char**) &stackData[oldSize] = (*(stringData.end () - 1)).c_str ();
+ }
++#endif /* ILLEGAL_VA_LIST_CASTS */
+ 
+ 
+ // ---------------------------------------------------------------------------



Home | Main Index | Thread Index | Old Index