Author: petdance
Date: Mon Jun 18 06:34:35 2007
New Revision: 19085

Modified:
   trunk/include/parrot/key.h
   trunk/include/parrot/pmc.h
   trunk/include/parrot/string_funcs.h
   trunk/src/key.c
   trunk/src/pmc.c
   trunk/src/string.c

Log:
Adding more NN restrictions

Modified: trunk/include/parrot/key.h
==============================================================================
--- trunk/include/parrot/key.h  (original)
+++ trunk/include/parrot/key.h  Mon Jun 18 06:34:35 2007
@@ -3,7 +3,7 @@
  *  SVN Info
  *     $Id$
  *  Overview:
- *     This is the API header for the pmc subsystem
+ *     This is the API header for the PMC subsystem
  *  Data Structure and Algorithms:
  *  History:
  *  Notes:
@@ -47,17 +47,29 @@
 PARROT_API INTVAL key_integer( Interp *interp, PMC *key /*NN*/ )
         __attribute__nonnull__(2);
 
-PARROT_API void key_mark( Interp *interp, PMC *key /*NN*/ )
+PARROT_API void key_mark( Interp *interp /*NN*/, PMC *key /*NN*/ )
+        __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-PARROT_API PMC * key_new( Interp *interp );
-PARROT_API PMC * key_new_cstring( Interp *interp,
-    const char *value /*NULLOK*/ );
+PARROT_API PMC * key_new( Interp *interp /*NN*/ )
+        __attribute__nonnull__(1);
+
+PARROT_API PMC * key_new_cstring( Interp *interp /*NN*/,
+    const char *value /*NULLOK*/ )
+        __attribute__nonnull__(1);
+
+PARROT_API PMC * key_new_integer( Interp *interp /*NN*/, INTVAL value )
+        __attribute__nonnull__(1);
+
+PARROT_API PMC * key_new_number( Interp *interp /*NN*/, FLOATVAL value )
+        __attribute__nonnull__(1);
+
+PARROT_API PMC * key_new_pmc( Interp *interp /*NN*/, PMC *value )
+        __attribute__nonnull__(1);
+
+PARROT_API PMC * key_new_string( Interp *interp /*NN*/, STRING *value )
+        __attribute__nonnull__(1);
 
-PARROT_API PMC * key_new_integer( Interp *interp, INTVAL value );
-PARROT_API PMC * key_new_number( Interp *interp, FLOATVAL value );
-PARROT_API PMC * key_new_pmc( Interp *interp, PMC *value );
-PARROT_API PMC * key_new_string( Interp *interp, STRING *value );
 PARROT_API PMC * key_next( Interp *interp, PMC *key /*NN*/ )
         __attribute__nonnull__(2);
 
@@ -91,12 +103,15 @@
     STRING *value )
         __attribute__nonnull__(2);
 
-PARROT_API STRING * key_set_to_string( Interp *interp, PMC *key /*NULLOK*/ );
+PARROT_API STRING * key_set_to_string( Interp *interp /*NN*/,
+    PMC *key /*NULLOK*/ )
+        __attribute__nonnull__(1);
+
 PARROT_API STRING * key_string( Interp *interp /*NN*/, PMC *key /*NN*/ )
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
-PARROT_API INTVAL key_type( Interp *interp, PMC *key /*NN*/ )
+PARROT_API INTVAL key_type( Interp *interp, const PMC *key /*NN*/ )
         __attribute__nonnull__(2);
 
 /* HEADERIZER END: src/key.c */

Modified: trunk/include/parrot/pmc.h
==============================================================================
--- trunk/include/parrot/pmc.h  (original)
+++ trunk/include/parrot/pmc.h  Mon Jun 18 06:34:35 2007
@@ -21,12 +21,18 @@
 
 /* HEADERIZER BEGIN: src/pmc.c */
 
-PARROT_API PMC * constant_pmc_new( Interp *interp, INTVAL base_type );
-PARROT_API PMC * constant_pmc_new_init( Interp *interp,
+PARROT_API PMC * constant_pmc_new( Interp *interp /*NN*/, INTVAL base_type )
+        __attribute__nonnull__(1);
+
+PARROT_API PMC * constant_pmc_new_init( Interp *interp /*NN*/,
     INTVAL base_type,
-    PMC *init );
+    PMC *init )
+        __attribute__nonnull__(1);
+
+PARROT_API PMC * constant_pmc_new_noinit( Interp *interp /*NN*/,
+    INTVAL base_type )
+        __attribute__nonnull__(1);
 
-PARROT_API PMC * constant_pmc_new_noinit( Interp *interp, INTVAL base_type );
 PARROT_API void dod_register_pmc( Interp* interp /*NN*/, PMC* pmc )
         __attribute__nonnull__(1);
 
@@ -39,7 +45,11 @@
 PARROT_API PMC * pmc_new( Interp *interp /*NN*/, INTVAL base_type )
         __attribute__nonnull__(1);
 
-PARROT_API PMC * pmc_new_init( Interp *interp, INTVAL base_type, PMC *init );
+PARROT_API PMC * pmc_new_init( Interp *interp /*NN*/,
+    INTVAL base_type,
+    PMC *init )
+        __attribute__nonnull__(1);
+
 PARROT_API PMC * pmc_new_noinit( Interp *interp /*NN*/, INTVAL base_type )
         __attribute__nonnull__(1);
 
@@ -68,9 +78,6 @@
 
 /* HEADERIZER END: src/pmc.c */
 
-/* Internal use */
-PMC *pmc_init_null(Interp *interp);
-
 /* pmcinfo parameters */
 
 /* &gen_from_def(pmcinfo.pasm) */

Modified: trunk/include/parrot/string_funcs.h
==============================================================================
--- trunk/include/parrot/string_funcs.h (original)
+++ trunk/include/parrot/string_funcs.h Mon Jun 18 06:34:35 2007
@@ -174,9 +174,10 @@
     const UINTVAL len )
         __attribute__warn_unused_result__;
 
-PARROT_API STRING * string_from_cstring( Interp *interp,
+PARROT_API STRING * string_from_cstring( Interp *interp /*NN*/,
     const char * const buffer /*NULLOK*/,
     const UINTVAL len )
+        __attribute__nonnull__(1)
         __attribute__warn_unused_result__;
 
 PARROT_API STRING * string_from_int( Interp *interp /*NN*/, INTVAL i )

Modified: trunk/src/key.c
==============================================================================
--- trunk/src/key.c     (original)
+++ trunk/src/key.c     Mon Jun 18 06:34:35 2007
@@ -28,7 +28,7 @@
 
 PARROT_API
 PMC *
-key_new(Interp *interp)
+key_new(Interp *interp /*NN*/)
 {
     PMC * const key = pmc_new(interp, enum_class_Key);
 
@@ -44,7 +44,7 @@
 
 PARROT_API
 PMC *
-key_new_integer(Interp *interp, INTVAL value)
+key_new_integer(Interp *interp /*NN*/, INTVAL value)
 {
     PMC * const key = pmc_new(interp, enum_class_Key);
 
@@ -63,7 +63,7 @@
 
 PARROT_API
 PMC *
-key_new_number(Interp *interp, FLOATVAL value)
+key_new_number(Interp *interp /*NN*/, FLOATVAL value)
 {
     PMC * const key = pmc_new(interp, enum_class_Key);
 
@@ -82,7 +82,7 @@
 
 PARROT_API
 PMC *
-key_new_string(Interp *interp, STRING *value)
+key_new_string(Interp *interp /*NN*/, STRING *value)
 {
     PMC * const key = pmc_new(interp, enum_class_Key);
 
@@ -102,7 +102,7 @@
 
 PARROT_API
 PMC *
-key_new_cstring(Interp *interp, const char *value /*NULLOK*/)
+key_new_cstring(Interp *interp /*NN*/, const char *value /*NULLOK*/)
 {
     return key_new_string(interp,
             string_from_cstring(interp, value, 0));
@@ -117,7 +117,7 @@
 
 PARROT_API
 PMC *
-key_new_pmc(Interp *interp, PMC *value)
+key_new_pmc(Interp *interp /*NN*/, PMC *value)
 {
     PMC * const key = pmc_new(interp, enum_class_Key);
 
@@ -233,7 +233,7 @@
 
 PARROT_API
 INTVAL
-key_type(Interp *interp, PMC *key /*NN*/)
+key_type(Interp *interp, const PMC *key /*NN*/)
 {
     return (PObj_get_FLAGS(key) & KEY_type_FLAGS) & ~KEY_register_FLAG;
 }
@@ -386,7 +386,7 @@
 
 PARROT_API
 void
-key_mark(Interp *interp, PMC *key /*NN*/)
+key_mark(Interp *interp /*NN*/, PMC *key /*NN*/)
 {
     const UINTVAL flags = PObj_get_FLAGS(key) & KEY_type_FLAGS;
 
@@ -407,7 +407,7 @@
 
 PARROT_API
 STRING *
-key_set_to_string(Interp *interp, PMC *key /*NULLOK*/)
+key_set_to_string(Interp *interp /*NN*/, PMC *key /*NULLOK*/)
 {
     STRING * const semicolon = string_from_cstring(interp, " ; ", 3);
     STRING * const quote = string_from_cstring(interp, "'", 1);

Modified: trunk/src/pmc.c
==============================================================================
--- trunk/src/pmc.c     (original)
+++ trunk/src/pmc.c     Mon Jun 18 06:34:35 2007
@@ -155,6 +155,7 @@
 
 static PMC*
 get_new_pmc_header(Interp *interp /*NN*/, INTVAL base_type, UINTVAL flags)
+    /* WARN_UNUSED */
 {
     PMC *pmc;
     VTABLE *vtable = interp->vtables[base_type];
@@ -263,7 +264,7 @@
 
 PARROT_API
 PMC *
-constant_pmc_new_noinit(Interp *interp, INTVAL base_type)
+constant_pmc_new_noinit(Interp *interp /*NN*/, INTVAL base_type)
 {
     PMC * const pmc = get_new_pmc_header(interp, base_type,
             PObj_constant_FLAG);
@@ -279,7 +280,7 @@
 
 PARROT_API
 PMC *
-constant_pmc_new(Interp *interp, INTVAL base_type)
+constant_pmc_new(Interp *interp /*NN*/, INTVAL base_type)
 {
     PMC * const pmc = get_new_pmc_header(interp, base_type,
             PObj_constant_FLAG);
@@ -296,7 +297,7 @@
 
 PARROT_API
 PMC *
-pmc_new_init(Interp *interp, INTVAL base_type, PMC *init)
+pmc_new_init(Interp *interp /*NN*/, INTVAL base_type, PMC *init)
 {
     PMC * const pmc = pmc_new_noinit(interp, base_type);
 
@@ -314,7 +315,7 @@
 
 PARROT_API
 PMC *
-constant_pmc_new_init(Interp *interp, INTVAL base_type, PMC *init)
+constant_pmc_new_init(Interp *interp /*NN*/, INTVAL base_type, PMC *init)
 {
     PMC * const pmc = get_new_pmc_header(interp, base_type, 
PObj_constant_FLAG);
     VTABLE_init_pmc(interp, pmc, init);
@@ -399,7 +400,7 @@
 }
 
 static PMC*
-create_class_pmc(Interp *interp, INTVAL type)
+create_class_pmc(Interp *interp /*NN*/, INTVAL type)
 {
     /*
      * class interface - a PMC is its own class
@@ -596,8 +597,6 @@
 
 Initial version by Simon on 2001.10.20.
 
-=cut
-
 */
 
 

Modified: trunk/src/string.c
==============================================================================
--- trunk/src/string.c  (original)
+++ trunk/src/string.c  Mon Jun 18 06:34:35 2007
@@ -488,7 +488,7 @@
 
 PARROT_API
 STRING *
-string_from_cstring(Interp *interp,
+string_from_cstring(Interp *interp /*NN*/,
     const char * const buffer /*NULLOK*/, const UINTVAL len)
     /* WARN_UNUSED */
 {

Reply via email to