Author: chromatic
Date: Tue May  6 18:55:21 2008
New Revision: 27367

Modified:
   trunk/src/dynext.c
   trunk/src/stack_common.c
   trunk/src/stacks.c

Log:
[src] Made data member of Stack_Chunk_t a Stack_Entry_t, not a void pointer
(Andy Dougherty, RT #53264).

Modified: trunk/src/dynext.c
==============================================================================
--- trunk/src/dynext.c  (original)
+++ trunk/src/dynext.c  Tue May  6 18:55:21 2008
@@ -140,7 +140,9 @@
     /* remember path/file in props */
     set_cstring_prop(interp, lib_pmc, "_filename", path);  /* XXX */
     set_cstring_prop(interp, lib_pmc, "_type", type);
-    set_cstring_prop(interp, lib_pmc, "_lib_name", lib_name);
+
+    if (lib_name)
+        set_cstring_prop(interp, lib_pmc, "_lib_name", lib_name);
 
     VTABLE_set_pmc_keyed_str(interp, dyn_libs, path, lib_pmc);
 }

Modified: trunk/src/stack_common.c
==============================================================================
--- trunk/src/stack_common.c    (original)
+++ trunk/src/stack_common.c    Tue May  6 18:55:21 2008
@@ -110,7 +110,7 @@
 
 /*
 
-=item C<void* stack_prepare_push>
+=item C<Stack_Entry_t* stack_prepare_push>
 
 Return a pointer, where new entries go for push.
 
@@ -121,7 +121,7 @@
 PARROT_API
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-void*
+Stack_Entry_t*
 stack_prepare_push(PARROT_INTERP, ARGMOD(Stack_Chunk_t **stack_p))
 {
     Stack_Chunk_t * const chunk     = *stack_p;
@@ -138,7 +138,7 @@
 
 /*
 
-=item C<void* stack_prepare_pop>
+=item C<Stack_Entry_t* stack_prepare_pop>
 
 Return a pointer, where new entries are popped off.
 
@@ -149,7 +149,7 @@
 PARROT_API
 PARROT_WARN_UNUSED_RESULT
 PARROT_CANNOT_RETURN_NULL
-void*
+Stack_Entry_t*
 stack_prepare_pop(PARROT_INTERP, ARGMOD(Stack_Chunk_t **stack_p))
 {
     Stack_Chunk_t * const chunk = *stack_p;

Modified: trunk/src/stacks.c
==============================================================================
--- trunk/src/stacks.c  (original)
+++ trunk/src/stacks.c  Tue May  6 18:55:21 2008
@@ -60,7 +60,6 @@
 mark_stack(PARROT_INTERP, ARGMOD(Stack_Chunk_t *chunk))
 {
     for (; ; chunk = chunk->prev) {
-        void          **entry_data;
         Stack_Entry_t  *entry;
 
         pobject_lives(interp, (PObj *)chunk);
@@ -68,8 +67,7 @@
         if (chunk == chunk->prev)
             break;
 
-        entry_data = STACK_DATAP(chunk);
-        entry      = (Stack_Entry_t *)entry_data;
+        entry = STACK_DATAP(chunk);
 
         if (entry->entry_type == STACK_ENTRY_PMC && UVal_pmc(entry->entry))
             pobject_lives(interp, (PObj *)UVal_pmc(entry->entry));
@@ -140,7 +138,6 @@
 stack_entry(PARROT_INTERP, ARGIN(Stack_Chunk_t *stack), INTVAL depth)
 {
     Stack_Chunk_t *chunk;
-    void         **entry;
     size_t         offset = (size_t)depth;
 
     if (depth < 0)
@@ -159,9 +156,7 @@
     if (chunk == chunk->prev)
         return NULL;
 
-    /* this looks bad, but it avoids a type-punning warning */
-    entry = STACK_DATAP(chunk);
-    return (Stack_Entry_t *)entry;
+    return STACK_DATAP(chunk);
 }
 
 /*

Reply via email to