[svn:parrot] r42462 - in trunk/compilers: imcc pirc/src

darbelo at svn.parrot.org darbelo at svn.parrot.org
Thu Nov 12 21:51:33 UTC 2009


Author: darbelo
Date: Thu Nov 12 21:51:24 2009
New Revision: 42462
URL: https://trac.parrot.org/parrot/changeset/42462

Log:
Add ARGIN() macros to parameters, ASSERT_ARGS() and headerize in IMCC's constant pmc creation code.

Modified:
   trunk/compilers/imcc/pbc.c
   trunk/compilers/pirc/src/bcgen.c
   trunk/compilers/pirc/src/bcgen.h

Modified: trunk/compilers/imcc/pbc.c
==============================================================================
--- trunk/compilers/imcc/pbc.c	Thu Nov 12 21:12:48 2009	(r42461)
+++ trunk/compilers/imcc/pbc.c	Thu Nov 12 21:51:24 2009	(r42462)
@@ -165,6 +165,13 @@
     SHIM(void *param))
         __attribute__nonnull__(1);
 
+static void init_fixedintegerarray_from_string(PARROT_INTERP,
+    ARGIN(PMC *p),
+    ARGIN(STRING *s))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
 static void make_new_sub(PARROT_INTERP, ARGIN(IMC_Unit *unit))
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
@@ -258,6 +265,11 @@
     , PARROT_ASSERT_ARG(ins_line))
 #define ASSERT_ARGS_imcc_globals_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_init_fixedintegerarray_from_string \
+     __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(p) \
+    , PARROT_ASSERT_ARG(s))
 #define ASSERT_ARGS_make_new_sub __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(unit))
@@ -1673,7 +1685,8 @@
 
 /*
 
-=item C<static void init_fixedintegerarray_from_string(PARROT_INTERP, PMC *p, STRING *s)>
+=item C<static void init_fixedintegerarray_from_string(PARROT_INTERP, PMC *p,
+STRING *s)>
 
 Initializes the passed FIA from a string representation I<"(el0, el1, ...)">.
 
@@ -1682,8 +1695,9 @@
 */
 
 static void
-init_fixedintegerarray_from_string(PARROT_INTERP, PMC *p, STRING *s)
+init_fixedintegerarray_from_string(PARROT_INTERP, ARGIN(PMC *p), ARGIN(STRING *s))
 {
+    ASSERT_ARGS(init_fixedintegerarray_from_string)
     INTVAL  n, elem, i, l;
     char   *src, *chr, *start;
     int     base;

Modified: trunk/compilers/pirc/src/bcgen.c
==============================================================================
--- trunk/compilers/pirc/src/bcgen.c	Thu Nov 12 21:12:48 2009	(r42461)
+++ trunk/compilers/pirc/src/bcgen.c	Thu Nov 12 21:51:24 2009	(r42462)
@@ -858,7 +858,8 @@
 
 */
 int
-emit_pbc_key(bytecode * const bc, key * const k) {
+emit_pbc_key(ARGIN(bytecode * const bc), ARGIN(key * const k))
+{
     ASSERT_ARGS(emit_pbc_key)
     key_entry  *iter;
     opcode_t   *key;

Modified: trunk/compilers/pirc/src/bcgen.h
==============================================================================
--- trunk/compilers/pirc/src/bcgen.h	Thu Nov 12 21:12:48 2009	(r42461)
+++ trunk/compilers/pirc/src/bcgen.h	Thu Nov 12 21:51:24 2009	(r42462)
@@ -162,6 +162,10 @@
 emit_opcode(ARGIN(bytecode * const bc), opcode_t op)
         __attribute__nonnull__(1);
 
+int emit_pbc_key(ARGIN(bytecode * const bc), ARGIN(key * const k))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
 FLOATVAL get_num_const(ARGIN(bytecode * const bc), unsigned index)
         __attribute__nonnull__(1);
 
@@ -222,7 +226,9 @@
        PARROT_ASSERT_ARG(bc))
 #define ASSERT_ARGS_emit_opcode __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(bc))
-#define ASSERT_ARGS_emit_pbc_key __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_emit_pbc_key __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(bc) \
+    , PARROT_ASSERT_ARG(k))
 #define ASSERT_ARGS_get_num_const __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(bc))
 #define ASSERT_ARGS_get_pmc_const __attribute__unused__ int _ASSERT_ARGS_CHECK = (\


More information about the parrot-commits mailing list