[svn:parrot] r45277 - trunk/src/pmc

petdance at svn.parrot.org petdance at svn.parrot.org
Mon Mar 29 15:27:53 UTC 2010


Author: petdance
Date: Mon Mar 29 15:27:52 2010
New Revision: 45277
URL: https://trac.parrot.org/parrot/changeset/45277

Log:
consting

Modified:
   trunk/src/pmc/imageio.pmc
   trunk/src/pmc/packfileannotation.pmc

Modified: trunk/src/pmc/imageio.pmc
==============================================================================
--- trunk/src/pmc/imageio.pmc	Mon Mar 29 15:27:42 2010	(r45276)
+++ trunk/src/pmc/imageio.pmc	Mon Mar 29 15:27:52 2010	(r45277)
@@ -462,7 +462,7 @@
 
     VTABLE void push_string(STRING *v)
     {
-        size_t len = PF_size_string(v) * sizeof (opcode_t);
+        const size_t len = PF_size_string(v) * sizeof (opcode_t);
         ensure_buffer_size(INTERP, SELF, len);
         SET_VISIT_CURSOR(SELF, (char *)PF_store_string(GET_VISIT_CURSOR(SELF), v));
     }
@@ -575,7 +575,7 @@
     }
 
     VTABLE void set_string_native(STRING *image) {
-        UINTVAL header_length = GROW_TO_16_BYTE_BOUNDARY(PACKFILE_HEADER_BYTES);
+        const UINTVAL header_length = GROW_TO_16_BYTE_BOUNDARY(PACKFILE_HEADER_BYTES);
         int unpacked_length;
 
         PARROT_IMAGEIO(SELF)->what          = VISIT_THAW_NORMAL;

Modified: trunk/src/pmc/packfileannotation.pmc
==============================================================================
--- trunk/src/pmc/packfileannotation.pmc	Mon Mar 29 15:27:42 2010	(r45276)
+++ trunk/src/pmc/packfileannotation.pmc	Mon Mar 29 15:27:52 2010	(r45277)
@@ -1,5 +1,5 @@
 /*
-Copyright (C) 2001-2008, Parrot Foundation.
+Copyright (C) 2001-2010, Parrot Foundation.
 $Id$
 
 =head1 NAME
@@ -43,7 +43,7 @@
 */
 
     VTABLE void init() {
-        Parrot_PackfileAnnotation_attributes * attrs =
+        Parrot_PackfileAnnotation_attributes * const attrs =
                 PMC_data_typed(SELF, Parrot_PackfileAnnotation_attributes*);
 
         PObj_custom_mark_SET(SELF);
@@ -61,7 +61,7 @@
 */
 
     VTABLE void mark() {
-        Parrot_PackfileAnnotation_attributes * attrs =
+        Parrot_PackfileAnnotation_attributes * const attrs =
                 PARROT_PACKFILEANNOTATION(SELF);
 
         Parrot_gc_mark_STRING_alive(interp, attrs->name);
@@ -137,7 +137,7 @@
 
 */
     VTABLE INTVAL get_integer() {
-        Parrot_PackfileAnnotation_attributes * attrs = PARROT_PACKFILEANNOTATION(SELF);
+        Parrot_PackfileAnnotation_attributes * const attrs = PARROT_PACKFILEANNOTATION(SELF);
         if (attrs->value_type != PF_ANNOTATION_KEY_TYPE_INT)
             Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
                 "Trying to fetch wrong type of value from annotation");
@@ -155,7 +155,7 @@
 
 */
     VTABLE void set_integer_native(INTVAL value) {
-        Parrot_PackfileAnnotation_attributes * attrs = PARROT_PACKFILEANNOTATION(SELF);
+        Parrot_PackfileAnnotation_attributes * const attrs = PARROT_PACKFILEANNOTATION(SELF);
         attrs->value_type = PF_ANNOTATION_KEY_TYPE_INT;
         attrs->int_value  = value;
     }
@@ -170,7 +170,7 @@
 
 */
     VTABLE STRING * get_string() {
-        Parrot_PackfileAnnotation_attributes * attrs = PARROT_PACKFILEANNOTATION(SELF);
+        Parrot_PackfileAnnotation_attributes * const attrs = PARROT_PACKFILEANNOTATION(SELF);
         if (attrs->value_type != PF_ANNOTATION_KEY_TYPE_STR)
             Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
                 "Trying to fetch wrong type of value from annotation");
@@ -188,7 +188,7 @@
 
 */
     VTABLE void set_string_native(STRING * value) {
-        Parrot_PackfileAnnotation_attributes * attrs = PARROT_PACKFILEANNOTATION(SELF);
+        Parrot_PackfileAnnotation_attributes * const attrs = PARROT_PACKFILEANNOTATION(SELF);
         attrs->value_type = PF_ANNOTATION_KEY_TYPE_STR;
         attrs->str_value  = value;
     }
@@ -203,7 +203,7 @@
 
 */
     VTABLE FLOATVAL get_number() {
-        Parrot_PackfileAnnotation_attributes * attrs = PARROT_PACKFILEANNOTATION(SELF);
+        Parrot_PackfileAnnotation_attributes * const attrs = PARROT_PACKFILEANNOTATION(SELF);
         if (attrs->value_type != PF_ANNOTATION_KEY_TYPE_NUM)
             Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
                 "Trying to fetch wrong type of value from annotation");
@@ -221,7 +221,7 @@
 
 */
     VTABLE void set_number_native(FLOATVAL value) {
-        Parrot_PackfileAnnotation_attributes * attrs = PARROT_PACKFILEANNOTATION(SELF);
+        Parrot_PackfileAnnotation_attributes * const attrs = PARROT_PACKFILEANNOTATION(SELF);
         attrs->value_type = PF_ANNOTATION_KEY_TYPE_NUM;
         attrs->num_value  = value;
     }


More information about the parrot-commits mailing list