[svn:parrot] r49236 - branches/typesafe_consttable/src

plobsing at svn.parrot.org plobsing at svn.parrot.org
Wed Sep 22 05:14:27 UTC 2010


Author: plobsing
Date: Wed Sep 22 05:14:27 2010
New Revision: 49236
URL: https://trac.parrot.org/parrot/changeset/49236

Log:
c_macro_args.t doesn't seem to appreciate my 'clever' use of macros

Modified:
   branches/typesafe_consttable/src/packfile.c

Modified: branches/typesafe_consttable/src/packfile.c
==============================================================================
--- branches/typesafe_consttable/src/packfile.c	Wed Sep 22 04:48:18 2010	(r49235)
+++ branches/typesafe_consttable/src/packfile.c	Wed Sep 22 05:14:27 2010	(r49236)
@@ -3906,19 +3906,20 @@
     ASSERT_ARGS(PackFile_ConstTable_clear)
     opcode_t i;
 
-#define EMPTY_CONSTS(type) do { \
-    if (self-> type .constants) { \
-        mem_gc_free(interp, self-> type .constants); \
-        self-> type .constants   = NULL; \
-    } \
-    self-> type .const_count = 0; \
-} while (0)
-
-    EMPTY_CONSTS(num);
-    EMPTY_CONSTS(str);
-    EMPTY_CONSTS(pmc);
+    if (self->num.constants) {
+        mem_gc_free(interp, self->num.constants);
+        self->num.constants = NULL;
+    }
+
+    if (self->str.constants) {
+        mem_gc_free(interp, self->str.constants);
+        self->str.constants = NULL;
+    }
 
-#undef EMPTY_CONSTS
+    if (self->pmc.constants) {
+        mem_gc_free(interp, self->pmc.constants);
+        self->pmc.constants = NULL;
+    }
 
     if (self->string_hash) {
         parrot_hash_destroy(interp, self->string_hash);


More information about the parrot-commits mailing list