Author: petdance
Date: Sun Jun  3 12:33:31 2007
New Revision: 18786

Modified:
   trunk/config/gen/makefiles/root.in
   trunk/include/parrot/pic.h
   trunk/include/parrot/string_funcs.h
   trunk/src/mmd.c
   trunk/src/pic.c
   trunk/tools/build/headerize.pl

Log:
pic.h's function declarations are now headerizered

Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in  (original)
+++ trunk/config/gen/makefiles/root.in  Sun Jun  3 12:33:31 2007
@@ -1827,6 +1827,7 @@
        $(PERL) $(BUILD_TOOLS_DIR)/headerize.pl \
                src/string.o \
                src/string_primitives.o \
+               src/pic.o \
 
 ###############################################################################
 #

Modified: trunk/include/parrot/pic.h
==============================================================================
--- trunk/include/parrot/pic.h  (original)
+++ trunk/include/parrot/pic.h  Sun Jun  3 12:33:31 2007
@@ -65,26 +65,50 @@
     size_t n_mics;                      /* range check, debugging mainly */
 } Parrot_PIC_store;
 
+typedef int (*arg_pass_f)(Interp *, PMC *sig,
+            char *src_base, void **src_pc, char *dest_base, void **dest_pc);
+
 /* more or less private interfaces */
-void parrot_PIC_prederef(Interp *, opcode_t op, void **pc_pred, int type);
-void parrot_PIC_alloc_store(Interp *, struct PackFile_ByteCode *, size_t n);
-void parrot_PIC_destroy(Interp *, struct PackFile_ByteCode *);
-int  parrot_PIC_op_is_cached(Interp *, int op_code);
-Parrot_MIC* parrot_PIC_alloc_mic(Interp*, size_t n);
-Parrot_PIC* parrot_PIC_alloc_pic(Interp*);
-
-void parrot_pic_find_infix_v_pp(Interp *, PMC *left, PMC *right,
-                Parrot_MIC *mic, opcode_t *cur_opcode);
-void * parrot_pic_opcode(Interp *, INTVAL op);
 
-typedef int (*arg_pass_f)(Interp *, PMC *sig,
-        char *src_base, void **src_pc, char *dest_base, void **dest_pc);
+/* HEADERIZER BEGIN: src/pic.c */
+
+Parrot_MIC* parrot_PIC_alloc_mic( Interp *interp, size_t n );
+Parrot_PIC* parrot_PIC_alloc_pic( Interp *interp );
+void parrot_PIC_alloc_store( Interp *interp,
+    struct PackFile_ByteCode *cs /*NN*/,
+    size_t n )
+        __attribute__nonnull__(2);
+
+void parrot_PIC_destroy( Interp *interp, struct PackFile_ByteCode *cs /*NN*/ )
+        __attribute__nonnull__(2);
+
+int parrot_PIC_op_is_cached( Interp *interp, int op_code );
+void parrot_PIC_prederef( Interp *interp,
+    opcode_t op,
+    void **pc_pred,
+    int core );
+
+int parrot_pic_check_sig( Interp *interp,
+    const PMC *sig1 /*NN*/,
+    const PMC *sig2 /*NN*/,
+    int *type /*NN*/ )
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4);
+
+void parrot_pic_find_infix_v_pp( Interp *interp,
+    PMC *left /*NN*/,
+    PMC *right /*NN*/,
+    Parrot_MIC *mic /*NN*/,
+    opcode_t *cur_opcode /*NN*/ )
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        __attribute__nonnull__(5);
+
+void * parrot_pic_opcode( Interp *interp, INTVAL op );
+/* HEADERIZER END: src/pic.c */
 
-int parrot_pic_check_sig(Interp *, const PMC *sig1, const PMC *sig2, int *type)
-    __attribute__nonnull__(1)
-    __attribute__nonnull__(2)
-    __attribute__nonnull__(3)
-    __attribute__nonnull__(4);
 
 int parrot_pic_is_safe_to_jit(Interp *, PMC *sub,
         PMC *sig_args, PMC *sig_results, int *flags);

Modified: trunk/include/parrot/string_funcs.h
==============================================================================
--- trunk/include/parrot/string_funcs.h (original)
+++ trunk/include/parrot/string_funcs.h Sun Jun  3 12:33:31 2007
@@ -20,6 +20,7 @@
 /* Declarations of accessors */
 
 /* HEADERIZER BEGIN: src/string.c */
+
 PARROT_API STRING * Parrot_make_COW_reference( Interp *interp,
     STRING *s /*NULLOK*/ );
 
@@ -294,8 +295,10 @@
     char base,
     int minus )
         __attribute__nonnull__(2);
+
 /* HEADERIZER END: src/string.c */
 /* HEADERIZER BEGIN: src/string_primitives.c */
+
 PARROT_API UINTVAL Parrot_char_digit_value( Interp *interp,
     UINTVAL character );
 
@@ -310,6 +313,7 @@
     UINTVAL *offset /*NN*/,
     STRING *string )
         __attribute__nonnull__(2);
+
 /* HEADERIZER END: src/string_primitives.c */
 
 #endif /* PARROT_IN_CORE */

Modified: trunk/src/mmd.c
==============================================================================
--- trunk/src/mmd.c     (original)
+++ trunk/src/mmd.c     Sun Jun  3 12:33:31 2007
@@ -95,7 +95,7 @@
 
 funcptr_t
 get_mmd_dispatch_type(Interp *interp, INTVAL func_nr, INTVAL left_type,
-        INTVAL right_type, int *is_pmc)
+        INTVAL right_type, int *is_pmc /*NN*/)
 {
     funcptr_t func, func_;
     INTVAL r;

Modified: trunk/src/pic.c
==============================================================================
--- trunk/src/pic.c     (original)
+++ trunk/src/pic.c     Sun Jun  3 12:33:31 2007
@@ -76,6 +76,7 @@
 
 */
 
+/* HEADER: include/parrot/pic.h */
 #include "parrot/parrot.h"
 #include "parrot/oplib/ops.h"
 #include <assert.h>
@@ -121,7 +122,7 @@
 */
 
 void
-parrot_PIC_alloc_store(Interp *interp, PackFile_ByteCode *cs, size_t n)
+parrot_PIC_alloc_store(Interp *interp, struct PackFile_ByteCode * const cs 
/*NN*/, size_t n)
 {
     size_t size, poly;
     Parrot_PIC_store *store;
@@ -148,7 +149,7 @@
 }
 
 void
-parrot_PIC_destroy(Interp *interp, PackFile_ByteCode *cs)
+parrot_PIC_destroy(Interp *interp, struct PackFile_ByteCode * const cs /*NN*/)
 {
     Parrot_PIC_store *store;
 
@@ -231,19 +232,6 @@
     return --store->pic;
 }
 
-/*
-
-=item C<void parrot_PIC_prederef(Interp *, opcode_t op,
-                                 void **pc_pred, int type)>
-
-Define either the normal prederef function or the PIC stub, if PIC for
-this opcode function is available. Called from C<do_prederef>.
-
-=cut
-
-*/
-
-
 void *
 parrot_pic_opcode(Interp *interp, INTVAL op)
 {
@@ -370,7 +358,8 @@
  * the type PARROT_ARG_CONSTANT stands for mixed types or constants
  */
 int
-parrot_pic_check_sig(Interp *interp, const PMC *sig1, const PMC *sig2, int 
*type /*NN*/)
+parrot_pic_check_sig(Interp *interp, const PMC * const sig1 /*NN*/,
+        const PMC * const sig2 /*NN*/, int * const type /*NN*/)
 {
     int i, n, t0, t1, t2;
     t0 = 0; /* silence compiler uninit warning */
@@ -533,6 +522,18 @@
     return 1;
 }
 
+/*
+
+=item C<void parrot_PIC_prederef(Interp *, opcode_t op,
+                                 void **pc_pred, int type)>
+
+Define either the normal prederef function or the PIC stub, if PIC for
+this opcode function is available. Called from C<do_prederef>.
+
+=cut
+
+*/
+
 void
 parrot_PIC_prederef(Interp *interp, opcode_t op, void **pc_pred, int core)
 {
@@ -541,7 +542,7 @@
     Parrot_MIC *mic = NULL;
 
     if (parrot_PIC_op_is_cached(interp, op)) {
-        PackFile_ByteCode *cs = interp->code;
+        const PackFile_ByteCode * const cs = interp->code;
         size_t n = cur_opcode - (opcode_t*)cs->prederef.code;
         /*
          * pic_index is half the size of the code
@@ -630,8 +631,8 @@
 }
 
 void
-parrot_pic_find_infix_v_pp(Interp *interp, PMC *left, PMC *right,
-                Parrot_MIC *mic, opcode_t *cur_opcode)
+parrot_pic_find_infix_v_pp(Interp *interp, PMC * const left /*NN*/, PMC * 
const right /*NN*/,
+                Parrot_MIC * const mic /*NN*/, opcode_t * const cur_opcode 
/*NN*/)
 {
     funcptr_t func;
     int is_pmc;

Modified: trunk/tools/build/headerize.pl
==============================================================================
--- trunk/tools/build/headerize.pl      (original)
+++ trunk/tools/build/headerize.pl      Sun Jun  3 12:33:31 2007
@@ -278,7 +278,7 @@
             my $function_decls = join( "\n", @function_decls );
             my $STARTMARKER   = qr#/\* HEADERIZER BEGIN: $cfile \*/\n#;
             my $ENDMARKER     = qr#/\* HEADERIZER END: $cfile \*/\n?#;
-            $header =~ 
s#($STARTMARKER)(?:.*?)($ENDMARKER)#$1$function_decls$2#s
+            $header =~ 
s#($STARTMARKER)(?:.*?)($ENDMARKER)#$1\n$function_decls\n$2#s
                 or die "Need begin/end HEADERIZER markers for $cfile in 
$hfile\n";
         }    # for %cfiles
 

Reply via email to