Author: petdance
Date: Mon Jun 11 21:09:41 2007
New Revision: 18941

Modified:
   trunk/include/parrot/memory.h
   trunk/include/parrot/string_funcs.h
   trunk/src/gc/memory.c
   trunk/src/string.c

Log:
more xciting compiler flags

Modified: trunk/include/parrot/memory.h
==============================================================================
--- trunk/include/parrot/memory.h       (original)
+++ trunk/include/parrot/memory.h       Mon Jun 11 21:09:41 2007
@@ -44,28 +44,34 @@
 /* HEADERIZER BEGIN: src/gc/memory.c */
 
 PARROT_API void * mem__sys_realloc( void *from /*NULLOK*/, size_t size )
+        __attribute__malloc__
         __attribute__warn_unused_result__;
 
 PARROT_API void * mem__sys_realloc_zeroed(
     void *from /*NULLOK*/,
     size_t size,
     size_t old_size )
+        __attribute__malloc__
         __attribute__warn_unused_result__;
 
 PARROT_API void * mem_sys_allocate( size_t size )
+        __attribute__malloc__
         __attribute__warn_unused_result__;
 
 PARROT_API void * mem_sys_allocate_zeroed( size_t size )
+        __attribute__malloc__
         __attribute__warn_unused_result__;
 
 PARROT_API void mem_sys_free( void * from );
 void * mem__internal_allocate( size_t size, const char *file, int line )
+        __attribute__malloc__
         __attribute__warn_unused_result__;
 
 void * mem__internal_allocate_zeroed(
     size_t size,
     const char *file,
     int line )
+        __attribute__malloc__
         __attribute__warn_unused_result__;
 
 void mem__internal_free( void *from, const char *file /*NN*/, int line )
@@ -78,6 +84,7 @@
     int line )
         __attribute__nonnull__(1)
         __attribute__nonnull__(3)
+        __attribute__malloc__
         __attribute__warn_unused_result__;
 
 void mem_setup_allocator( Interp *interp /*NN*/ )

Modified: trunk/include/parrot/string_funcs.h
==============================================================================
--- trunk/include/parrot/string_funcs.h (original)
+++ trunk/include/parrot/string_funcs.h Mon Jun 11 21:09:41 2007
@@ -25,10 +25,11 @@
 PARROT_API STRING * const_string( Interp *interp, const char *buffer /*NN*/ )
         __attribute__nonnull__(2);
 
-PARROT_API STRING * int_to_str( Interp *interp,
+PARROT_API STRING * int_to_str( Interp *interp /*NN*/,
     char *tc /*NN*/,
     HUGEINTVAL num,
     char base )
+        __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
 PARROT_API STRING * Parrot_make_COW_reference( Interp *interp /*NN*/,
@@ -68,10 +69,11 @@
     INTVAL charset_nr,
     STRING *dest /*NULLOK*/ );
 
-PARROT_API STRING* Parrot_string_trans_encoding( Interp *interp,
+PARROT_API STRING* Parrot_string_trans_encoding( Interp *interp /*NN*/,
     STRING *src /*NULLOK*/,
     INTVAL encoding_nr,
-    STRING *dest /*NULLOK*/ );
+    STRING *dest /*NULLOK*/ )
+        __attribute__nonnull__(1);
 
 PARROT_API void Parrot_unmake_COW( Interp *interp, STRING *s /*NN*/ )
         __attribute__nonnull__(2);
@@ -127,7 +129,10 @@
         __attribute__pure__
         __attribute__warn_unused_result__;
 
-PARROT_API STRING * string_compose( Interp *interp, STRING *src /*NULLOK*/ );
+PARROT_API STRING * string_compose( Interp *interp /*NN*/,
+    STRING *src /*NULLOK*/ )
+        __attribute__nonnull__(1);
+
 PARROT_API INTVAL string_compute_strlen( Interp *interp, STRING *s /*NN*/ )
         __attribute__nonnull__(2);
 
@@ -181,8 +186,9 @@
     STRING *s /*NULLOK*/,
     size_t seed );
 
-PARROT_API STRING * string_increment( Interp *interp,
-    const STRING *s /*NULLOK*/ );
+PARROT_API STRING * string_increment( Interp *interp /*NN*/,
+    const STRING *s /*NULLOK*/ )
+        __attribute__nonnull__(1);
 
 PARROT_API INTVAL string_index( Interp *interp,
     const STRING *s /*NN*/,
@@ -200,11 +206,12 @@
         __attribute__pure__
         __attribute__warn_unused_result__;
 
-PARROT_API STRING * string_make( Interp *interp,
+PARROT_API STRING * string_make( Interp *interp /*NN*/,
     const char *buffer /*NULLOK*/,
     UINTVAL len,
     const char *charset_name /*NULLOK*/,
-    UINTVAL flags );
+    UINTVAL flags )
+        __attribute__nonnull__(1);
 
 PARROT_API STRING * string_make_direct( Interp *interp,
     const char *buffer /*NULLOK*/,
@@ -215,9 +222,10 @@
         __attribute__nonnull__(4)
         __attribute__nonnull__(5);
 
-PARROT_API STRING * string_make_empty( Interp *interp,
+PARROT_API STRING * string_make_empty( Interp *interp /*NN*/,
     parrot_string_representation_t representation,
-    UINTVAL capacity );
+    UINTVAL capacity )
+        __attribute__nonnull__(1);
 
 PARROT_API INTVAL string_max_bytes( Interp *interp,
     const STRING *s /*NN*/,
@@ -305,16 +313,18 @@
 
 PARROT_API char * string_to_cstring( Interp *interp,
     const STRING *s /* NULLOK */ )
+        __attribute__malloc__
         __attribute__warn_unused_result__;
 
 PARROT_API INTVAL string_to_int( Interp *interp, const STRING *s /*NULLOK*/ );
 PARROT_API FLOATVAL string_to_num( Interp *interp,
     const STRING *s /*NULLOK*/ );
 
-PARROT_API STRING * string_unescape_cstring( Interp *interp,
+PARROT_API STRING * string_unescape_cstring( Interp *interp /*NN*/,
     const char *cstring /*NN*/,
     char delimiter,
     const char *enc_char /*NULLOK*/ )
+        __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
 PARROT_API void string_unpin( Interp *interp, STRING *s /*NN*/ )
@@ -324,11 +334,12 @@
     const STRING *s /*NULLOK*/ );
 
 PARROT_API void string_upcase_inplace( Interp *interp, STRING *s /*NULLOK*/ );
-PARROT_API STRING* uint_to_str( Interp *interp,
+PARROT_API STRING* uint_to_str( Interp *interp /*NN*/,
     char *tc /*NN*/,
     UHUGEINTVAL num,
     char base,
     int minus )
+        __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
 /* HEADERIZER END: src/string.c */

Modified: trunk/src/gc/memory.c
==============================================================================
--- trunk/src/gc/memory.c       (original)
+++ trunk/src/gc/memory.c       Mon Jun 11 21:09:41 2007
@@ -36,7 +36,7 @@
 PARROT_API
 void *
 mem_sys_allocate(size_t size)
-    /* WARN_UNUSED */
+    /* MALLOC, WARN_UNUSED */
 {
     void * const ptr = malloc((size_t)size);
 #ifdef DETAIL_MEMORY_DEBUG
@@ -49,7 +49,7 @@
 
 void *
 mem__internal_allocate(size_t size, const char *file, int line)
-    /* WARN_UNUSED */
+    /* MALLOC, WARN_UNUSED */
 {
     void * const ptr = malloc((size_t)size);
 #ifdef DETAIL_MEMORY_DEBUG
@@ -72,7 +72,7 @@
 PARROT_API
 void *
 mem_sys_allocate_zeroed(size_t size)
-    /* WARN_UNUSED */
+    /* MALLOC, WARN_UNUSED */
 {
     void * const ptr = calloc(1, (size_t)size);
 #ifdef DETAIL_MEMORY_DEBUG
@@ -85,7 +85,7 @@
 
 void *
 mem__internal_allocate_zeroed(size_t size, const char *file, int line)
-    /* WARN_UNUSED */
+    /* MALLOC, WARN_UNUSED */
 {
     void * const ptr = calloc(1, (size_t)size);
 #ifdef DETAIL_MEMORY_DEBUG
@@ -108,7 +108,7 @@
 PARROT_API
 void *
 mem__sys_realloc(void *from /*NULLOK*/, size_t size)
-    /* WARN_UNUSED */
+    /* MALLOC, WARN_UNUSED */
 {
     void *ptr;
 #ifdef DETAIL_MEMORY_DEBUG
@@ -135,7 +135,7 @@
 PARROT_API
 void *
 mem__sys_realloc_zeroed(void *from /*NULLOK*/, size_t size, size_t old_size)
-    /* WARN_UNUSED */
+    /* MALLOC, WARN_UNUSED */
 {
     void *ptr;
 #ifdef DETAIL_MEMORY_DEBUG
@@ -157,7 +157,7 @@
 void *
 mem__internal_realloc(void *from /*NN*/, size_t size,
         const char *file /*NN*/, int line)
-    /* WARN_UNUSED */
+    /* MALLOC, WARN_UNUSED */
 {
     void * const ptr = realloc(from, size);
 #ifdef DETAIL_MEMORY_DEBUG
@@ -226,7 +226,6 @@
 
     Parrot_initialize_memory_pools(interp);
     Parrot_initialize_header_pools(interp);
-
 }
 
 /*

Modified: trunk/src/string.c
==============================================================================
--- trunk/src/string.c  (original)
+++ trunk/src/string.c  Mon Jun 11 21:09:41 2007
@@ -313,7 +313,7 @@
 
 PARROT_API
 STRING *
-string_make_empty(Interp *interp,
+string_make_empty(Interp *interp /*NN*/,
     parrot_string_representation_t representation, UINTVAL capacity)
 {
     STRING * const s = new_string_header(interp, 0);
@@ -592,7 +592,7 @@
 
 PARROT_API
 STRING *
-string_make(Interp *interp, const char *buffer /*NULLOK*/,
+string_make(Interp *interp /*NN*/, const char *buffer /*NULLOK*/,
     UINTVAL len, const char *charset_name /*NULLOK*/, UINTVAL flags)
 {
     ENCODING *encoding;
@@ -1904,7 +1904,7 @@
 PARROT_API
 char *
 string_to_cstring(Interp *interp, const STRING *s /* NULLOK */)
-    /* WARN_UNUSED */
+    /* MALLOC, WARN_UNUSED */
 {
     char *p;
     /*
@@ -2175,7 +2175,7 @@
 
 PARROT_API
 STRING *
-string_unescape_cstring(Interp *interp,
+string_unescape_cstring(Interp *interp /*NN*/,
     const char *cstring /*NN*/, char delimiter, const char *enc_char 
/*NULLOK*/)
 {
     size_t clength = strlen(cstring);
@@ -2380,7 +2380,7 @@
 
 PARROT_API
 STRING *
-string_increment(Interp *interp, const STRING *s /*NULLOK*/)
+string_increment(Interp *interp /*NN*/, const STRING *s /*NULLOK*/)
 {
     INTVAL o;
 
@@ -2509,7 +2509,7 @@
 
 PARROT_API
 STRING*
-Parrot_string_trans_encoding(Interp *interp, STRING *src /*NULLOK*/,
+Parrot_string_trans_encoding(Interp *interp /*NN*/, STRING *src /*NULLOK*/,
         INTVAL encoding_nr, STRING *dest /*NULLOK*/)
 {
     ENCODING *new_encoding;
@@ -2542,7 +2542,7 @@
 
 PARROT_API
 STRING *
-string_compose(Interp *interp, STRING *src /*NULLOK*/)
+string_compose(Interp *interp /*NN*/, STRING *src /*NULLOK*/)
 {
     if (!src)
         return NULL;
@@ -2631,7 +2631,7 @@
 
 PARROT_API
 STRING*
-uint_to_str(Interp *interp,
+uint_to_str(Interp *interp /*NN*/,
             char *tc /*NN*/, UHUGEINTVAL num, char base, int minus)
 {
     /* the buffer must be at least as long as this */
@@ -2667,7 +2667,7 @@
 
 PARROT_API
 STRING *
-int_to_str(Interp *interp, char *tc /*NN*/, HUGEINTVAL num, char base)
+int_to_str(Interp *interp /*NN*/, char *tc /*NN*/, HUGEINTVAL num, char base)
 {
     const int minus = (num<0);
     if (minus)

Reply via email to