[svn:parrot] r44007 - trunk/compilers/pirc/src

bacek at svn.parrot.org bacek at svn.parrot.org
Tue Feb 16 11:11:09 UTC 2010


Author: bacek
Date: Tue Feb 16 11:11:08 2010
New Revision: 44007
URL: https://trac.parrot.org/parrot/changeset/44007

Log:
PIRC: Really use headerizer

Modified:
   trunk/compilers/pirc/src/pirmacro.c
   trunk/compilers/pirc/src/pirmacro.h

Modified: trunk/compilers/pirc/src/pirmacro.c
==============================================================================
--- trunk/compilers/pirc/src/pirmacro.c	Tue Feb 16 10:39:57 2010	(r44006)
+++ trunk/compilers/pirc/src/pirmacro.c	Tue Feb 16 11:11:08 2010	(r44007)
@@ -9,7 +9,7 @@
 #include "pircompiler.h"
 #include "parrot/parrot.h"
 
-/* HEADERIZER HFILE: none */
+/* HEADERIZER HFILE: compilers/pirc/src/pirmacro.h */
 
 /* HEADERIZER BEGIN: static */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
@@ -50,8 +50,9 @@
 PARROT_IGNORABLE_RESULT
 PARROT_CAN_RETURN_NULL
 macro_def *
-new_macro(macro_table * const table, char const * const name, int lineno, int takes_args,
-          unsigned initsize)
+new_macro(ARGIN(macro_table * const table),
+        ARGIN(char const * const name), int lineno, int takes_args,
+        unsigned initsize)
 {
     macro_def *macro   = (macro_def *)mem_sys_allocate(sizeof (macro_def));
 
@@ -96,7 +97,8 @@
 
 /*
 
-=item C<void add_macro_param(macro_def * const macro, char const * const name)>
+=item C<void add_macro_param(ARGIN*macro_def * const macro), char const * const
+name)>
 
 Add a macro parameter by name of C<name> to the macro definition C<macro>.
 
@@ -104,7 +106,8 @@
 
 */
 void
-add_macro_param(macro_def * const macro, char const * const name)
+add_macro_param(ARGIN*macro_def * const macro),
+        ARGIN(char const * const name))
 {
     macro_param *param = new_macro_param(name);
     param->next        = macro->parameters;
@@ -124,8 +127,9 @@
 
 */
 void
-new_macro_const(macro_table * const table, char const * const name, char const * const value,
-                      int lineno)
+new_macro_const(ARGIN(macro_table * const table),
+        ARGIN(char const * const name),
+        ARGIN(char const * const value), int lineno)
 {
     /* macro constants are just macros, but they have no body; the value is already
      * parsed and allocated in memory.
@@ -199,7 +203,9 @@
 
 */
 void
-store_macro_string(macro_def * const macro, char const * const str, ...)
+store_macro_string(ARGIN(macro_def * const macro),
+        ARGIN(char const * const str),
+        ...)
 {
     va_list arg_ptr;
 
@@ -228,7 +234,8 @@
 PARROT_WARN_UNUSED_RESULT
 PARROT_CAN_RETURN_NULL
 macro_def *
-find_macro(macro_table * const table, char const * const name)
+find_macro(ARGIN(macro_table * const table),
+        ARGIN(char const * const name))
 {
     macro_def *iter = table->definitions;
 
@@ -289,7 +296,7 @@
 
 */
 void
-delete_macro_table(macro_table * table)
+delete_macro_table(ARGMOD(macro_table * table))
 {
     mem_sys_free(table);
 }
@@ -305,7 +312,8 @@
 
 */
 void
-declare_macro_local(macro_def * const macro, char const * const name)
+declare_macro_local(ARGIN(macro_def * const macro),
+        ARGIN(char const * const name))
 {
     macro_param * param = new_macro_param(name);
     param->next         = macro->macrolocals;
@@ -325,7 +333,8 @@
 */
 PARROT_WARN_UNUSED_RESULT
 int
-is_macro_local(macro_def * const macro, char const * const name)
+is_macro_local(ARGIN(macro_def * const macro),
+        ARGIN(char const * const name))
 {
     macro_param *iter = macro->macrolocals;
 

Modified: trunk/compilers/pirc/src/pirmacro.h
==============================================================================
--- trunk/compilers/pirc/src/pirmacro.h	Tue Feb 16 10:39:57 2010	(r44006)
+++ trunk/compilers/pirc/src/pirmacro.h	Tue Feb 16 11:11:08 2010	(r44007)
@@ -80,33 +80,113 @@
 } macro_table;
 
 
+/* HEADERIZER BEGIN: compilers/pirc/src/pirmacro.c */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
-
-
-macro_def *new_macro(macro_table * const table, char const * const name, int lineno,
-                     int takes_args, unsigned initsize);
-
-void add_macro_param(macro_def * const macro, char const * const name);
-
-void new_macro_const(macro_table * const table, char const * const name,
-                     char const * const value, int lineno);
-
-
-macro_def *find_macro(macro_table * const table, char const * const name);
-
-macro_table * new_macro_table(macro_table * const current);
-
-void store_macro_char(macro_def * const macro, char c) ;
-
-void store_macro_string(macro_def * const macro, char const * const str, ...);
-
-macro_param * new_macro_param(char const * const value);
-
-void declare_macro_local(macro_def * const macro, char const * const name);
-
-int is_macro_local(macro_def * const macro, char const * const name);
-
-void delete_macro_table(macro_table * table);
+void add_macro_param(
+    ARGIN*macro_def * const macro),
+    ARGIN(char const * const name))
+        __attribute__nonnull__(2);
+
+void declare_macro_local(
+    ARGIN(macro_def * const macro),
+    ARGIN(char const * const name))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+void delete_macro_table(ARGMOD(macro_table * table))
+        __attribute__nonnull__(1)
+        FUNC_MODIFIES(* table);
+
+PARROT_WARN_UNUSED_RESULT
+PARROT_CAN_RETURN_NULL
+macro_def * find_macro(
+    ARGIN(macro_table * const table),
+    ARGIN(char const * const name))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_WARN_UNUSED_RESULT
+int is_macro_local(
+    ARGIN(macro_def * const macro),
+    ARGIN(char const * const name))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_MALLOC
+PARROT_IGNORABLE_RESULT
+PARROT_CAN_RETURN_NULL
+macro_def * new_macro(
+    ARGIN(macro_table * const table),
+    ARGIN(char const * const name),
+    int lineno,
+    int takes_args,
+    unsigned initsize)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+void new_macro_const(
+    ARGIN(macro_table * const table),
+    ARGIN(char const * const name),
+    ARGIN(char const * const value),
+    int lineno)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
+
+PARROT_MALLOC
+PARROT_WARN_UNUSED_RESULT
+PARROT_CANNOT_RETURN_NULL
+macro_param * new_macro_param(ARGIN(char const * const value))
+        __attribute__nonnull__(1);
+
+PARROT_MALLOC
+PARROT_CANNOT_RETURN_NULL
+PARROT_WARN_UNUSED_RESULT
+macro_table * new_macro_table(ARGIN(macro_table * const current))
+        __attribute__nonnull__(1);
+
+void store_macro_char(ARGIN(macro_def * const macro), char c)
+        __attribute__nonnull__(1);
+
+void store_macro_string(
+    ARGIN(macro_def * const macro),
+    ARGIN(char const * const str),
+    ...)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+#define ASSERT_ARGS_add_macro_param __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_declare_macro_local __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(macro) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_delete_macro_table __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(table))
+#define ASSERT_ARGS_find_macro __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(table) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_is_macro_local __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(macro) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_new_macro __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(table) \
+    , PARROT_ASSERT_ARG(name))
+#define ASSERT_ARGS_new_macro_const __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(table) \
+    , PARROT_ASSERT_ARG(name) \
+    , PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_new_macro_param __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(value))
+#define ASSERT_ARGS_new_macro_table __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(current))
+#define ASSERT_ARGS_store_macro_char __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(macro))
+#define ASSERT_ARGS_store_macro_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(macro) \
+    , PARROT_ASSERT_ARG(str))
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: compilers/pirc/src/pirmacro.c */
 
 #endif /* PARROT_PIR_PIRMACRO_H_GUARD */
 


More information about the parrot-commits mailing list