perl.cvs.parrot
[Top] [All Lists]

[svn:parrot] r19885 - in trunk: config/gen/makefiles include/parrot src

Subject: [svn:parrot] r19885 - in trunk: config/gen/makefiles include/parrot src src/packfile src/stm tools/build
From:
Date: Sat, 14 Jul 2007 21:02:10 -0700 PDT
Newsgroups: perl.cvs.parrot

Author: petdance
Date: Sat Jul 14 21:02:08 2007
New Revision: 19885

Modified:
   trunk/config/gen/makefiles/root.in
   trunk/include/parrot/intlist.h
   trunk/include/parrot/list.h
   trunk/include/parrot/pic.h
   trunk/include/parrot/pmc.h
   trunk/src/events.c
   trunk/src/list.c
   trunk/src/objects.c
   trunk/src/packfile.c
   trunk/src/packfile/pf_items.c
   trunk/src/pic.c
   trunk/src/pic_jit.c
   trunk/src/pmc.c
   trunk/src/pmc_freeze.c
   trunk/src/stm/backend.c
   trunk/tools/build/headerizer.pl

Log:
Slathering NOTNULL/NULLOK all over the codebase

Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in  (original)
+++ trunk/config/gen/makefiles/root.in  Sat Jul 14 21:02:08 2007
@@ -1856,9 +1856,16 @@
                -declundef \
                -show-summary \
                -exportlocal \
+               +linelen 80 \
+               +showdeephistory \
+               -showfunc \
+               -hints \
                \
-               src/string.c \
+               src/builtin.c \
                src/stacks.c \
+
+LATER = \
+               src/string.c \
                src/list.c \
                src/intlist.c \
 

Modified: trunk/include/parrot/intlist.h
==============================================================================
--- trunk/include/parrot/intlist.h      (original)
+++ trunk/include/parrot/intlist.h      Sat Jul 14 21:02:08 2007
@@ -49,8 +49,7 @@
 
 PARROT_MALLOC
 IntList * intlist_clone( PARROT_INTERP, const IntList *list/*NN*/ )
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
+        __attribute__nonnull__(1);
 
 void intlist_dump( NOTNULL(FILE *fp), NOTNULL(IntList *list), int verbose )
         __attribute__nonnull__(1)

Modified: trunk/include/parrot/list.h
==============================================================================
--- trunk/include/parrot/list.h (original)
+++ trunk/include/parrot/list.h Sat Jul 14 21:02:08 2007
@@ -167,7 +167,10 @@
         __attribute__nonnull__(2);
 
 PARROT_API
-void list_push( PARROT_INTERP, NOTNULL(List *list), void *item, int type )
+void list_push( PARROT_INTERP,
+    NOTNULL(List *list),
+    NULLOK(void *item),
+    int type )
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 

Modified: trunk/include/parrot/pic.h
==============================================================================
--- trunk/include/parrot/pic.h  (original)
+++ trunk/include/parrot/pic.h  Sat Jul 14 21:02:08 2007
@@ -127,8 +127,9 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-funcptr_t parrot_pic_JIT_sub( PARROT_INTERP, PMC *sub, int flags )
-        __attribute__nonnull__(1);
+funcptr_t parrot_pic_JIT_sub( PARROT_INTERP, NOTNULL(PMC *sub), int flags )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
 /* HEADERIZER END: src/pic_jit.c */
 

Modified: trunk/include/parrot/pmc.h
==============================================================================
--- trunk/include/parrot/pmc.h  (original)
+++ trunk/include/parrot/pmc.h  Sat Jul 14 21:02:08 2007
@@ -46,6 +46,7 @@
         __attribute__nonnull__(1);
 
 PARROT_API
+PARROT_CANNOT_RETURN_NULL
 PMC * pmc_new( PARROT_INTERP, INTVAL base_type )
         __attribute__nonnull__(1);
 
@@ -54,6 +55,7 @@
         __attribute__nonnull__(1);
 
 PARROT_API
+PARROT_CANNOT_RETURN_NULL
 PMC * pmc_new_noinit( PARROT_INTERP, INTVAL base_type )
         __attribute__nonnull__(1);
 
@@ -62,6 +64,7 @@
         __attribute__nonnull__(1);
 
 PARROT_API
+PARROT_CANNOT_RETURN_NULL
 PMC* pmc_reuse( PARROT_INTERP,
     NOTNULL(PMC *pmc),
     INTVAL new_type,

Modified: trunk/src/events.c
==============================================================================
--- trunk/src/events.c  (original)
+++ trunk/src/events.c  Sat Jul 14 21:02:08 2007
@@ -656,6 +656,7 @@
     }
 }
 
+PARROT_CAN_RETURN_NULL
 static void*
 io_thread(SHIM(void *data))
 {

Modified: trunk/src/list.c
==============================================================================
--- trunk/src/list.c    (original)
+++ trunk/src/list.c    Sat Jul 14 21:02:08 2007
@@ -218,7 +218,7 @@
 
 static void list_append( PARROT_INTERP,
     NOTNULL(List *list),
-    void *item,
+    NULLOK(void *item),
     int type,
     UINTVAL idx )
         __attribute__nonnull__(1)
@@ -238,7 +238,7 @@
 
 static void list_set( PARROT_INTERP,
     NOTNULL(List *list),
-    void *item,
+    NULLOK(void *item),
     INTVAL type,
     INTVAL idx )
         __attribute__nonnull__(1)
@@ -1033,7 +1033,7 @@
 */
 
 static void
-list_set(PARROT_INTERP, NOTNULL(List *list), void *item, INTVAL type, INTVAL 
idx)
+list_set(PARROT_INTERP, NOTNULL(List *list), NULLOK(void *item), INTVAL type, 
INTVAL idx)
 {
     const INTVAL oidx = idx;
     List_chunk *chunk = get_chunk(interp, list, (UINTVAL *)&idx);
@@ -1145,7 +1145,7 @@
 */
 
 static void
-list_append(PARROT_INTERP, NOTNULL(List *list), void *item, int type, UINTVAL 
idx)
+list_append(PARROT_INTERP, NOTNULL(List *list), NULLOK(void *item), int type, 
UINTVAL idx)
 {
     /* initially, list may be empty, also used by assign */
     while (idx >= list->cap)
@@ -1684,7 +1684,7 @@
 
 PARROT_API
 void
-list_push(PARROT_INTERP, NOTNULL(List *list), void *item, int type)
+list_push(PARROT_INTERP, NOTNULL(List *list), NULLOK(void *item), int type)
 {
     const INTVAL idx = list->start + list->length++;
 

Modified: trunk/src/objects.c
==============================================================================
--- trunk/src/objects.c (original)
+++ trunk/src/objects.c Sat Jul 14 21:02:08 2007
@@ -54,8 +54,9 @@
 static void do_initcall( PARROT_INTERP, PMC* _class, PMC *object, PMC *init )
         __attribute__nonnull__(1);
 
-static void fail_if_exist( PARROT_INTERP, PMC *name )
-        __attribute__nonnull__(1);
+static void fail_if_exist( PARROT_INTERP, NOTNULL(PMC *name) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
 PARROT_WARN_UNUSED_RESULT
 static PMC * find_method_direct_1( PARROT_INTERP,
@@ -253,7 +254,7 @@
 */
 
 static void
-fail_if_exist(PARROT_INTERP, PMC *name)
+fail_if_exist(PARROT_INTERP, NOTNULL(PMC *name))
 {
     INTVAL      type;
 

Modified: trunk/src/packfile.c
==============================================================================
--- trunk/src/packfile.c        (original)
+++ trunk/src/packfile.c        Sat Jul 14 21:02:08 2007
@@ -211,9 +211,10 @@
 
 static opcode_t * pf_debug_unpack( PARROT_INTERP,
     NOTNULL(PackFile_Segment *self),
-    opcode_t *cursor )
+    NOTNULL(opcode_t *cursor) )
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
 
 static INTVAL pf_register_standard_funcs( PARROT_INTERP, PackFile *pf )
         __attribute__nonnull__(1);
@@ -2016,7 +2017,7 @@
 */
 
 static opcode_t *
-pf_debug_unpack(PARROT_INTERP, NOTNULL(PackFile_Segment *self), opcode_t 
*cursor)
+pf_debug_unpack(PARROT_INTERP, NOTNULL(PackFile_Segment *self), 
NOTNULL(opcode_t *cursor))
 {
     PackFile_Debug * const debug = (PackFile_Debug *)self;
     PackFile_ByteCode *code;

Modified: trunk/src/packfile/pf_items.c
==============================================================================
--- trunk/src/packfile/pf_items.c       (original)
+++ trunk/src/packfile/pf_items.c       Sat Jul 14 21:02:08 2007
@@ -32,16 +32,45 @@
 
 /* HEADERIZER BEGIN: static */
 
-static void cvt_num12_num8( unsigned char *dest, const unsigned char *src );
-static void cvt_num12_num8_be( unsigned char *dest, const unsigned char *src );
-static void cvt_num12_num8_le( unsigned char *dest, unsigned char *src );
-static opcode_t fetch_op_be_4( unsigned char *b );
-static opcode_t fetch_op_be_8( unsigned char *b );
-static opcode_t fetch_op_le_4( unsigned char *b );
-static opcode_t fetch_op_le_8( unsigned char *b );
-static opcode_t fetch_op_mixed_be( unsigned char *b );
-static opcode_t fetch_op_mixed_le( unsigned char *b );
-static opcode_t fetch_op_test( unsigned char *b );
+static void cvt_num12_num8(
+    NOTNULL(unsigned char *dest),
+    NOTNULL(const unsigned char *src) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+static void cvt_num12_num8_be(
+    NOTNULL(unsigned char *dest),
+    NOTNULL(const unsigned char *src) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+static void cvt_num12_num8_le(
+    NOTNULL(unsigned char *dest),
+    NOTNULL(unsigned char *src) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+static opcode_t fetch_op_be_4( NOTNULL(unsigned char *b) )
+        __attribute__nonnull__(1);
+
+static opcode_t fetch_op_be_8( NOTNULL(unsigned char *b) )
+        __attribute__nonnull__(1);
+
+static opcode_t fetch_op_le_4( NOTNULL(unsigned char *b) )
+        __attribute__nonnull__(1);
+
+static opcode_t fetch_op_le_8( NOTNULL(unsigned char *b) )
+        __attribute__nonnull__(1);
+
+static opcode_t fetch_op_mixed_be( NOTNULL(unsigned char *b) )
+        __attribute__nonnull__(1);
+
+static opcode_t fetch_op_mixed_le( NOTNULL(unsigned char *b) )
+        __attribute__nonnull__(1);
+
+static opcode_t fetch_op_test( NOTNULL(unsigned char *b) )
+        __attribute__nonnull__(1);
+
 /* HEADERIZER END: static */
 
 
@@ -65,7 +94,7 @@
  * convert i386 LE 12 byte long double to IEEE 754 8 byte double
  */
 static void
-cvt_num12_num8(unsigned char *dest, const unsigned char *src)
+cvt_num12_num8(NOTNULL(unsigned char *dest), NOTNULL(const unsigned char *src))
 {
     int expo, i, s;
 #ifdef __LCC__
@@ -113,7 +142,7 @@
 }
 
 static void
-cvt_num12_num8_be(unsigned char *dest, const unsigned char *src)
+cvt_num12_num8_be(NOTNULL(unsigned char *dest), NOTNULL(const unsigned char 
*src))
 {
     cvt_num12_num8(dest, src);
     /* TODO endianize */
@@ -121,14 +150,14 @@
 }
 
 static void
-cvt_num12_num8_le(unsigned char *dest, unsigned char *src)
+cvt_num12_num8_le(NOTNULL(unsigned char *dest), NOTNULL(unsigned char *src))
 {
     unsigned char b[8];
     cvt_num12_num8(b, src);
     fetch_buf_le_8(dest, b);
 }
 static opcode_t
-fetch_op_test(unsigned char *b)
+fetch_op_test(NOTNULL(unsigned char *b))
 {
     union {
         unsigned char buf[4];
@@ -146,7 +175,7 @@
  * Fetch an opcode and convert to LE
  */
 static opcode_t
-fetch_op_mixed_le(unsigned char *b)
+fetch_op_mixed_le(NOTNULL(unsigned char *b))
 {
 #if OPCODE_T_SIZE == 4
     union {
@@ -173,7 +202,7 @@
  * Fetch an opcode and convert to BE
  */
 static opcode_t
-fetch_op_mixed_be(unsigned char *b)
+fetch_op_mixed_be(NOTNULL(unsigned char *b))
 {
 #if OPCODE_T_SIZE == 4
     union {
@@ -196,7 +225,7 @@
 }
 
 static opcode_t
-fetch_op_be_4(unsigned char *b)
+fetch_op_be_4(NOTNULL(unsigned char *b))
 {
     union {
         unsigned char buf[4];
@@ -219,7 +248,7 @@
 }
 
 static opcode_t
-fetch_op_be_8(unsigned char *b)
+fetch_op_be_8(NOTNULL(unsigned char *b))
 {
     union {
         unsigned char buf[8];
@@ -238,7 +267,7 @@
 }
 
 static opcode_t
-fetch_op_le_4(unsigned char *b)
+fetch_op_le_4(NOTNULL(unsigned char *b))
 {
     union {
         unsigned char buf[4];
@@ -261,7 +290,7 @@
 }
 
 static opcode_t
-fetch_op_le_8(unsigned char *b)
+fetch_op_le_8(NOTNULL(unsigned char *b))
 {
     union {
         unsigned char buf[8];

Modified: trunk/src/pic.c
==============================================================================
--- trunk/src/pic.c     (original)
+++ trunk/src/pic.c     Sat Jul 14 21:02:08 2007
@@ -130,51 +130,67 @@
 
 static int pass_int( PARROT_INTERP,
     NOTNULL(PMC *sig),
-    char *src_base,
-    void **src,
-    char *dest_base,
+    NOTNULL(char *src_base),
+    NOTNULL(void **src),
+    NOTNULL(char *dest_base),
     NOTNULL(void **dest) )
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        __attribute__nonnull__(5)
         __attribute__nonnull__(6);
 
 static int pass_mixed( PARROT_INTERP,
     NOTNULL(PMC *sig),
-    char *src_base,
-    void **src,
-    char *dest_base,
-    void **dest )
+    NOTNULL(char *src_base),
+    NOTNULL(void **src),
+    NOTNULL(char *dest_base),
+    NOTNULL(void **dest) )
         __attribute__nonnull__(1)
-        __attribute__nonnull__(2);
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        __attribute__nonnull__(5)
+        __attribute__nonnull__(6);
 
 static int pass_num( PARROT_INTERP,
     NOTNULL(PMC *sig),
-    char *src_base,
-    void **src,
-    char *dest_base,
+    NOTNULL(char *src_base),
+    NOTNULL(void **src),
+    NOTNULL(char *dest_base),
     NOTNULL(void **dest) )
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        __attribute__nonnull__(5)
         __attribute__nonnull__(6);
 
 static int pass_pmc( PARROT_INTERP,
     NOTNULL(PMC *sig),
-    char *src_base,
-    void **src,
-    char *dest_base,
+    NOTNULL(char *src_base),
+    NOTNULL(void **src),
+    NOTNULL(char *dest_base),
     NOTNULL(void **dest) )
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        __attribute__nonnull__(5)
         __attribute__nonnull__(6);
 
 static int pass_str( PARROT_INTERP,
     NOTNULL(PMC *sig),
-    char *src_base,
-    void **src,
-    char *dest_base,
+    NOTNULL(char *src_base),
+    NOTNULL(void **src),
+    NOTNULL(char *dest_base),
     NOTNULL(void **dest) )
         __attribute__nonnull__(1)
         __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        __attribute__nonnull__(5)
         __attribute__nonnull__(6);
 
 /* HEADERIZER END: static */
@@ -327,8 +343,8 @@
 }
 
 static int
-pass_int(PARROT_INTERP, NOTNULL(PMC *sig), char *src_base, void **src,
-        char *dest_base, NOTNULL(void **dest))
+pass_int(PARROT_INTERP, NOTNULL(PMC *sig), NOTNULL(char *src_base),
+        NOTNULL(void **src), NOTNULL(char *dest_base), NOTNULL(void **dest))
 {
     int n = SIG_ELEMS(sig);
     int i;
@@ -341,8 +357,8 @@
 }
 
 static int
-pass_num(PARROT_INTERP, NOTNULL(PMC *sig), char *src_base, void **src,
-        char *dest_base, NOTNULL(void **dest))
+pass_num(PARROT_INTERP, NOTNULL(PMC *sig), NOTNULL(char *src_base),
+        NOTNULL(void **src), NOTNULL(char *dest_base), NOTNULL(void **dest))
 {
     int n = SIG_ELEMS(sig);
     int i;
@@ -355,8 +371,8 @@
 }
 
 static int
-pass_str(PARROT_INTERP, NOTNULL(PMC *sig), char *src_base, void **src,
-        char *dest_base, NOTNULL(void **dest))
+pass_str(PARROT_INTERP, NOTNULL(PMC *sig), NOTNULL(char *src_base),
+        NOTNULL(void **src), NOTNULL(char *dest_base), NOTNULL(void **dest))
 {
     int n = SIG_ELEMS(sig);
     int i;
@@ -369,8 +385,8 @@
 }
 
 static int
-pass_pmc(PARROT_INTERP, NOTNULL(PMC *sig), char *src_base, void **src,
-        char *dest_base, NOTNULL(void **dest))
+pass_pmc(PARROT_INTERP, NOTNULL(PMC *sig), NOTNULL(char *src_base),
+        NOTNULL(void **src), NOTNULL(char *dest_base), NOTNULL(void **dest))
 {
     int n = SIG_ELEMS(sig);
     int i;
@@ -383,8 +399,8 @@
 }
 
 static int
-pass_mixed(PARROT_INTERP, NOTNULL(PMC *sig), char *src_base, void **src,
-        char *dest_base, void **dest)
+pass_mixed(PARROT_INTERP, NOTNULL(PMC *sig), NOTNULL(char *src_base),
+        NOTNULL(void **src), NOTNULL(char *dest_base), NOTNULL(void **dest))
 {
     PMC* argP;
     int i, n = SIG_ELEMS(sig);

Modified: trunk/src/pic_jit.c
==============================================================================
--- trunk/src/pic_jit.c (original)
+++ trunk/src/pic_jit.c Sat Jul 14 21:02:08 2007
@@ -66,8 +66,9 @@
 
 static opcode_t * pic_test_func( PARROT_INTERP,
     INTVAL *sig_bits,
-    void **args )
-        __attribute__nonnull__(1);
+    NOTNULL(void **args) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(3);
 
 PARROT_WARN_UNUSED_RESULT
 static int returns_match_results(
@@ -110,7 +111,7 @@
 */
 
 static opcode_t *
-pic_test_func(PARROT_INTERP, INTVAL *sig_bits, void **args)
+pic_test_func(PARROT_INTERP, SHIM(INTVAL *sig_bits), NOTNULL(void **args))
 {
     INTVAL * const result = (INTVAL*) args[0];
     INTVAL   const i      = (INTVAL) args[1];
@@ -373,7 +374,7 @@
 }
 
 funcptr_t
-parrot_pic_JIT_sub(PARROT_INTERP, PMC *sub, int flags)
+parrot_pic_JIT_sub(PARROT_INTERP, NOTNULL(PMC *sub), int flags)
 {
 #ifdef HAS_JIT
 #  if PIC_TEST

Modified: trunk/src/pmc.c
==============================================================================
--- trunk/src/pmc.c     (original)
+++ trunk/src/pmc.c     Sat Jul 14 21:02:08 2007
@@ -48,6 +48,7 @@
 */
 
 PARROT_API
+PARROT_CANNOT_RETURN_NULL
 PMC *
 pmc_new(PARROT_INTERP, INTVAL base_type)
 {
@@ -69,6 +70,7 @@
 */
 
 PARROT_API
+PARROT_CANNOT_RETURN_NULL
 PMC*
 pmc_reuse(PARROT_INTERP, NOTNULL(PMC *pmc), INTVAL new_type,
           SHIM(UINTVAL flags))
@@ -87,32 +89,24 @@
         & (VTABLE_PMC_IS_SINGLETON | VTABLE_IS_CONST_FLAG))
     {
         /* First, is the destination a singleton? No joy for us there */
-        if (new_vtable->flags & VTABLE_PMC_IS_SINGLETON) {
+        if (new_vtable->flags & VTABLE_PMC_IS_SINGLETON)
             real_exception(interp, NULL, ALLOCATION_ERROR,
                                "Parrot VM: Can't turn to a singleton type!\n");
-            return NULL;
-        }
 
         /* First, is the destination a constant? No joy for us there */
-        if (new_vtable->flags & VTABLE_IS_CONST_FLAG) {
+        if (new_vtable->flags & VTABLE_IS_CONST_FLAG)
             real_exception(interp, NULL, ALLOCATION_ERROR,
                                "Parrot VM: Can't turn to a constant type!\n");
-            return NULL;
-        }
 
         /* Is the source a singleton? */
-        if (pmc->vtable->flags & VTABLE_PMC_IS_SINGLETON) {
+        if (pmc->vtable->flags & VTABLE_PMC_IS_SINGLETON)
             real_exception(interp, NULL, ALLOCATION_ERROR,
                                "Parrot VM: Can't modify a singleton\n");
-            return NULL;
-        }
 
         /* Is the source constant? */
-        if (pmc->vtable->flags & VTABLE_IS_CONST_FLAG) {
+        if (pmc->vtable->flags & VTABLE_IS_CONST_FLAG)
             real_exception(interp, NULL, ALLOCATION_ERROR,
                                "Parrot VM: Can't modify a constant\n");
-            return NULL;
-        }
     }
 
     /* Do we have an extension area? */
@@ -262,6 +256,7 @@
 */
 
 PARROT_API
+PARROT_CANNOT_RETURN_NULL
 PMC *
 pmc_new_noinit(PARROT_INTERP, INTVAL base_type)
 {

Modified: trunk/src/pmc_freeze.c
==============================================================================
--- trunk/src/pmc_freeze.c      (original)
+++ trunk/src/pmc_freeze.c      Sat Jul 14 21:02:08 2007
@@ -51,7 +51,7 @@
         __attribute__nonnull__(3);
 
 static void add_pmc_todo_list( PARROT_INTERP,
-    PMC *pmc,
+    NULLOK(PMC *pmc),
     NOTNULL(visit_info *info) )
         __attribute__nonnull__(1)
         __attribute__nonnull__(3);
@@ -62,13 +62,15 @@
 static void cleanup_next_for_GC_pool( NOTNULL(Small_Object_Pool *pool) )
         __attribute__nonnull__(1);
 
-static void create_image( PARROT_INTERP, PMC *pmc, NOTNULL(visit_info *info) )
+static void create_image( PARROT_INTERP,
+    NULLOK(PMC *pmc),
+    NOTNULL(visit_info *info) )
         __attribute__nonnull__(1)
         __attribute__nonnull__(3);
 
 PARROT_INLINE
 static void do_action( PARROT_INTERP,
-    PMC *pmc,
+    NULLOK(PMC *pmc),
     NOTNULL(visit_info *info),
     int seen,
     UINTVAL id )
@@ -76,65 +78,106 @@
         __attribute__nonnull__(3);
 
 PARROT_INLINE
-static void do_thaw( PARROT_INTERP, PMC* pmc, visit_info *info )
-        __attribute__nonnull__(1);
+static void do_thaw( PARROT_INTERP,
+    NOTNULL(PMC* pmc),
+    NOTNULL(visit_info *info) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
 
 PARROT_INLINE
 static void freeze_pmc( PARROT_INTERP,
-    PMC *pmc,
-    visit_info *info,
+    NULLOK(PMC *pmc),
+    NOTNULL(visit_info *info),
     int seen,
     UINTVAL id )
-        __attribute__nonnull__(1);
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(3);
 
 static void ft_init( PARROT_INTERP, NOTNULL(visit_info *info) )
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-static UINTVAL id_from_pmc( PARROT_INTERP, PMC* pmc )
-        __attribute__nonnull__(1);
+static UINTVAL id_from_pmc( PARROT_INTERP, NOTNULL(PMC* pmc) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
 PARROT_INLINE
 static int next_for_GC_seen( PARROT_INTERP,
-    PMC *pmc,
-    visit_info *info,
-    UINTVAL *id )
-        __attribute__nonnull__(1);
+    NULLOK(PMC *pmc),
+    NOTNULL(visit_info *info),
+    NOTNULL(UINTVAL *id) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4);
 
-static void op_append( PARROT_INTERP, STRING *s, opcode_t b, size_t len )
-        __attribute__nonnull__(1);
+static void op_append( PARROT_INTERP,
+    NOTNULL(STRING *s),
+    opcode_t b,
+    size_t len )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
 PARROT_INLINE
-static void op_check_size( PARROT_INTERP, STRING *s, size_t len )
-        __attribute__nonnull__(1);
+static void op_check_size( PARROT_INTERP, NOTNULL(STRING *s), size_t len )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
 static void pmc_add_ext( PARROT_INTERP, NOTNULL(PMC *pmc) )
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-static void push_ascii_integer( PARROT_INTERP, IMAGE_IO *io, INTVAL v )
-        __attribute__nonnull__(1);
+static void push_ascii_integer( PARROT_INTERP,
+    NOTNULL(IMAGE_IO *io),
+    INTVAL v )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
-static void push_ascii_number( PARROT_INTERP, IMAGE_IO *io, FLOATVAL v )
-        __attribute__nonnull__(1);
+static void push_ascii_number( PARROT_INTERP,
+    NOTNULL(IMAGE_IO *io),
+    FLOATVAL v )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
-static void push_ascii_pmc( PARROT_INTERP, IMAGE_IO *io, const PMC* v )
-        __attribute__nonnull__(1);
+static void push_ascii_pmc( PARROT_INTERP,
+    NOTNULL(IMAGE_IO *io),
+    NOTNULL(const PMC* v) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
 
-static void push_ascii_string( PARROT_INTERP, IMAGE_IO *io, STRING *s )
-        __attribute__nonnull__(1);
+static void push_ascii_string( PARROT_INTERP,
+    NOTNULL(IMAGE_IO *io),
+    NOTNULL(STRING *s) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
 
-static void push_opcode_integer( PARROT_INTERP, IMAGE_IO *io, INTVAL v )
-        __attribute__nonnull__(1);
+static void push_opcode_integer( PARROT_INTERP,
+    NOTNULL(IMAGE_IO *io),
+    INTVAL v )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
-static void push_opcode_number( PARROT_INTERP, IMAGE_IO *io, FLOATVAL v )
-        __attribute__nonnull__(1);
+static void push_opcode_number( PARROT_INTERP,
+    NOTNULL(IMAGE_IO *io),
+    FLOATVAL v )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
-static void push_opcode_pmc( PARROT_INTERP, IMAGE_IO *io, PMC* v )
-        __attribute__nonnull__(1);
+static void push_opcode_pmc( PARROT_INTERP,
+    NOTNULL(IMAGE_IO *io),
+    NOTNULL(PMC* v) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
 
-static void push_opcode_string( PARROT_INTERP, IMAGE_IO *io, STRING* v )
-        __attribute__nonnull__(1);
+static void push_opcode_string( PARROT_INTERP,
+    NOTNULL(IMAGE_IO *io),
+    NOTNULL(STRING *v) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
 
 static PMC* run_thaw( PARROT_INTERP,
     NOTNULL(STRING* image),
@@ -142,35 +185,58 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-static INTVAL shift_ascii_integer( SHIM_INTERP, IMAGE_IO *io );
-static FLOATVAL shift_ascii_number( SHIM_INTERP, IMAGE_IO *io );
-static PMC* shift_ascii_pmc( SHIM_INTERP, IMAGE_IO *io );
-static STRING* shift_ascii_string( PARROT_INTERP, IMAGE_IO *io )
-        __attribute__nonnull__(1);
+static INTVAL shift_ascii_integer( SHIM_INTERP, NOTNULL(IMAGE_IO *io) )
+        __attribute__nonnull__(2);
 
-static INTVAL shift_opcode_integer( SHIM_INTERP, IMAGE_IO *io );
-static FLOATVAL shift_opcode_number( SHIM_INTERP, IMAGE_IO *io );
-static PMC* shift_opcode_pmc( PARROT_INTERP, IMAGE_IO *io )
-        __attribute__nonnull__(1);
+static FLOATVAL shift_ascii_number( SHIM_INTERP, NOTNULL(IMAGE_IO *io) )
+        __attribute__nonnull__(2);
 
-static STRING* shift_opcode_string( PARROT_INTERP, IMAGE_IO *io )
-        __attribute__nonnull__(1);
+static PMC* shift_ascii_pmc( SHIM_INTERP, NOTNULL(IMAGE_IO *io) )
+        __attribute__nonnull__(2);
 
-static void str_append( PARROT_INTERP, STRING *s, const void *b, size_t len )
-        __attribute__nonnull__(1);
+static STRING* shift_ascii_string( PARROT_INTERP, NOTNULL(IMAGE_IO *io) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+static INTVAL shift_opcode_integer( SHIM_INTERP, NOTNULL(IMAGE_IO *io) )
+        __attribute__nonnull__(2);
+
+static FLOATVAL shift_opcode_number( SHIM_INTERP, NOTNULL(IMAGE_IO *io) )
+        __attribute__nonnull__(2);
+
+static PMC* shift_opcode_pmc( PARROT_INTERP, NOTNULL(IMAGE_IO *io) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+static STRING* shift_opcode_string( PARROT_INTERP, NOTNULL(IMAGE_IO *io) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+static void str_append( PARROT_INTERP,
+    NOTNULL(STRING *s),
+    NOTNULL(const void *b),
+    size_t len )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
 
 PARROT_INLINE
+PARROT_CANNOT_RETURN_NULL
 static PMC* thaw_create_pmc( PARROT_INTERP,
-    const visit_info *info,
+    NOTNULL(const visit_info *info),
     INTVAL type )
-        __attribute__nonnull__(1);
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
 PARROT_INLINE
 static int thaw_pmc( PARROT_INTERP,
-    visit_info *info,
-    UINTVAL *id,
-    INTVAL *type )
-        __attribute__nonnull__(1);
+    NOTNULL(visit_info *info),
+    NOTNULL(UINTVAL *id),
+    NOTNULL(INTVAL *type) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4);
 
 static void todo_list_init( PARROT_INTERP, NOTNULL(visit_info *info) )
         __attribute__nonnull__(1)
@@ -198,15 +264,17 @@
         __attribute__nonnull__(3);
 
 static void visit_next_for_GC( PARROT_INTERP,
-    PMC* pmc,
+    NOTNULL(PMC* pmc),
     NOTNULL(visit_info* info) )
         __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
 static void visit_todo_list( PARROT_INTERP,
-    PMC* pmc,
+    NOTNULL(PMC* pmc),
     NOTNULL(visit_info* info) )
         __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
 static void visit_todo_list_thaw( PARROT_INTERP, PMC* old, visit_info* info )
@@ -258,7 +326,7 @@
 */
 
 static void
-str_append(PARROT_INTERP, STRING *s, const void *b, size_t len)
+str_append(PARROT_INTERP, NOTNULL(STRING *s), NOTNULL(const void *b), size_t 
len)
 {
     const size_t used = s->bufused;
     const int need_free = (int)PObj_buflen(s) - used - len;
@@ -287,7 +355,7 @@
 */
 
 static void
-push_ascii_integer(PARROT_INTERP, IMAGE_IO *io, INTVAL v)
+push_ascii_integer(PARROT_INTERP, NOTNULL(IMAGE_IO *io), INTVAL v)
 {
     char buffer[128];
     sprintf(buffer, "%d ", (int) v);
@@ -304,7 +372,7 @@
 */
 
 static void
-push_ascii_number(PARROT_INTERP, IMAGE_IO *io, FLOATVAL v)
+push_ascii_number(PARROT_INTERP, NOTNULL(IMAGE_IO *io), FLOATVAL v)
 {
     char buffer[128];
     sprintf(buffer, "%g ", (double) v);
@@ -325,7 +393,7 @@
 */
 
 static void
-push_ascii_string(PARROT_INTERP, IMAGE_IO *io, STRING *s)
+push_ascii_string(PARROT_INTERP, NOTNULL(IMAGE_IO *io), NOTNULL(STRING *s))
 {
     const UINTVAL length = string_length(interp, s);
     char * const buffer = (char *)malloc(4*length);
@@ -353,7 +421,7 @@
 */
 
 static void
-push_ascii_pmc(PARROT_INTERP, IMAGE_IO *io, const PMC* v)
+push_ascii_pmc(PARROT_INTERP, NOTNULL(IMAGE_IO *io), NOTNULL(const PMC* v))
 {
     char buffer[128];
     sprintf(buffer, "%p ", (const void *)v);
@@ -369,7 +437,7 @@
 */
 
 static INTVAL
-shift_ascii_integer(SHIM_INTERP, IMAGE_IO *io)
+shift_ascii_integer(SHIM_INTERP, NOTNULL(IMAGE_IO *io))
 {
     char * const start = (char*)io->image->strstart;
     char *p = start;
@@ -392,7 +460,7 @@
 */
 
 static FLOATVAL
-shift_ascii_number(SHIM_INTERP, IMAGE_IO *io)
+shift_ascii_number(SHIM_INTERP, NOTNULL(IMAGE_IO *io))
 {
     char * const start = (char*)io->image->strstart;
     char *p = start;
@@ -415,7 +483,7 @@
 */
 
 static STRING*
-shift_ascii_string(PARROT_INTERP, IMAGE_IO *io)
+shift_ascii_string(PARROT_INTERP, NOTNULL(IMAGE_IO *io))
 {
     STRING *s;
 
@@ -443,7 +511,7 @@
 */
 
 static PMC*
-shift_ascii_pmc(SHIM_INTERP, IMAGE_IO *io)
+shift_ascii_pmc(SHIM_INTERP, NOTNULL(IMAGE_IO *io))
 {
     char * const start = (char*)io->image->strstart;
     char *p = start;
@@ -469,7 +537,7 @@
 
 PARROT_INLINE
 static void
-op_check_size(PARROT_INTERP, STRING *s, size_t len)
+op_check_size(PARROT_INTERP, NOTNULL(STRING *s), size_t len)
 {
     const size_t used = s->bufused;
     const int need_free = (int)PObj_buflen(s) - used - len;
@@ -497,7 +565,7 @@
 */
 
 static void
-op_append(PARROT_INTERP, STRING *s, opcode_t b, size_t len)
+op_append(PARROT_INTERP, NOTNULL(STRING *s), opcode_t b, size_t len)
 {
     op_check_size(interp, s, len);
     *((opcode_t *)((ptrcast_t)s->strstart + s->bufused)) = b;
@@ -516,7 +584,7 @@
 */
 
 static void
-push_opcode_integer(PARROT_INTERP, IMAGE_IO *io, INTVAL v)
+push_opcode_integer(PARROT_INTERP, NOTNULL(IMAGE_IO *io), INTVAL v)
 {
     assert(sizeof (opcode_t) == sizeof (INTVAL));
     op_append(interp, io->image, (opcode_t)v, sizeof (opcode_t));
@@ -531,7 +599,7 @@
 */
 
 static void
-push_opcode_number(PARROT_INTERP, IMAGE_IO *io, FLOATVAL v)
+push_opcode_number(PARROT_INTERP, NOTNULL(IMAGE_IO *io), FLOATVAL v)
 {
     const size_t len = PF_size_number() * sizeof (opcode_t);
     STRING * const s = io->image;
@@ -552,7 +620,7 @@
 */
 
 static void
-push_opcode_string(PARROT_INTERP, IMAGE_IO *io, STRING* v)
+push_opcode_string(PARROT_INTERP, NOTNULL(IMAGE_IO *io), NOTNULL(STRING *v))
 {
     const size_t len = PF_size_string(v) * sizeof (opcode_t);
     STRING * const s = io->image;
@@ -573,7 +641,7 @@
 */
 
 static void
-push_opcode_pmc(PARROT_INTERP, IMAGE_IO *io, PMC* v)
+push_opcode_pmc(PARROT_INTERP, NOTNULL(IMAGE_IO *io), NOTNULL(PMC* v))
 {
     op_append(interp, io->image, (opcode_t)v, sizeof (opcode_t));
 }
@@ -590,7 +658,7 @@
 */
 
 static INTVAL
-shift_opcode_integer(SHIM_INTERP, IMAGE_IO *io)
+shift_opcode_integer(SHIM_INTERP, NOTNULL(IMAGE_IO *io))
 {
     const char * const start = (char*)io->image->strstart;
     const INTVAL i =
@@ -612,7 +680,7 @@
 */
 
 static PMC*
-shift_opcode_pmc(PARROT_INTERP, IMAGE_IO *io)
+shift_opcode_pmc(PARROT_INTERP, NOTNULL(IMAGE_IO *io))
 {
     return (PMC*) shift_opcode_integer(interp, io);
 }
@@ -626,7 +694,7 @@
 */
 
 static FLOATVAL
-shift_opcode_number(SHIM_INTERP, IMAGE_IO *io)
+shift_opcode_number(SHIM_INTERP, NOTNULL(IMAGE_IO *io))
 {
     const char * const start = (const char*)io->image->strstart;
     const FLOATVAL f =
@@ -646,7 +714,7 @@
 */
 
 static STRING*
-shift_opcode_string(PARROT_INTERP, IMAGE_IO *io)
+shift_opcode_string(PARROT_INTERP, NOTNULL(IMAGE_IO *io))
 {
     char * const start = (char*)io->image->strstart;
     STRING * const s =
@@ -817,7 +885,7 @@
 
 PARROT_INLINE
 static void
-freeze_pmc(PARROT_INTERP, PMC *pmc, visit_info *info,
+freeze_pmc(PARROT_INTERP, NULLOK(PMC *pmc), NOTNULL(visit_info *info),
         int seen, UINTVAL id)
 {
     IMAGE_IO * const io = info->image_io;
@@ -873,8 +941,8 @@
 
 PARROT_INLINE
 static int
-thaw_pmc(PARROT_INTERP, visit_info *info,
-        UINTVAL *id, INTVAL *type)
+thaw_pmc(PARROT_INTERP, NOTNULL(visit_info *info),
+        NOTNULL(UINTVAL *id), NOTNULL(INTVAL *type))
 {
     PMC *n;
     IMAGE_IO * const io = info->image_io;
@@ -919,7 +987,7 @@
 
 PARROT_INLINE
 static void
-do_action(PARROT_INTERP, PMC *pmc, NOTNULL(visit_info *info),
+do_action(PARROT_INTERP, NULLOK(PMC *pmc), NOTNULL(visit_info *info),
         int seen, UINTVAL id)
 {
     switch (info->what) {
@@ -931,7 +999,6 @@
             break;
         default:
             real_exception(interp, NULL, 1, "Illegal action %ld", 
(long)info->what);
-            break;
     }
 }
 
@@ -944,8 +1011,9 @@
 */
 
 PARROT_INLINE
+PARROT_CANNOT_RETURN_NULL
 static PMC*
-thaw_create_pmc(PARROT_INTERP, const visit_info *info,
+thaw_create_pmc(PARROT_INTERP, NOTNULL(const visit_info *info),
         INTVAL type)
 {
     PMC *pmc;
@@ -957,9 +1025,7 @@
             pmc = constant_pmc_new_noinit(interp, type);
             break;
         default:
-            pmc = NULL;
             real_exception(interp, NULL, 1, "Illegal visit_next type");
-            break;
     }
     return pmc;
 }
@@ -976,7 +1042,7 @@
 
 PARROT_INLINE
 static void
-do_thaw(PARROT_INTERP, PMC* pmc, visit_info *info)
+do_thaw(PARROT_INTERP, NOTNULL(PMC* pmc), NOTNULL(visit_info *info))
 {
     UINTVAL id;
     INTVAL type;
@@ -1060,7 +1126,7 @@
 
 
 static UINTVAL
-id_from_pmc(PARROT_INTERP, PMC* pmc)
+id_from_pmc(PARROT_INTERP, NOTNULL(PMC* pmc))
 {
     UINTVAL id = 1;     /* first PMC in first arena */
     Small_Object_Arena *arena;
@@ -1125,8 +1191,8 @@
 
 PARROT_INLINE
 static int
-next_for_GC_seen(PARROT_INTERP, PMC *pmc, visit_info *info,
-        UINTVAL *id)
+next_for_GC_seen(PARROT_INTERP, NULLOK(PMC *pmc), NOTNULL(visit_info *info),
+        NOTNULL(UINTVAL *id))
 {
     int seen = 0;
     if (PMC_IS_NULL(pmc)) {
@@ -1163,7 +1229,7 @@
 */
 
 static void
-add_pmc_todo_list(PARROT_INTERP, PMC *pmc, NOTNULL(visit_info *info))
+add_pmc_todo_list(PARROT_INTERP, NULLOK(PMC *pmc), NOTNULL(visit_info *info))
 {
     list_push(interp, (List *)PMC_data(info->todo), pmc, enum_type_PMC);
 }
@@ -1212,7 +1278,7 @@
 */
 
 static void
-visit_next_for_GC(PARROT_INTERP, PMC* pmc, NOTNULL(visit_info* info))
+visit_next_for_GC(PARROT_INTERP, NOTNULL(PMC* pmc), NOTNULL(visit_info* info))
 {
     UINTVAL id;
     const int seen = next_for_GC_seen(interp, pmc, info, &id);
@@ -1238,7 +1304,7 @@
 */
 
 static void
-visit_todo_list(PARROT_INTERP, PMC* pmc, NOTNULL(visit_info* info))
+visit_todo_list(PARROT_INTERP, NOTNULL(PMC* pmc), NOTNULL(visit_info* info))
 {
     UINTVAL id;
     int seen;
@@ -1378,7 +1444,7 @@
 */
 
 static void
-create_image(PARROT_INTERP, PMC *pmc, NOTNULL(visit_info *info))
+create_image(PARROT_INTERP, NULLOK(PMC *pmc), NOTNULL(visit_info *info))
 {
     INTVAL len;
     if (!PMC_IS_NULL(pmc) && (VTABLE_does(interp, pmc,

Modified: trunk/src/stm/backend.c
==============================================================================
--- trunk/src/stm/backend.c     (original)
+++ trunk/src/stm/backend.c     Sat Jul 14 21:02:08 2007
@@ -39,11 +39,14 @@
 
 /* HEADERIZER BEGIN: static */
 
-static STM_read_record * alloc_read( PARROT_INTERP, STM_tx_log *log )
-        __attribute__nonnull__(1);
+static STM_read_record * alloc_read( PARROT_INTERP, NOTNULL(STM_tx_log *log) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
-static STM_write_record * alloc_write( PARROT_INTERP, STM_tx_log *log )
-        __attribute__nonnull__(1);
+static STM_write_record * alloc_write( PARROT_INTERP,
+    NOTNULL(STM_tx_log *log) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
 static void do_partial_abort( PARROT_INTERP,
     NOTNULL(STM_tx_log *log),
@@ -59,8 +62,9 @@
         __attribute__nonnull__(2)
         __attribute__nonnull__(3);
 
-static int do_real_commit( PARROT_INTERP, STM_tx_log *log )
-        __attribute__nonnull__(1);
+static int do_real_commit( PARROT_INTERP, NOTNULL(STM_tx_log *log) )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
 PARROT_WARN_UNUSED_RESULT
 static STM_write_record * find_write_record( PARROT_INTERP,
@@ -70,11 +74,14 @@
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-static PMC * force_sharing( PARROT_INTERP, PMC *pmc )
+static PMC * force_sharing( PARROT_INTERP, NULLOK(PMC *pmc) )
         __attribute__nonnull__(1);
 
-static STM_read_record * get_read( PARROT_INTERP, STM_tx_log *log, int i )
-        __attribute__nonnull__(1);
+static STM_read_record * get_read( PARROT_INTERP,
+    NOTNULL(STM_tx_log *log),
+    int i )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
 static int get_read_valid_depth( PARROT_INTERP, NOTNULL(STM_tx_log *log) )
         __attribute__nonnull__(1)
@@ -90,7 +97,8 @@
         __attribute__nonnull__(2);
 
 PARROT_WARN_UNUSED_RESULT
-static int is_aborted( STM_tx_log *log );
+static int is_aborted( NOTNULL(STM_tx_log *log) )
+        __attribute__nonnull__(1);
 
 PARROT_PURE_FUNCTION
 static int is_version( NOTNULL(const void *maybe_version) )
@@ -109,18 +117,23 @@
         __attribute__nonnull__(2);
 
 static int merge_transactions( PARROT_INTERP,
-    STM_tx_log *log,
+    NOTNULL(STM_tx_log *log),
     STM_tx_log_sub *outer,
     STM_tx_log_sub *inner,
     int always )
-        __attribute__nonnull__(1);
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
 PARROT_WARN_UNUSED_RESULT
 static void * next_version( NOTNULL(const void *old_version) )
         __attribute__nonnull__(1);
 
-static void replay_writes( PARROT_INTERP, STM_tx_log *log, int from, int to )
-        __attribute__nonnull__(1);
+static void replay_writes( PARROT_INTERP,
+    NOTNULL(STM_tx_log *log),
+    int from,
+    int to )
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
 static int safe_to_clone( PARROT_INTERP, NOTNULL(const PMC * const original) )
         __attribute__nonnull__(1)
@@ -131,9 +144,10 @@
         __attribute__nonnull__(2);
 
 static void * wait_for_version( PARROT_INTERP,
-    STM_tx_log *log,
+    NOTNULL(STM_tx_log *log),
     Parrot_STM_PMC_handle handle )
-        __attribute__nonnull__(1);
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
 /* HEADERIZER END: static */
 
@@ -226,7 +240,7 @@
 }
 
 static STM_read_record *
-get_read(PARROT_INTERP, STM_tx_log *log, int i)
+get_read(PARROT_INTERP, NOTNULL(STM_tx_log *log), int i)
 {
     assert(i >= 0);
     assert(i <= log->last_read);
@@ -240,7 +254,7 @@
  */
 
 static STM_write_record *
-alloc_write(PARROT_INTERP, STM_tx_log *log)
+alloc_write(PARROT_INTERP, NOTNULL(STM_tx_log *log))
 {
     STM_write_record *write;
     const int         i = ++log->last_write;
@@ -258,7 +272,7 @@
 }
 
 static STM_read_record *
-alloc_read(PARROT_INTERP, STM_tx_log *log)
+alloc_read(PARROT_INTERP, NOTNULL(STM_tx_log *log))
 {
     STM_read_record *read;
     const int i = ++log->last_read;
@@ -302,7 +316,7 @@
 
 PARROT_WARN_UNUSED_RESULT
 static int
-is_aborted(STM_tx_log *log)
+is_aborted(NOTNULL(STM_tx_log *log))
 {
     int i;
 
@@ -358,7 +372,7 @@
  * so we can abort.
  */
 static int
-merge_transactions(PARROT_INTERP, STM_tx_log *log,
+merge_transactions(PARROT_INTERP, NOTNULL(STM_tx_log *log),
         STM_tx_log_sub *outer, STM_tx_log_sub *inner, int always)
 {
     int i;
@@ -442,7 +456,7 @@
 }
 
 static PMC *
-force_sharing(PARROT_INTERP, PMC *pmc)
+force_sharing(PARROT_INTERP, NULLOK(PMC *pmc))
 {
     PMC *ret;
 
@@ -509,7 +523,7 @@
  * Inner transactions are committed by merge_transaction().
  */
 static int
-do_real_commit(PARROT_INTERP, STM_tx_log *log) {
+do_real_commit(PARROT_INTERP, NOTNULL(STM_tx_log *log)) {
     int i;
     int successp;
     STM_tx_log_sub *inner;
@@ -620,7 +634,7 @@
  * question is re-partial-aborted.
  */
 static void
-replay_writes(PARROT_INTERP, STM_tx_log *log, int from, int to)
+replay_writes(PARROT_INTERP, NOTNULL(STM_tx_log *log), int from, int to)
 {
     int i;
     int validp    = 1;
@@ -980,7 +994,7 @@
  */
 static void *
 wait_for_version(PARROT_INTERP,
-        STM_tx_log *log, Parrot_STM_PMC_handle handle)
+        NOTNULL(STM_tx_log *log), Parrot_STM_PMC_handle handle)
 {
     void                  *version;
     STM_tx_log_sub        *curlog;

Modified: trunk/tools/build/headerizer.pl
==============================================================================
--- trunk/tools/build/headerizer.pl     (original)
+++ trunk/tools/build/headerizer.pl     Sat Jul 14 21:02:08 2007
@@ -182,16 +182,25 @@
 }
 
 sub attrs_from_args {
+    my $func = shift;
     my @args = @_;
 
     my @attrs = ();
 
     my $n = 0;
+    my $complaints = 0;
+
     for my $arg ( @args ) {
         ++$n;
-        if ( $arg =~ m{/\*\s*NN\s*\*/} || $arg =~ m{NOTNULL\(} || $arg eq 
'PARROT_INTERP' ) {
+        if ( $arg =~ m{NOTNULL\(} || $arg eq 'PARROT_INTERP' ) {
             push( @attrs, "__attribute__nonnull__($n)" );
         }
+        if ( ( $arg =~ m{\*} ) && ( $arg !~ /SHIM|NOTNULL|NULLOK/ ) ) {
+            if ( ++$complaints == 1 ) {
+                warn qq{In function $func->{name}\n};
+            }
+            warn qq{    "$arg" isn't protected with NOTNULL or NULLOK\n};
+        }
     }
 
     return @attrs;
@@ -208,7 +217,7 @@
         $decl = "static $decl" if $func->{is_static};
 
         my @args = @{$func->{args}};
-        my @attrs = attrs_from_args( @args );
+        my @attrs = attrs_from_args( $func, @args );
 
         for my $arg ( @args ) {
             if ( $arg =~ m{SHIM\((.+)\)} ) {
@@ -317,6 +326,8 @@
         write_file( $cfile, $source );
     }
 
+    print "Headerization complete.\n";
+
     return;
 }
 
@@ -337,7 +348,6 @@
     open my $fh, '>', $filename or die "couldn't write '$filename': $!";
     print {$fh} $text;
     close $fh;
-    print "Wrote '$filename'\n";
 }
 
 sub replace_headerized_declarations {

<Prev in Thread] Current Thread [Next in Thread>
  • [svn:parrot] r19885 - in trunk: config/gen/makefiles include/parrot src src/packfile src/stm tools/build, petdance <=