Author: chromatic
Date: Fri Jun 15 01:44:38 2007
New Revision: 19020

Modified:
   trunk/src/gc/register.c
   trunk/src/pmc/coroutine.pmc
   trunk/src/pmc/retcontinuation.pmc

Log:
[PDD 07] Minor code cleanups.

Modified: trunk/src/gc/register.c
==============================================================================
--- trunk/src/gc/register.c     (original)
+++ trunk/src/gc/register.c     Fri Jun 15 01:44:38 2007
@@ -462,7 +462,7 @@
                      : (char*)doomed->name->strstart));
         }
 #endif
-        ptr = ctxp;
+        ptr  = ctxp;
         slot = CALCULATE_SLOT_NUM(ctxp->regs_mem_size);
 
         assert(slot < interp->ctx_mem.n_free_slots);

Modified: trunk/src/pmc/coroutine.pmc
==============================================================================
--- trunk/src/pmc/coroutine.pmc (original)
+++ trunk/src/pmc/coroutine.pmc Fri Jun 15 01:44:38 2007
@@ -65,11 +65,9 @@
 static void
 print_sub_name(Interp* interp, PMC* sub)
 {
-    struct Parrot_coro * co = PMC_coro(sub);
-    Interp *tracer;
+    Parrot_coro *co     = PMC_coro(sub);
+    Interp      *tracer = interp->debugger ? interp->debugger : interp;
 
-    tracer = interp->debugger ?
-        interp->debugger : interp;
     PIO_eprintf(tracer, "# %s coro '%Ss'",
         !(PObj_get_FLAGS(sub) & SUB_FLAG_CORO_FF) ?
         "Calling" : "yielding from",
@@ -107,16 +105,16 @@
     }
 
     PMC* clone() {
-        struct Parrot_coro * sub;
-        PMC* ret            = pmc_new_noinit(INTERP, SELF->vtable->base_type);
+        Parrot_coro *sub;
+        PMC         *ret    = pmc_new_noinit(INTERP, SELF->vtable->base_type);
 
         PObj_custom_mark_destroy_SETALL(ret);
 
-        sub                 = mem_allocate_typed(struct Parrot_coro);
+        sub                 = mem_allocate_typed(Parrot_coro);
         PMC_struct_val(ret) = sub;
         PMC_pmc_val(ret)    = NULL;
 
-        memcpy(sub, PMC_sub(SELF), sizeof (struct Parrot_coro));
+        memcpy(sub, PMC_sub(SELF), sizeof (Parrot_coro));
 
         sub->name           = string_copy(INTERP, sub->name);
 
@@ -139,7 +137,7 @@
         struct Stack_Chunk *state;
         parrot_context_t   *ctx;
         PMC                *ccont;
-        struct Parrot_coro *co   = PMC_coro(SELF);
+        Parrot_coro        *co   = PMC_coro(SELF);
         opcode_t           *dest = co->address;
 
         if (Interp_trace_TEST(INTERP, PARROT_TRACE_SUB_CALL_FLAG))
@@ -257,7 +255,7 @@
 */
 
     void mark() {
-        struct Parrot_coro *c = PMC_coro(SELF);
+        Parrot_coro *c = PMC_coro(SELF);
         if (c && c->ctx)
             mark_context(INTERP, c->ctx);
         if (c && c->dynamic_state)

Modified: trunk/src/pmc/retcontinuation.pmc
==============================================================================
--- trunk/src/pmc/retcontinuation.pmc   (original)
+++ trunk/src/pmc/retcontinuation.pmc   Fri Jun 15 01:44:38 2007
@@ -39,7 +39,7 @@
 
     void init() {
         PMC_struct_val(SELF) = new_ret_continuation(INTERP);
-        PMC_pmc_val(SELF) = NULL;
+        PMC_pmc_val(SELF)    = NULL;
         PObj_custom_mark_destroy_SETALL(SELF);
     }
 
@@ -50,10 +50,9 @@
 
     void destroy() {
         struct Parrot_cont * cc = PMC_cont(SELF);
-        if (cc) {
+        if (cc)
             mem_sys_free(cc);
-            PMC_struct_val(SELF) = NULL;
-        }
+        PMC_struct_val(SELF) = NULL;
     }
 /*
 

Reply via email to