Skip to content
This repository
Browse code

[PMC] More minor cleanups and reformattings.

git-svn-id: https://svn.parrot.org/parrot/trunk@21067 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
commit f6d5c3e926c76d95b6206bde704c58ece40c831e 1 parent f04c450
chromatic authored September 04, 2007
32  src/pmc/coroutine.pmc
@@ -33,10 +33,7 @@ stopped. See the L<Glossary|docs/glossary.pod> for more information.
33 33
 #include "parrot/parrot.h"
34 34
 #include "parrot/oplib/ops.h"
35 35
 
36  
-/*
37  
- * XXX put these into exceptions.h
38  
- */
39  
-
  36
+/* XXX put these into exceptions.h */
40 37
 
41 38
 #define TRY \
42 39
     do { \
@@ -71,12 +68,13 @@ print_sub_name(PARROT_INTERP, PMC *sub)
71 68
         !(PObj_get_FLAGS(sub) & SUB_FLAG_CORO_FF) ?
72 69
         "Calling" : "yielding from",
73 70
         Parrot_full_sub_name(interp, sub));
74  
-    if (co->ctx &&
75  
-        (PObj_get_FLAGS(sub) & SUB_FLAG_CORO_FF)) {
  71
+
  72
+    if (co->ctx && (PObj_get_FLAGS(sub) & SUB_FLAG_CORO_FF)) {
76 73
         PIO_eprintf(tracer, " to '%Ss'",
77 74
                 Parrot_full_sub_name(interp,
78 75
                     co->ctx->caller_ctx->current_sub));
79 76
     }
  77
+
80 78
     PIO_eprintf(tracer, "\n# ");
81 79
     print_pbc_location(interp);
82 80
 }
@@ -99,7 +97,7 @@ Clone the couroutine.
99 97
 
100 98
     void init() {
101 99
         PMC_struct_val(SELF) = new_coroutine(INTERP);
102  
-        PMC_pmc_val(SELF)    = NULL;
  100
+        PMC_pmc_val(SELF)    = PMCNULL;
103 101
         PObj_custom_mark_destroy_SETALL(SELF);
104 102
     }
105 103
 
@@ -113,6 +111,7 @@ Destroys the coroutine.
113 111
 
114 112
     void destroy () {
115 113
         Parrot_coro *sub = PMC_coro(SELF);
  114
+
116 115
         if (sub->ctx)
117 116
             Parrot_free_context(interp, sub->ctx, 0);
118 117
 
@@ -120,14 +119,13 @@ Destroys the coroutine.
120 119
     }
121 120
 
122 121
     PMC *clone() {
123  
-        Parrot_coro *sub;
  122
+        Parrot_coro *sub    = mem_allocate_typed(Parrot_coro);
124 123
         PMC         *ret    = pmc_new_noinit(INTERP, SELF->vtable->base_type);
125 124
 
126 125
         PObj_custom_mark_destroy_SETALL(ret);
127 126
 
128  
-        sub                 = mem_allocate_typed(Parrot_coro);
129 127
         PMC_struct_val(ret) = sub;
130  
-        PMC_pmc_val(ret)    = NULL;
  128
+        PMC_pmc_val(ret)    = PMCNULL;
131 129
 
132 130
         memcpy(sub, PMC_sub(SELF), sizeof (Parrot_coro));
133 131
 
@@ -159,10 +157,9 @@ Swaps the "context".
159 157
             print_sub_name(INTERP, SELF);
160 158
 
161 159
         if (!co->ctx) {
162  
-            /* TODO factor out common code with Sub.invoke
163  
-             *      and inherit it
164  
-             */
  160
+            /* TODO factor out common code with Sub.invoke and inherit it */
165 161
             ccont = INTERP->current_cont;
  162
+
166 163
             if (ccont == NEED_CONTINUATION)
167 164
                 ccont = (PMC *)new_ret_continuation_pmc(interp,
168 165
                                                        (opcode_t *)next);
@@ -190,8 +187,7 @@ Swaps the "context".
190 187
             /* create pad if needed */
191 188
             if (!PMC_IS_NULL(co->lex_info)) {
192 189
                 ctx->lex_pad = pmc_new_init(INTERP,
193  
-                        Parrot_get_ctx_HLL_type(interp,
194  
-                            enum_class_LexPad),
  190
+                        Parrot_get_ctx_HLL_type(interp, enum_class_LexPad),
195 191
                         co->lex_info);
196 192
                 VTABLE_set_pointer(INTERP, ctx->lex_pad, ctx);
197 193
             }
@@ -213,7 +209,9 @@ Swaps the "context".
213 209
 
214 210
             /* and the recent call context */
215 211
             ccont                 = ctx->current_cont;
216  
-            ctx->caller_ctx       = PMC_cont(ccont)->to_ctx = CONTEXT(INTERP->ctx);
  212
+            ctx->caller_ctx       = PMC_cont(ccont)->to_ctx
  213
+                                  = CONTEXT(INTERP->ctx);
  214
+
217 215
             /* set context to coro context */
218 216
             state                 = interp->dynamic_env;
219 217
             interp->dynamic_env   = co->dynamic_state;
@@ -270,10 +268,12 @@ Marks the coroutine as live.
270 268
 
271 269
     void mark() {
272 270
         Parrot_coro *c = PMC_coro(SELF);
  271
+
273 272
         if (c && c->ctx)
274 273
             mark_context(INTERP, c->ctx);
275 274
         if (c && c->dynamic_state)
276 275
             mark_stack(INTERP, c->dynamic_state);
  276
+
277 277
         SUPER();
278 278
     }
279 279
 }
58  src/pmc/eval.pmc
@@ -88,10 +88,10 @@ get_sub(PARROT_INTERP, PMC *self, int idx)
88 88
 static void
89 89
 mark_subs(PARROT_INTERP, PMC *self)
90 90
 {
91  
-    INTVAL i;
92  
-    PackFile_ConstTable *ct;
93  
-    PackFile_ByteCode * const seg = PMC_sub(self)->seg;
  91
+    PackFile_ByteCode   * const seg = PMC_sub(self)->seg;
94 92
     PackFile_FixupTable *ft;
  93
+    PackFile_ConstTable *ct;
  94
+    INTVAL               i;
95 95
 
96 96
     if (!seg)
97 97
         return;
@@ -219,27 +219,31 @@ for writing to disc and later loading via C<load_bytecode>.
219 219
 */
220 220
 
221 221
     STRING *get_string() {
222  
-        STRING *res;
223  
-        PackFile *pf;
224  
-        size_t size, aligned_size;
225  
-        PackFile_ByteCode *seg;
  222
+        PackFile          *pf  = PackFile_new(INTERP, 0);
  223
+        PackFile_ByteCode *seg = PMC_sub(SELF)->seg;
  224
+        STRING            *res;
  225
+        size_t             size, aligned_size;
226 226
 
227  
-        pf = PackFile_new(INTERP, 0);
228  
-        seg = PMC_sub(SELF)->seg;
229 227
         PackFile_add_segment(INTERP, &pf->directory, (PackFile_Segment *)seg);
  228
+
230 229
         if (seg->const_table)
231 230
             PackFile_add_segment(INTERP, &pf->directory,
232 231
                     (PackFile_Segment *)seg->const_table);
  232
+
233 233
         if (seg->debugs)
234 234
             PackFile_add_segment(INTERP, &pf->directory,
235 235
                     (PackFile_Segment *)seg->debugs);
  236
+
236 237
         if (seg->fixups)
237 238
             PackFile_add_segment(INTERP, &pf->directory,
238 239
                     (PackFile_Segment *)seg->fixups);
  240
+
239 241
         if (seg->pic_index)
240 242
             PackFile_add_segment(INTERP, &pf->directory,
241 243
                     (PackFile_Segment *)seg->pic_index);
  244
+
242 245
         size = PackFile_pack_size(INTERP, pf) * sizeof (opcode_t);
  246
+
243 247
         /*
244 248
          * work around packfile bug:
245 249
          * as far as I have checked it the story is:
@@ -251,13 +255,16 @@ for writing to disc and later loading via C<load_bytecode>.
251 255
          * effect
252 256
          */
253 257
         aligned_size = size + 15;
254  
-        res = string_make_empty(INTERP, enum_stringrep_one, aligned_size);
255  
-        res->strlen = res->bufused = size;
  258
+        res          = string_make_empty(INTERP, enum_stringrep_one,
  259
+                                         aligned_size);
  260
+        res->strlen  = res->bufused = size;
  261
+
256 262
         if ((size_t)(res->strstart) & 0xf) {
257  
-            char *adr = res->strstart;
258  
-            adr += 16 - ((size_t)adr & 0xf);
  263
+            char *adr     = res->strstart;
  264
+            adr          += 16 - ((size_t)adr & 0xf);
259 265
             res->strstart = adr;
260 266
         }
  267
+
261 268
         /* We block DOD while doing the packing, since GC run during a pack
262 269
            has been observed to cause problems. There may be a Better Fix.
263 270
            See RT #40410 for example of the problem (note on line that
@@ -265,11 +272,12 @@ for writing to disc and later loading via C<load_bytecode>.
265 272
         Parrot_block_DOD(INTERP);
266 273
         PackFile_pack(INTERP, pf, (opcode_t *)res->strstart);
267 274
         Parrot_unblock_DOD(INTERP);
  275
+
268 276
         /* now remove all segments from directory again and destroy
269  
-         * the packfile
270  
-         */
  277
+         * the packfile */
271 278
         pf->directory.num_segments = 0;
272 279
         PackFile_destroy(INTERP, pf);
  280
+
273 281
         return res;
274 282
     }
275 283
 
@@ -302,35 +310,41 @@ Unarchives the code.
302 310
 */
303 311
 
304 312
     void freeze(visit_info *info) {
305  
-        IMAGE_IO *io = info->image_io;
306  
-        STRING *packed = SELF.get_string();
  313
+        IMAGE_IO *io     = info->image_io;
  314
+        STRING   *packed = SELF.get_string();
307 315
         io->vtable->push_string(INTERP, io, packed);
  316
+
308 317
         SUPER(info);
309 318
     }
310 319
 
311 320
     void thaw(visit_info *info) {
312  
-        IMAGE_IO *io = info->image_io;
313  
-        PackFile *pf;
314  
-        STRING *packed;
315  
-        size_t i;
  321
+        IMAGE_IO         *io     = info->image_io;
  322
+        STRING           *packed = io->vtable->shift_string(INTERP, io);
  323
+        PackFile         *pf;
316 324
         PackFile_Segment *seg;
  325
+        size_t            i;
317 326
 
318  
-        packed = io->vtable->shift_string(INTERP, io);
319 327
         SUPER(info);
320 328
         pf = PackFile_new(INTERP, 0);
  329
+
321 330
         if (!PackFile_unpack(INTERP, pf, (opcode_t *)packed->strstart,
322 331
                 packed->strlen))
323 332
             real_exception(INTERP, NULL, E_IOError,
324 333
                     "couldn't unpack packfile");
  334
+
325 335
         do_sub_pragmas(INTERP, pf->cur_cs, PBC_PBC, SELF);
  336
+
326 337
         for (i = 0; i < pf->directory.num_segments; ++i) {
327 338
             seg = pf->directory.segments[i];
  339
+
328 340
             if (seg->type == PF_BYTEC_SEG) {
329 341
                 PMC_sub(SELF)->seg = (PackFile_ByteCode *)seg;
330 342
                 break;
331 343
             }
332 344
         }
  345
+
333 346
         pf->directory.num_segments = 0;
  347
+
334 348
         /*
335 349
          * XXX this isn't ok - it seems that the packfile
336 350
          *     gets attached to interp->code and is
51  src/pmc/exporter.pmc
@@ -12,9 +12,11 @@ You can use Exporter in PIR to import subs from a library. At its simplest:
12 12
 
13 13
  .sub main :main
14 14
      load_bytecode 'Test/More.pir'
  15
+
15 16
      .local pmc exporter, test_ns
16  
-     test_ns = get_namespace [ 'Test'; 'More' ]
  17
+     test_ns  = get_namespace [ 'Test'; 'More' ]
17 18
      exporter = new 'Exporter'
  19
+
18 20
      exporter.'import'( test_ns :named('source'), 'plan ok' :named('globals') )
19 21
      plan(1)
20 22
      ok(1, 'exporter has imported the requested functions')
@@ -98,11 +100,11 @@ Initializes an Exporter PMC.
98 100
         Parrot_Exporter *exp = NULL;
99 101
 
100 102
         /* Set up the object. */
101  
-        exp            = mem_allocate_zeroed_typed(Parrot_Exporter);
102  
-        exp->ns_src    = PMCNULL;
103  
-        exp->ns_dest   = CONTEXT(interp->ctx)->current_namespace;
104  
-        exp->globals   = PMCNULL;
105  
-        PMC_data(SELF) = exp;
  103
+        exp                  = mem_allocate_zeroed_typed(Parrot_Exporter);
  104
+        exp->ns_src          = PMCNULL;
  105
+        exp->ns_dest         = CONTEXT(interp->ctx)->current_namespace;
  106
+        exp->globals         = PMCNULL;
  107
+        PMC_data(SELF)       = exp;
106 108
 
107 109
         /* Set flags for custom DOD mark and destroy. */
108 110
         PObj_custom_mark_SET(SELF);
@@ -121,7 +123,7 @@ Free the memory associated with the object's underlying struct.
121 123
 */
122 124
 
123 125
     void destroy() {
124  
-            mem_sys_free(PMC_data(SELF));
  126
+        mem_sys_free(PMC_data(SELF));
125 127
     }
126 128
 
127 129
 
@@ -137,12 +139,13 @@ Mark referenced strings and PMCs in the structure as live.
137 139
 
138 140
     void mark() {
139 141
         Parrot_Exporter *exp = PARROT_EXPORTER(SELF);
  142
+
140 143
         if (exp->ns_src)
141  
-            pobject_lives(interp, (PObj*)exp->ns_src);
  144
+            pobject_lives(interp, (PObj *)exp->ns_src);
142 145
         if (exp->ns_dest)
143  
-            pobject_lives(interp, (PObj*)exp->ns_dest);
  146
+            pobject_lives(interp, (PObj *)exp->ns_dest);
144 147
         if (exp->globals)
145  
-            pobject_lives(interp, (PObj*)exp->globals);
  148
+            pobject_lives(interp, (PObj *)exp->globals);
146 149
     }
147 150
 
148 151
 
@@ -155,7 +158,7 @@ Mark referenced strings and PMCs in the structure as live.
155 158
 =over 4
156 159
 
157 160
 =item C<PCCMETHOD
158  
-    source(PMC *src :optional, int got_src :opt_flag)>
  161
+source(PMC *src :optional, int got_src :opt_flag)>
159 162
 
160 163
 Accessor for the source NameSpace object (C<ns_src>.)
161 164
 Sets the value if C<src> is passed, otherwise returns the value.
@@ -176,8 +179,7 @@ Throws an exception if a non-NameSpace PMC is passed.
176 179
             exp->ns_src = src;
177 180
         }
178 181
         else {
179  
-            PMC *tmp_ns_src;
180  
-            tmp_ns_src = exp->ns_src;
  182
+            PMC *tmp_ns_src = exp->ns_src;
181 183
             PCCRETURN(PMC *tmp_ns_src);
182 184
         }
183 185
     }
@@ -207,8 +209,7 @@ Throws an exception if a non-NameSpace PMC is passed.
207 209
             exp->ns_dest = dest;
208 210
         }
209 211
         else {
210  
-            PMC *tmp_ns_dest;
211  
-            tmp_ns_dest = exp->ns_dest;
  212
+            PMC *tmp_ns_dest = exp->ns_dest;
212 213
             PCCRETURN(PMC *tmp_ns_dest);
213 214
         }
214 215
     }
@@ -284,8 +285,7 @@ Throws an exception if an unknown PMC type is passed.
284 285
                 PCCRETURN(PMC *PMCNULL);
285 286
             }
286 287
             else {
287  
-                PMC *tmp_globals;
288  
-                tmp_globals = exp->globals;
  288
+                PMC *tmp_globals = exp->globals;
289 289
                 PCCRETURN(PMC *tmp_globals);
290 290
             }
291 291
         }
@@ -295,9 +295,9 @@ Throws an exception if an unknown PMC type is passed.
295 295
 /*
296 296
 
297 297
 =item C<PCCMETHOD
298  
-    import(PMC *dest :optional :named["destination"], int got_dest :opt_flag,
299  
-        PMC *src     :optional :named["source"],  int got_src :opt_flag,
300  
-        PMC *globals :optional :named["globals"], int got_globals :opt_flag)>
  298
+    import(PMC *dest    :optional :named["destination"], int got_dest :opt_flag,
  299
+        PMC    *src     :optional :named["source"],      int got_src  :opt_flag,
  300
+        PMC    *globals :optional :named["globals"], int got_globals  :opt_flag)>
301 301
 
302 302
 Import C<globals> from the C<src> namespace to the C<dest> namespace.
303 303
 If C<src>, C<dest>, or C<globals> are passed, they override the current value.
@@ -311,7 +311,7 @@ Throws an exception upon error.
311 311
 */
312 312
 
313 313
     PCCMETHOD import(PMC *dest :optional :named["destination"], int got_dest :opt_flag,
314  
-            PMC *src     :optional :named["source"],  int got_src :opt_flag,
  314
+            PMC *src     :optional :named["source"],  int got_src     :opt_flag,
315 315
             PMC *globals :optional :named["globals"], int got_globals :opt_flag) {
316 316
 
317 317
         Parrot_Exporter *exp = PARROT_EXPORTER(SELF);
@@ -319,17 +319,18 @@ Throws an exception upon error.
319 319
 
320 320
         if (got_src)
321 321
             PCCINVOKE(interp, SELF, "source", PMC *src);
  322
+
322 323
         if (got_dest)
323 324
             PCCINVOKE(interp, SELF, "destination", PMC *dest);
  325
+
324 326
         if (got_globals)
325 327
             PCCINVOKE(interp, SELF, "globals", PMC *globals);
326 328
 
327  
-        if (PMC_IS_NULL(exp->ns_src)) {
  329
+        if (PMC_IS_NULL(exp->ns_src))
328 330
             real_exception(interp, NULL, 0, "source namespace not set");
329  
-        }
330  
-        if (PMC_IS_NULL(exp->ns_dest)) {
  331
+
  332
+        if (PMC_IS_NULL(exp->ns_dest))
331 333
             real_exception(interp, NULL, 0, "destination namespace not set");
332  
-        }
333 334
 
334 335
         ns_src     = exp->ns_src;
335 336
         ns_dest    = exp->ns_dest;
57  src/pmc/fixedfloatarray.pmc
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2  
-Copyright (C) 2001-2003, The Perl Foundation.
  2
+Copyright (C) 2001-2007, The Perl Foundation.
3 3
 $Id$
4 4
 
5 5
 =head1 NAME
@@ -8,8 +8,8 @@ src/pmc/fixedfloatarray.pmc - fixed size array for floating point numbers only
8 8
 
9 9
 =head1 DESCRIPTION
10 10
 
11  
-This class, FixedFloatArray, implements an array of fixed size, which
12  
-stored FLOATVALs, it uses Float PMCs to do all necessary conversions
  11
+This class, FixedFloatArray, implements an array of fixed size which
  12
+stored FLOATVALs.  It uses Float PMCs to do all necessary conversions.
13 13
 
14 14
 =head2 Functions
15 15
 
@@ -41,7 +41,7 @@ Initializes the array.
41 41
 
42 42
     void init() {
43 43
         PMC_int_val(SELF) = 0;
44  
-        PMC_data(SELF) = NULL;
  44
+        PMC_data(SELF)    = NULL;
45 45
     }
46 46
 
47 47
 /*
@@ -72,7 +72,8 @@ Destroys the array.
72 72
     void destroy() {
73 73
         if (PMC_data(SELF))
74 74
             mem_sys_free(PMC_data(SELF));
75  
-        PMC_data(SELF) = NULL;
  75
+
  76
+        PMC_data(SELF)    = NULL;
76 77
         PMC_int_val(SELF) = 0;
77 78
     }
78 79
 
@@ -88,16 +89,19 @@ Creates and returns a copy of the array.
88 89
 
89 90
     PMC *clone() {
90 91
         INTVAL size;
91  
-        PMC *dest = pmc_new(INTERP, SELF->vtable->base_type);
  92
+        PMC   *dest     = pmc_new(INTERP, SELF->vtable->base_type);
  93
+        size_t mem_size = size * sizeof (FLOATVAL);
92 94
 
93 95
         if (!PMC_data(SELF))
94 96
             return dest;
95  
-        size = PMC_int_val(SELF);
  97
+
  98
+        size              = PMC_int_val(SELF);
96 99
         PMC_int_val(dest) = size;
  100
+        PMC_data(dest)    = mem_sys_allocate(mem_size);
97 101
 
98  
-        PMC_data(dest) = mem_sys_allocate(size * sizeof (FLOATVAL));
99  
-        mem_sys_memcopy(PMC_data(dest), PMC_data(SELF), size*sizeof (FLOATVAL));
  102
+        mem_sys_memcopy(PMC_data(dest), PMC_data(SELF), mem_size);
100 103
         PObj_active_destroy_SET(dest);
  104
+
101 105
         return dest;
102 106
     }
103 107
 
@@ -187,6 +191,7 @@ Returns the floating-point value of the element at index C<key>.
187 191
 
188 192
     FLOATVAL get_number_keyed_int(INTVAL key) {
189 193
         FLOATVAL *data;
  194
+
190 195
         if (key < 0 || key >= PMC_int_val(SELF))
191 196
             real_exception(INTERP, NULL, E_IndexError,
192 197
                 "FixedFloatArray: index out of bounds!");
@@ -221,9 +226,8 @@ Returns the Parrot string value of the element at index C<key>.
221 226
 */
222 227
 
223 228
     STRING *get_string_keyed_int(INTVAL key) {
224  
-        PMC *temp;
225  
-        temp = DYNSELF.get_pmc_keyed_int(key);
226  
-        return VTABLE_get_string(INTERP, temp);
  229
+        PMC *e = DYNSELF.get_pmc_keyed_int(key);
  230
+        return VTABLE_get_string(INTERP, e);
227 231
     }
228 232
 
229 233
 /*
@@ -253,11 +257,9 @@ Returns the PMC value of the element at index C<key>.
253 257
 */
254 258
 
255 259
     PMC *get_pmc_keyed_int(INTVAL key) {
256  
-        PMC *ret;
257  
-        FLOATVAL val;
  260
+        PMC     *ret = pmc_new(INTERP, enum_class_Float);
  261
+        FLOATVAL val = DYNSELF.get_number_keyed_int(key);
258 262
 
259  
-        ret = pmc_new(INTERP, enum_class_Float);
260  
-        val = DYNSELF.get_number_keyed_int(key);
261 263
         VTABLE_set_number_native(INTERP, ret, val);
262 264
         return ret;
263 265
     }
@@ -291,8 +293,9 @@ Resizes the array to C<size> elements.
291 293
         if (PMC_int_val(SELF) || size < 1)
292 294
             real_exception(INTERP, NULL, E_IndexError,
293 295
                     "FixedFloatArray: Can't resize!");
  296
+
294 297
         PMC_int_val(SELF) = size;
295  
-        PMC_data(SELF) = mem_sys_allocate(size * sizeof (FLOATVAL));
  298
+        PMC_data(SELF)    = mem_sys_allocate(size * sizeof (FLOATVAL));
296 299
         PObj_active_destroy_SET(SELF);
297 300
     }
298 301
 
@@ -321,8 +324,7 @@ Sets the integer value of the element at index C<key> to C<value>.
321 324
 */
322 325
 
323 326
     void set_integer_keyed(PMC *key, INTVAL value) {
324  
-        INTVAL k;
325  
-        k = key_integer(INTERP, key);
  327
+        INTVAL k = key_integer(INTERP, key);
326 328
         DYNSELF.set_integer_keyed_int(k, value);
327 329
     }
328 330
 
@@ -343,7 +345,7 @@ C<value>.
343 345
             real_exception(INTERP, NULL, E_IndexError,
344 346
                 "FixedFloatArray: index out of bounds!");
345 347
 
346  
-        data = (FLOATVAL*)PMC_data(SELF);
  348
+        data      = (FLOATVAL *)PMC_data(SELF);
347 349
         data[key] = value;
348 350
     }
349 351
 
@@ -359,8 +361,7 @@ C<value>.
359 361
 */
360 362
 
361 363
     void set_number_keyed(PMC *key, FLOATVAL value) {
362  
-        INTVAL k;
363  
-        k = key_integer(INTERP, key);
  364
+        INTVAL k = key_integer(INTERP, key);
364 365
         DYNSELF.set_number_keyed_int(k, value);
365 366
     }
366 367
 
@@ -376,9 +377,8 @@ Sets the Parrot string value of the element at index C<key> to C<value>.
376 377
 
377 378
     void set_string_keyed_int(INTVAL key, STRING *value) {
378 379
         FLOATVAL tempNum;
379  
-        PMC *tempPMC;
  380
+        PMC     *tempPMC = pmc_new(INTERP, enum_class_Float);
380 381
 
381  
-        tempPMC = pmc_new(INTERP, enum_class_Float);
382 382
         VTABLE_set_string_native(INTERP, tempPMC, value);
383 383
         tempNum = VTABLE_get_number(INTERP, tempPMC);
384 384
         DYNSELF.set_number_keyed_int(key, tempNum);
@@ -396,8 +396,7 @@ C<value>.
396 396
 */
397 397
 
398 398
     void set_string_keyed(PMC *key, STRING *value) {
399  
-        INTVAL k;
400  
-        k = key_integer(INTERP, key);
  399
+        INTVAL k = key_integer(INTERP, key);
401 400
         DYNSELF.set_string_keyed_int(k, value);
402 401
     }
403 402
 
@@ -412,8 +411,7 @@ Sets the PMC value of the element at index C<key> to C<*src>.
412 411
 */
413 412
 
414 413
     void set_pmc_keyed_int(INTVAL key, PMC *src) {
415  
-        FLOATVAL tempNum;
416  
-        tempNum = VTABLE_get_number(INTERP, src);
  414
+        FLOATVAL tempNum = VTABLE_get_number(INTERP, src);
417 415
         DYNSELF.set_number_keyed_int(key, tempNum);
418 416
     }
419 417
 
@@ -429,8 +427,7 @@ C<value>.
429 427
 */
430 428
 
431 429
     void set_pmc_keyed(PMC *key, PMC *value) {
432  
-        INTVAL k;
433  
-        k = key_integer(INTERP, key);
  430
+        INTVAL k = key_integer(INTERP, key);
434 431
         DYNSELF.set_pmc_keyed_int(k, value);
435 432
     }
436 433
 
58  src/pmc/fixedstringarray.pmc
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2  
-Copyright (C) 2001-2003, The Perl Foundation.
  2
+Copyright (C) 2001-2007, The Perl Foundation.
3 3
 $Id$
4 4
 
5 5
 =head1 NAME
@@ -8,7 +8,7 @@ src/pmc/fixedstringarray.pmc - fixed size array for strings only
8 8
 
9 9
 =head1 DESCRIPTION
10 10
 
11  
-This class, FixedStringArray, implements an array of fixed size, which
  11
+This class, FixedStringArray, implements an array of fixed size which
12 12
 stores Parrot strings.
13 13
 
14 14
 =head2 Functions
@@ -41,7 +41,7 @@ Initializes the array.
41 41
 
42 42
     void init() {
43 43
         PMC_int_val(SELF) = 0;
44  
-        PMC_data(SELF) = NULL;
  44
+        PMC_data(SELF)    = NULL;
45 45
     }
46 46
 
47 47
 /*
@@ -72,7 +72,8 @@ Destroys the array.
72 72
     void destroy() {
73 73
         if (PMC_data(SELF))
74 74
             mem_sys_free(PMC_data(SELF));
75  
-        PMC_data(SELF) = NULL;
  75
+
  76
+        PMC_data(SELF)    = NULL;
76 77
         PMC_int_val(SELF) = 0;
77 78
     }
78 79
 
@@ -87,17 +88,20 @@ Creates and returns a copy of the array.
87 88
 */
88 89
 
89 90
     PMC *clone() {
90  
-        INTVAL size;
91  
-        PMC * const dest = pmc_new(INTERP, SELF->vtable->base_type);
  91
+        PMC * const dest     = pmc_new(INTERP, SELF->vtable->base_type);
  92
+        INTVAL      mem_size, size;
92 93
 
93 94
         if (!PMC_data(SELF))
94 95
             return dest;
95  
-        size = PMC_int_val(SELF);
  96
+
  97
+        size              = PMC_int_val(SELF);
96 98
         PMC_int_val(dest) = size;
  99
+        mem_size          = size * sizeof (STRING *);
97 100
 
98  
-        PMC_data(dest) = mem_sys_allocate(size * sizeof (STRING*));
99  
-        mem_sys_memcopy(PMC_data(dest), PMC_data(SELF), size*sizeof (STRING*));
  101
+        PMC_data(dest)    = mem_sys_allocate(mem_size);
  102
+        mem_sys_memcopy(PMC_data(dest), PMC_data(SELF), mem_size);
100 103
         PObj_custom_mark_destroy_SETALL(dest);
  104
+
101 105
         return dest;
102 106
     }
103 107
 
@@ -112,16 +116,18 @@ Marks the array as live.
112 116
 */
113 117
 
114 118
     void mark() {
115  
-        int i, end;
  119
+        int      i, end;
116 120
         STRING **data;
  121
+
117 122
         if (!PMC_data(SELF))
118 123
             return;
  124
+
119 125
         data = (STRING **) PMC_data(SELF);
120  
-        end = PMC_int_val(SELF);
  126
+        end  = PMC_int_val(SELF);
  127
+
121 128
         for (i = 0; i < end; i++) {
122  
-            if (data[i]) {
  129
+            if (data[i])
123 130
                 pobject_lives(INTERP, (PObj *) data[i]);
124  
-            }
125 131
         }
126 132
     }
127 133
 
@@ -245,6 +251,7 @@ Returns the Parrot string value of the element at index C<key>.
245 251
 
246 252
     STRING *get_string_keyed_int(INTVAL key) {
247 253
         STRING **data;
  254
+
248 255
         if (key < 0 || key >= PMC_int_val(SELF))
249 256
             real_exception(INTERP, NULL, E_IndexError,
250 257
                 "FixedStringArray: index out of bounds!");
@@ -280,7 +287,7 @@ Returns the PMC value of the element at index C<key>.
280 287
 */
281 288
 
282 289
     PMC *get_pmc_keyed_int(INTVAL key) {
283  
-        PMC * const ret = pmc_new(INTERP, enum_class_String);
  290
+        PMC    * const ret = pmc_new(INTERP, enum_class_String);
284 291
         STRING * const val = DYNSELF.get_string_keyed_int(key);
285 292
 
286 293
         VTABLE_set_string_native(INTERP, ret, val);
@@ -318,8 +325,10 @@ cause an exception to be thrown.
318 325
         if (PMC_int_val(SELF) || size < 1)
319 326
             real_exception(INTERP, NULL, E_IndexError,
320 327
                     "FixedStringArray: Can't resize!");
  328
+
321 329
         PMC_int_val(SELF) = size;
322  
-        PMC_data(SELF) = mem_sys_allocate_zeroed(size * sizeof (STRING*));
  330
+        PMC_data(SELF)    = mem_sys_allocate_zeroed(size * sizeof (STRING*));
  331
+
323 332
         PObj_custom_mark_destroy_SETALL(SELF);
324 333
     }
325 334
 
@@ -334,7 +343,7 @@ Sets the integer value of the element at index C<key> to C<value>.
334 343
 */
335 344
 
336 345
     void set_integer_keyed_int(INTVAL key, INTVAL value) {
337  
-        PMC * const ret = pmc_new(INTERP, enum_class_String);
  346
+        PMC    * const ret = pmc_new(INTERP, enum_class_String);
338 347
         STRING *val;
339 348
 
340 349
         VTABLE_set_integer_native(INTERP, ret, value);
@@ -369,7 +378,7 @@ C<value>.
369 378
 */
370 379
 
371 380
     void set_number_keyed_int(INTVAL key, FLOATVAL value) {
372  
-        PMC * const ret = pmc_new(INTERP, enum_class_String);
  381
+        PMC    * const ret = pmc_new(INTERP, enum_class_String);
373 382
         STRING *val;
374 383
 
375 384
         VTABLE_set_number_native(INTERP, ret, value);
@@ -405,11 +414,12 @@ Sets the Parrot string value of the element at index C<key> to C<value>.
405 414
 
406 415
     void set_string_keyed_int(INTVAL key, STRING *value) {
407 416
         STRING **data;
  417
+
408 418
         if (key < 0 || key >= PMC_int_val(SELF))
409 419
             real_exception(INTERP, NULL, E_IndexError,
410 420
                 "FixedStringArray: index out of bounds!");
411 421
 
412  
-        data = (STRING**)PMC_data(SELF);
  422
+        data      = (STRING **)PMC_data(SELF);
413 423
         DOD_WRITE_BARRIER(INTERP, SELF, data[key], value);
414 424
         data[key] = value;
415 425
     }
@@ -477,15 +487,15 @@ Used to archive the string.
477 487
 
478 488
 */
479 489
     void freeze(visit_info *info) {
480  
-        IMAGE_IO * const io = info->image_io;
481  
-        STRING ** const data = (STRING**)PMC_data(SELF);
482  
-        const INTVAL n = PMC_int_val(SELF);
483  
-        INTVAL i;
  490
+        IMAGE_IO *  const io   = info->image_io;
  491
+        STRING   ** const data = (STRING**)PMC_data(SELF);
  492
+        const INTVAL n         = PMC_int_val(SELF);
  493
+        INTVAL       i;
484 494
 
485 495
         io->vtable->push_integer(INTERP, io, n);
486  
-        for (i = 0; i < n; ++i) {
  496
+
  497
+        for (i = 0; i < n; ++i)
487 498
             io->vtable->push_string(INTERP, io, data[i]);
488  
-        }
489 499
     }
490 500
 
491 501
 /*
58  src/pmc/key.pmc
@@ -20,15 +20,6 @@ These are the vtable functions for the Key PMC class.
20 20
 
21 21
 #include "parrot/parrot.h"
22 22
 
23  
-static int
24  
-is_hash_iter(PMC *key /*NN*/)
25  
-{
26  
-    if ((PObj_get_FLAGS(key) & KEY_type_FLAGS) ==
27  
-        KEY_hash_iterator_FLAGS)
28  
-        return 1;
29  
-    return 0;
30  
-}
31  
-
32 23
 pmclass Key need_ext {
33 24
 
34 25
 /*
@@ -57,39 +48,43 @@ Creates and returns a clone of the key.
57 48
 
58 49
     PMC *clone() {
59 50
         PMC * const dest = pmc_new_noinit(INTERP, SELF->vtable->base_type);
60  
-        PMC *dkey = dest;
61  
-        PMC *key = SELF;
  51
+        PMC *dkey        = dest;
  52
+        PMC *key         = SELF;
62 53
         PMC *p;
63 54
 
64 55
         PObj_custom_mark_SET(dest);
  56
+
65 57
         for (; key ;) {
66 58
             switch (PObj_get_FLAGS(key) & KEY_type_FLAGS) {
67 59
                 case KEY_integer_FLAG:
68  
-                case KEY_integer_FLAG|KEY_register_FLAG:
  60
+                case KEY_integer_FLAG | KEY_register_FLAG:
69 61
                     key_set_integer(INTERP, dkey, key_integer(INTERP, key));
70 62
                     break;
71 63
                 case KEY_number_FLAG:
72  
-                case KEY_number_FLAG|KEY_register_FLAG:
  64
+                case KEY_number_FLAG | KEY_register_FLAG:
73 65
                     key_set_number(INTERP, dkey, key_number(INTERP, key));
74 66
                     break;
75 67
                 case KEY_string_FLAG:
76  
-                case KEY_string_FLAG|KEY_register_FLAG:
  68
+                case KEY_string_FLAG | KEY_register_FLAG:
77 69
                     key_set_string(INTERP, dkey,
78 70
                         string_copy(INTERP, key_string(INTERP, key)));
79 71
                     break;
80 72
                 case KEY_pmc_FLAG:
81  
-                case KEY_pmc_FLAG|KEY_register_FLAG:
  73
+                case KEY_pmc_FLAG | KEY_register_FLAG:
82 74
                     p = key_pmc(INTERP, key);
83 75
                     key_set_pmc(INTERP, dkey, VTABLE_clone(INTERP, p));
84 76
                     break;
85 77
             }
  78
+
86 79
             key = key_next(INTERP, key);
  80
+
87 81
             if (key) {
88  
-                p = key_new(INTERP);
  82
+                p    = key_new(INTERP);
89 83
                 key_append(INTERP, dkey, p);
90 84
                 dkey = p;
91 85
             }
92 86
         }
  87
+
93 88
         return dest;
94 89
     }
95 90
 
@@ -230,6 +225,7 @@ Appends C<*value> to the key.
230 225
         if (value->vtable->base_type != enum_class_Key)
231 226
             real_exception(interp, NULL, INVALID_OPERATION,
232 227
                 "Can only push another Key onto a Key PMC.");
  228
+
233 229
         key_append(INTERP, SELF, value);
234 230
     }
235 231
 
@@ -294,12 +290,15 @@ PMC_int_val(-1) means end of iteration.
294 290
                  */
295 291
                 PObj_get_FLAGS(ret) &= ~KEY_type_FLAGS;
296 292
                 PObj_get_FLAGS(ret) |= KEY_integer_FLAG;
  293
+
297 294
                 if (agg->vtable->base_type == enum_class_OrderedHash)
298 295
                     PObj_get_FLAGS(ret) |= KEY_number_FLAG;
  296
+
299 297
                 goto init;
300 298
             case ITERATE_FROM_START:    /* reset key */
301 299
                 PObj_get_FLAGS(ret) &= ~KEY_type_FLAGS;
302 300
                 PObj_get_FLAGS(ret) |= KEY_integer_FLAG;
  301
+
303 302
                 /*
304 303
                  * KEY_hash_iterator_FLAGS, which is the same as
305 304
                  * KEY_integer_FLAG | KEY_number_FLAG
@@ -307,6 +306,7 @@ PMC_int_val(-1) means end of iteration.
307 306
                  * KEY_integer_FLAG alone is an indexed hash lookup
308 307
                  * with an Integer KEY
309 308
                  */
  309
+
310 310
                  _hash = CONST_STRING(interp, "Hash");
311 311
                 if (VTABLE_isa(INTERP, agg, _hash) &&
312 312
                      agg->vtable->base_type != enum_class_OrderedHash)
@@ -315,19 +315,18 @@ PMC_int_val(-1) means end of iteration.
315 315
                 PMC_int_val(ret) = 0;
316 316
                 if (!n)
317 317
                     PMC_int_val(ret) = -1;
318  
-                /*
319  
-                 * iterating over a hash needs additionally the
320  
-                 * Bucket index
321  
-                 */
322  
-                if (is_hash_iter(ret))
  318
+
  319
+                /* iterating over a hash additionally needs the Bucket index */
  320
+                if (KEY_IS_HASH_ITERATOR(ret))
323 321
                     PMC_data(ret) = (void *)INITBucketIndex;
  322
+
324 323
                 break;
325 324
             case ITERATE_GET_NEXT:
326 325
                 /*
327 326
                  * src/hash.c:parrot_hash_get_idx() advances to next
328 327
                  * so, if we are iterating over a hash do nothing
329 328
                  * */
330  
-                if (!is_hash_iter(ret)) {
  329
+                if (!KEY_IS_HASH_ITERATOR(ret)) {
331 330
                     if (PMC_int_val(ret) < n - 1)
332 331
                         ++PMC_int_val(ret);
333 332
                     else
@@ -370,34 +369,37 @@ Called after the Key has been thawed: convert last PMC_NULL key to NULL.
370 369
 
371 370
     void visit(visit_info *info) {
372 371
         /*
373  
-         * at end a PMC_NULL is written during thaw,
  372
+         * at end a PMCNULL is written during thaw,
374 373
          * which should stop visiting the key
375 374
          */
376  
-        PMC ** const pos = (PMC**)&PMC_data(SELF);
  375
+        PMC ** const pos = (PMC **)&PMC_data(SELF);
377 376
         info->thaw_ptr = pos;
378 377
         (info->visit_pmc_now)(INTERP, *pos, info);
379 378
     }
380 379
 
381 380
     void freeze(visit_info *info /*NN*/) {
382 381
         IMAGE_IO * const io = info->image_io;
  382
+
383 383
         /* write flags */
384  
-        const INTVAL flags = (PObj_get_FLAGS(SELF) & KEY_type_FLAGS);
  384
+        const INTVAL flags  = (PObj_get_FLAGS(SELF) & KEY_type_FLAGS);
  385
+
385 386
         /* write the contents of a register - else thaw can't restore
386 387
          * the register state
387 388
          */
388 389
         io->vtable->push_integer(INTERP, io, flags & ~KEY_register_FLAG);
  390
+
389 391
         /* and contents of this key component */
390 392
         switch (flags) {
391 393
             case KEY_integer_FLAG:
392  
-            case KEY_integer_FLAG|KEY_register_FLAG:
  394
+            case KEY_integer_FLAG | KEY_register_FLAG:
393 395
                 io->vtable->push_integer(INTERP, io, key_integer(INTERP, SELF));
394 396
                 break;
395 397
             case KEY_number_FLAG:
396  
-            case KEY_number_FLAG|KEY_register_FLAG:
  398
+            case KEY_number_FLAG | KEY_register_FLAG:
397 399
                 io->vtable->push_float(INTERP, io, key_number(INTERP, SELF));
398 400
                 break;
399 401
             case KEY_string_FLAG:
400  
-            case KEY_string_FLAG|KEY_register_FLAG:
  402
+            case KEY_string_FLAG | KEY_register_FLAG:
401 403
                 io->vtable->push_string(INTERP, io, key_string(INTERP, SELF));
402 404
                 break;
403 405
             default:
35  src/pmc/object.pmc
@@ -118,7 +118,7 @@ Returns the fully qualified name of the object's class.
118 118
 */
119 119
 
120 120
     STRING *name() {
121  
-        PMC * const _class = VTABLE_get_class(interp, SELF);
  121
+        PMC    * const _class     = VTABLE_get_class(interp, SELF);
122 122
         STRING * const class_name = VTABLE_get_string(interp, _class);
123 123
 
124 124
         return class_name;
@@ -135,6 +135,7 @@ Mark any referenced strings and PMCs.
135 135
 */
136 136
     void mark() {
137 137
         Parrot_Object * const obj = PARROT_OBJECT(SELF);
  138
+
138 139
         if (obj->_class)
139 140
             pobject_lives(interp, (PObj*)obj->_class);
140 141
         if (obj->attrib_store)
@@ -158,10 +159,9 @@ of the given name walking up the inheritance tree.
158 159
         const INTVAL index = get_attrib_index(interp, obj->_class, name);
159 160
 
160 161
         /* If lookup failed, exception. */
161  
-        if (index == -1) {
  162
+        if (index == -1)
162 163
             real_exception(interp, NULL, ATTRIB_NOT_FOUND,
163 164
                 "No such attribute '%S'", name);
164  
-        }
165 165
 
166 166
         return VTABLE_get_pmc_keyed_int(interp, obj->attrib_store, index);
167 167
     }
@@ -198,18 +198,22 @@ Queries this object's class to find the method with the given name.
198 198
 
199 199
 */
200 200
     PMC *find_method(STRING *name) {
201  
-        Parrot_Object * const obj = PARROT_OBJECT(SELF);
202  
-        Parrot_Class * const _class = PARROT_CLASS(obj->_class);
203  
-        PMC *method = PMCNULL;
  201
+        Parrot_Object * const obj    = PARROT_OBJECT(SELF);
  202
+        Parrot_Class  * const _class = PARROT_CLASS(obj->_class);
  203
+        PMC           *method        = PMCNULL;
204 204
 
205 205
         /* Walk and search. One day, we'll use the cache first. */
206  
-        const int num_classes = VTABLE_elements(interp, _class->all_parents);
207  
-        const int all_in_universe = !PObj_HasAlienParents_TEST(obj->_class);
208  
-        int alien_parents_pos = VTABLE_elements(interp, _class->attrib_metadata);
  206
+        const int num_classes        = VTABLE_elements(interp,
  207
+                                                      _class->all_parents);
  208
+        const int all_in_universe    = !PObj_HasAlienParents_TEST(obj->_class);
  209
+        int       alien_parents_pos  = VTABLE_elements(interp,
  210
+                                                      _class->attrib_metadata);
209 211
         int i;
  212
+
210 213
         for (i = 0; i < num_classes; i++) {
211 214
             /* Get the class. */
212  
-            PMC * const cur_class = VTABLE_get_pmc_keyed_int(interp, _class->all_parents, i);
  215
+            PMC * const cur_class =
  216
+                VTABLE_get_pmc_keyed_int(interp, _class->all_parents, i);
213 217
 
214 218
             /* If it's from this universe or the class doesn't inherit from
215 219
              * anything outside of it... */
@@ -233,7 +237,7 @@ Queries this object's class to find the method with the given name.
233 237
                      * passed. Therefore, we need to close the NCI and make it
234 238
                      * into a BoundNCI. */
235 239
                     if (method->vtable->base_type == enum_class_NCI) {
236  
-                        method = VTABLE_clone(interp, method);
  240
+                        method         = VTABLE_clone(interp, method);
237 241
                         method->vtable = interp->vtables[enum_class_Bound_NCI];
238 242
                         VTABLE_set_pmc(interp, method, del_class);
239 243
                     }
@@ -258,8 +262,7 @@ Get the class PMC representing the class that this object is an instance of.
258 262
 =cut
259 263
 
260 264
 */
261  
-    PMC *get_class()
262  
-    {
  265
+    PMC *get_class() {
263 266
         return PARROT_OBJECT(SELF)->_class;
264 267
     }
265 268
 
@@ -273,8 +276,7 @@ non-zero value if it does.
273 276
 =cut
274 277
 
275 278
 */
276  
-    INTVAL can(STRING *method_name)
277  
-    {
  279
+    INTVAL can(STRING *method_name) {
278 280
         /* Just use find_method and see it if finds anything. */
279 281
         const PMC * const method = VTABLE_find_method(interp, SELF, method_name);
280 282
         return !PMC_IS_NULL(method);
@@ -289,8 +291,7 @@ Returns whether the class is or inherits from C<*classname>.
289 291
 =cut
290 292
 
291 293
 */
292  
-    INTVAL isa(STRING *classname)
293  
-    {
  294
+    INTVAL isa(STRING *classname) {
294 295
         PMC   *_class;
295 296
 
296 297
         if (SUPER(classname))
38  src/pmc/resizablebooleanarray.pmc
... ...
@@ -1,5 +1,5 @@
1 1
 /*
2  
-Copyright (C) 2001-2005, The Perl Foundation.
  2
+Copyright (C) 2001-2007, The Perl Foundation.
3 3
 $Id$
4 4
 
5 5
 =head1 NAME
@@ -8,10 +8,9 @@ src/pmc/resizablebooleanarray.pmc - resizable array for booleans only
8 8
 
9 9
 =head1 DESCRIPTION
10 10
 
11  
-The C<ResizableBooleanArray PMC> implements an array of resizable size,
12  
-which stores booleans.
13  
-It uses the C<Boolean PMC> for all conversions.
14  
-The C<ResizableBooleanArray PMC> extends the C<FixedBooleanArray PMC>.
  11
+The C<ResizableBooleanArray PMC> implements an array of resizable size, which
  12
+stores booleans.  It uses the C<Boolean PMC> for all conversions.  The
  13
+C<ResizableBooleanArray PMC> extends the C<FixedBooleanArray PMC>.
15 14
 
16 15
 =head2 Functions
17 16
 
@@ -55,6 +54,7 @@ Returns the integer value of the element at index C<key>.
55 54
 
56 55
     INTVAL get_integer_keyed_int(INTVAL key) {
57 56
         INTVAL offsetkey;
  57
+
58 58
         /* Try to make negative index into a real index */
59 59
         if (key < 0) {
60 60
             key = SELF.elements() + key;
@@ -67,6 +67,7 @@ Returns the integer value of the element at index C<key>.
67 67
 
68 68
         /* Check if key is greater than allocated size */
69 69
         offsetkey = key + PMC_int_val2(SELF);
  70
+
70 71
         if (offsetkey >= PMC_int_val(SELF))
71 72
             DYNSELF.set_integer_native(key+1);
72 73
 
@@ -98,6 +99,7 @@ Sets the integer value of the element at index C<key> to C<value>.
98 99
 
99 100
         /* Check if key is greater than allocated size */
100 101
         offsetkey = key + PMC_int_val2(SELF);
  102
+
101 103
         if (offsetkey >= PMC_int_val(SELF))
102 104
             DYNSELF.set_integer_native(key+1);
103 105
 
@@ -137,7 +139,7 @@ Resizes the array to C<size> elements.
137 139
         old_bytesize  = ROUND_BYTES(oldsize);
138 140
 
139 141
         /* Nothing allocated yet */
140  
-        if (! PMC_data(SELF))
  142
+        if (!PMC_data(SELF))
141 143
             PMC_data(SELF) = mem_sys_allocate_zeroed(new_bytesize);
142 144
 
143 145
         /* The size is different, and doesn't fit within the current
@@ -188,7 +190,7 @@ Removes and returns the last element.
188 190
             real_exception(interp, NULL, E_IndexError,
189 191
                 "ResizableBooleanArray: Can't pop from an empty array!");
190 192
 
191  
-        size = PMC_int_val(SELF) - PMC_int_val2(SELF);
  193
+        size  = PMC_int_val(SELF) - PMC_int_val2(SELF);
192 194
         value = DYNSELF.get_integer_keyed_int(size - 1);
193 195
         DYNSELF.set_integer_native(size - 1);
194 196
 
@@ -342,13 +344,15 @@ Used to archive the string.
342 344
             and use it during thaw?
343 345
         */
344 346
 
345  
-        IMAGE_IO * const io = info->image_io;
346  
-        STRING *s;
347  
-        const INTVAL size = ROUND_BYTES(PMC_int_val(SELF));
  347
+        IMAGE_IO * const io   = info->image_io;
  348
+        const INTVAL     size = ROUND_BYTES(PMC_int_val(SELF));
  349
+        STRING           *s;
348 350
 
349 351
         io->vtable->push_integer(INTERP, io, PMC_int_val2(SELF));
350 352
         io->vtable->push_integer(INTERP, io, PMC_int_val(SELF));
  353
+
351 354
         s = string_from_cstring(INTERP, PMC_data_typed(SELF, char *), size);
  355
+
352 356
         io->vtable->push_string(INTERP, io, s);
353 357
     }
354 358
 
@@ -362,15 +366,15 @@ Used to unarchive the string.
362 366
 
363 367
 */
364 368
     void thaw(visit_info *info) {
365  
-        IMAGE_IO * const io = info->image_io;
366  
-        const INTVAL headPos = io->vtable->shift_integer(INTERP, io);
367  
-        const INTVAL tailPos = io->vtable->shift_integer(INTERP, io);
368  
-        STRING * const s = io->vtable->shift_string(INTERP, io);
  369
+        IMAGE_IO * const io      = info->image_io;
  370
+        const INTVAL     headPos = io->vtable->shift_integer(INTERP, io);
  371
+        const INTVAL     tailPos = io->vtable->shift_integer(INTERP, io);
  372
+        STRING * const   s       = io->vtable->shift_string(INTERP, io);
369 373
 
370  
-        PMC_data(SELF) = mem_sys_allocate_zeroed(s->bufused);
  374
+        PMC_data(SELF)           = mem_sys_allocate_zeroed(s->bufused);
371 375
         mem_sys_memcopy(PMC_data(SELF), s->strstart, s->bufused);
372  
-        PMC_int_val2(SELF) = headPos;
373  
-        PMC_int_val(SELF) = tailPos;
  376
+        PMC_int_val2(SELF)       = headPos;
  377
+        PMC_int_val(SELF)        = tailPos;
374 378
     }
375 379
 
376 380
 }  /* pmclass */
78  src/pmc/timer.pmc
@@ -9,20 +9,20 @@ src/pmc/timer.pmc - Timer
9 9
 =head1 SYNOPSIS
10 10
 
11 11
     new P0, 'Timer'
12  
-    set P0[.PARROT_TIMER_SEC], I_seconds        # whole seconds
13  
-    set P0[.PARROT_TIMER_USEC], I_micro seconds # and/or micro seconds
14  
-    set P0[.PARROT_TIMER_NSEC], N_seconds_frac  # or fraction in seconds
15  
-    set P0[.PARROT_TIMER_REPEAT], I_repeat      # 0 = one shot ...
16  
-    set P0[.PARROT_TIMER_HANDLER], P_sub        # set handler sub PMC
17  
-    invoke P0                                   # start timer
18  
-    set P0[.PARROT_TIMER_RUNNING], 1            # same
  12
+    set P0[.PARROT_TIMER_SEC],     I_seconds       # whole seconds
  13
+    set P0[.PARROT_TIMER_USEC],    I_micro seconds # and/or micro seconds
  14
+    set P0[.PARROT_TIMER_NSEC],    N_seconds_frac  # or fraction in seconds
  15
+    set P0[.PARROT_TIMER_REPEAT],  I_repeat        # 0 = one shot ...
  16
+    set P0[.PARROT_TIMER_HANDLER], P_sub           # set handler sub PMC
  17
+    invoke P0                                      # start timer
  18
+    set P0[.PARROT_TIMER_RUNNING], 1               # same
19 19
 
20  
-    new P0, 'Timer', P1                         # set everything
  20
+    new P0, 'Timer', P1                            # set everything
21 21
 
22  
-    set I0, P0[.PARROT_TIMER_SEC]               # query current timer status
  22
+    set I0, P0[.PARROT_TIMER_SEC]                  # query current timer status
23 23
     set N0, P0[.PARROT_TIMER_NSEC]
24 24
     ...
25  
-    set P0[.PARROT_TIMER_RUNNING], 0            # turn timer off
  25
+    set P0[.PARROT_TIMER_RUNNING], 0               # turn timer off
26 26
 
27 27
 
28 28
 =head1 DESCRIPTION
@@ -37,7 +37,7 @@ code.
37 37
 The Timer resolution is operating system dependent. It's only guaranteed
38 38
 that the Timer will fire some time after the programmed interval.
39 39
 
40  
-The Timer stops after invoking the handler (repeat+1) times. To create a
  40
+The Timer stops after invoking the handler (repeat + 1) times. To create a
41 41
 Timer that will run forever, set "repeat" to -1. Turning the Timer off
42 42
 preserves set values; the Timer is not destroyed.
43 43
 
@@ -84,7 +84,7 @@ Adds a new timer event to the event queue.
84 84
 static void
85 85
 add_timer(PARROT_INTERP, PMC *pmc)
86