[svn:parrot] r48939 - trunk/src/packfile

plobsing at svn.parrot.org plobsing at svn.parrot.org
Sat Sep 11 20:34:24 UTC 2010


Author: plobsing
Date: Sat Sep 11 20:34:24 2010
New Revision: 48939
URL: https://trac.parrot.org/parrot/changeset/48939

Log:
tidy up PF_fetch_opcode.
also, for some reason gcc 4.3 now updates stream appropriately. fixes gcc 4.3 -O3 build.

Modified:
   trunk/src/packfile/pf_items.c

Modified: trunk/src/packfile/pf_items.c
==============================================================================
--- trunk/src/packfile/pf_items.c	Sat Sep 11 20:14:06 2010	(r48938)
+++ trunk/src/packfile/pf_items.c	Sat Sep 11 20:34:24 2010	(r48939)
@@ -959,14 +959,16 @@
 PF_fetch_opcode(ARGIN_NULLOK(const PackFile *pf), ARGMOD(const opcode_t **stream))
 {
     ASSERT_ARGS(PF_fetch_opcode)
-    opcode_t o;
-    if (!pf || !pf->fetch_op)
+    if (!pf || !pf->fetch_op) {
         return *(*stream)++;
-    o = (pf->fetch_op)(*((const unsigned char **)stream));
-    TRACE_PRINTF_VAL(("  PF_fetch_opcode: 0x%lx (%ld), at 0x%x\n",
-                      o, o, OFFS(pf, *stream)));
-    *((const unsigned char **) (stream)) += pf->header->wordsize;
-    return o;
+    }
+    else {
+        const unsigned char *ucstream = *(const unsigned char **)stream;
+        opcode_t o  = (pf->fetch_op)(ucstream);
+        ucstream   += pf->header->wordsize;
+        *stream     = (opcode_t *)ucstream;
+        return o;
+    }
 }
 
 /*


More information about the parrot-commits mailing list