[svn:parrot] r45267 - in trunk: include/parrot src

petdance at svn.parrot.org petdance at svn.parrot.org
Mon Mar 29 05:36:43 UTC 2010


Author: petdance
Date: Mon Mar 29 05:36:43 2010
New Revision: 45267
URL: https://trac.parrot.org/parrot/changeset/45267

Log:
consting and adding a PARROT_WARN_UNUSED_RESULT flag

Modified:
   trunk/include/parrot/pmc.h
   trunk/src/pmc.c

Modified: trunk/include/parrot/pmc.h
==============================================================================
--- trunk/include/parrot/pmc.h	Mon Mar 29 05:36:19 2010	(r45266)
+++ trunk/include/parrot/pmc.h	Mon Mar 29 05:36:43 2010	(r45267)
@@ -53,6 +53,7 @@
         __attribute__nonnull__(1);
 
 PARROT_EXPORT
+PARROT_WARN_UNUSED_RESULT
 INTVAL Parrot_pmc_is_null(SHIM_INTERP, ARGIN_NULLOK(const PMC *pmc));
 
 PARROT_EXPORT

Modified: trunk/src/pmc.c
==============================================================================
--- trunk/src/pmc.c	Mon Mar 29 05:36:19 2010	(r45266)
+++ trunk/src/pmc.c	Mon Mar 29 05:36:43 2010	(r45267)
@@ -81,6 +81,7 @@
 */
 
 PARROT_EXPORT
+PARROT_WARN_UNUSED_RESULT
 INTVAL
 Parrot_pmc_is_null(SHIM_INTERP, ARGIN_NULLOK(const PMC *pmc))
 {
@@ -982,7 +983,7 @@
 
     do {
         INTVAL len;
-        INTVAL idx = Parrot_str_find_index(interp, what, role, (INTVAL)pos);
+        const INTVAL idx = Parrot_str_find_index(interp, what, role, (INTVAL)pos);
 
         if (idx < 0)
             return 0;


More information about the parrot-commits mailing list