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

petdance at svn.parrot.org petdance at svn.parrot.org
Mon Mar 29 23:41:29 UTC 2010


Author: petdance
Date: Mon Mar 29 23:41:28 2010
New Revision: 45290
URL: https://trac.parrot.org/parrot/changeset/45290

Log:
more consting and headerizing

Modified:
   trunk/src/pmc/imageiosize.pmc
   trunk/src/pmc/parrotthread.pmc

Modified: trunk/src/pmc/imageiosize.pmc
==============================================================================
--- trunk/src/pmc/imageiosize.pmc	Mon Mar 29 23:25:37 2010	(r45289)
+++ trunk/src/pmc/imageiosize.pmc	Mon Mar 29 23:41:28 2010	(r45290)
@@ -18,14 +18,30 @@
 
 /* HEADERIZER HFILE: none */
 /* HEADERIZER BEGIN: static */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+
+static void visit_todo_list_freeze(PARROT_INTERP,
+    ARGIN(PMC* pmc),
+    ARGMOD(PMC* info))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        FUNC_MODIFIES(* info);
+
+#define ASSERT_ARGS_visit_todo_list_freeze __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pmc) \
+    , PARROT_ASSERT_ARG(info))
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
 static void
-visit_todo_list_freeze(PARROT_INTERP, PMC* pmc, PMC* info) {
+visit_todo_list_freeze(PARROT_INTERP, ARGIN(PMC* pmc), ARGMOD(PMC* info))
+{
     int is_new = 0;
 
     if (!PMC_IS_NULL(pmc)) {
-        Hash *hash = (Hash *)VTABLE_get_pointer(interp, PARROT_IMAGEIOSIZE(info)->seen);
+        Hash * const hash = (Hash *)VTABLE_get_pointer(interp, PARROT_IMAGEIOSIZE(info)->seen);
         HashBucket * const b = parrot_hash_get_bucket(interp, hash, pmc);
         is_new = !b;
     }
@@ -33,7 +49,8 @@
     VTABLE_push_integer(interp, info, 0);
 
     if (is_new) {
-        Hash *hash = (Hash *)VTABLE_get_pointer(interp, PARROT_IMAGEIOSIZE(info)->seen);
+        Hash * const hash = (Hash *)VTABLE_get_pointer(interp, PARROT_IMAGEIOSIZE(info)->seen);
+
         parrot_hash_put(interp, hash, pmc, pmc);
         VTABLE_push_integer(interp, info, pmc->vtable->base_type);
         VTABLE_push_pmc(interp, PARROT_IMAGEIOSIZE(info)->todo, pmc);
@@ -117,7 +134,7 @@
 */
 
     VTABLE PMC *get_pmc() {
-        PMC *ret = Parrot_pmc_new(INTERP, enum_class_Integer);
+        PMC * const ret = Parrot_pmc_new(INTERP, enum_class_Integer);
         VTABLE_set_integer_native(INTERP, ret, PARROT_IMAGEIOSIZE(SELF)->size);
         return ret;
     }
@@ -161,7 +178,7 @@
 */
 
     VTABLE void push_integer(INTVAL v) {
-        size_t len = PF_size_integer() * sizeof (opcode_t);
+        const size_t len = PF_size_integer() * sizeof (opcode_t);
         PARROT_IMAGEIOSIZE(SELF)->size += len;
     }
 
@@ -178,7 +195,7 @@
 
     VTABLE void push_float(FLOATVAL v)
     {
-        size_t len = PF_size_number() * sizeof (opcode_t);
+        const size_t len = PF_size_number() * sizeof (opcode_t);
         PARROT_IMAGEIOSIZE(SELF)->size += len;
     }
 
@@ -195,7 +212,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);
         PARROT_IMAGEIOSIZE(SELF)->size += len;
     }
 

Modified: trunk/src/pmc/parrotthread.pmc
==============================================================================
--- trunk/src/pmc/parrotthread.pmc	Mon Mar 29 23:25:37 2010	(r45289)
+++ trunk/src/pmc/parrotthread.pmc	Mon Mar 29 23:41:28 2010	(r45290)
@@ -44,10 +44,25 @@
 /* HEADERIZER BEGIN: static */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
+static INTVAL do_thread_run(PARROT_INTERP,
+    ARGIN(PMC *thread),
+    INTVAL clone_flags,
+    ARGIN(PMC *sub),
+    ARGIN(PMC *args))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(4)
+        __attribute__nonnull__(5);
+
 static void stop_GC(ARGIN(Interp *parent), ARGIN(Interp *thread))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
+#define ASSERT_ARGS_do_thread_run __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(thread) \
+    , PARROT_ASSERT_ARG(sub) \
+    , PARROT_ASSERT_ARG(args))
 #define ASSERT_ARGS_stop_GC __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(parent) \
     , PARROT_ASSERT_ARG(thread))
@@ -72,9 +87,11 @@
    coke's]
  */
 
-static INTVAL do_thread_run(PARROT_INTERP, PMC *thread,
-                            INTVAL clone_flags, PMC *sub, PMC *args) {
-    INTVAL tid = VTABLE_get_integer(interp, thread);
+static INTVAL
+do_thread_run(PARROT_INTERP, ARGIN(PMC *thread),
+                            INTVAL clone_flags, ARGIN(PMC *sub), ARGIN(PMC *args))
+{
+    const INTVAL tid = VTABLE_get_integer(interp, thread);
 
     if (PMC_IS_NULL(sub)) {
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,


More information about the parrot-commits mailing list