[svn:parrot] r45096 - trunk/src

petdance at svn.parrot.org petdance at svn.parrot.org
Mon Mar 22 04:17:37 UTC 2010


Author: petdance
Date: Mon Mar 22 04:17:37 2010
New Revision: 45096
URL: https://trac.parrot.org/parrot/changeset/45096

Log:
consting and localizing

Modified:
   trunk/src/pbc_merge.c

Modified: trunk/src/pbc_merge.c
==============================================================================
--- trunk/src/pbc_merge.c	Mon Mar 22 04:08:22 2010	(r45095)
+++ trunk/src/pbc_merge.c	Mon Mar 22 04:17:37 2010	(r45096)
@@ -574,13 +574,14 @@
     opcode_t num_mappings = 0;
     opcode_t num_lines    = 0;
 
-    int      i, j;
+    int i;
 
     /* We need to merge both the mappings and the list of line numbers.
        The line numbers can just be concatenated. The mappings must have
        their offsets fixed up. */
     for (i = 0; i < num_inputs; i++) {
-        PackFile_Debug *in_seg = inputs[i]->pf->cur_cs->debugs;
+        const PackFile_Debug * const in_seg = inputs[i]->pf->cur_cs->debugs;
+        int j;
 
         /* Concatenate line numbers. */
         lines = mem_gc_realloc_n_typed(interp, lines,
@@ -595,8 +596,9 @@
                 PackFile_DebugFilenameMapping*);
 
         for (j = 0; j < in_seg->num_mappings; j++) {
-            PackFile_DebugFilenameMapping *mapping = mem_gc_allocate_typed(
-                    interp, PackFile_DebugFilenameMapping);
+            PackFile_DebugFilenameMapping * const mapping =
+                mem_gc_allocate_typed(interp, PackFile_DebugFilenameMapping);
+
             STRUCT_COPY(mapping, in_seg->mappings[j]);
             mapping->offset   += num_lines;
             mapping->filename += inputs[i]->const_start;


More information about the parrot-commits mailing list