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

petdance at svn.parrot.org petdance at svn.parrot.org
Sat May 16 20:20:49 UTC 2009


Author: petdance
Date: Sat May 16 20:20:49 2009
New Revision: 38837
URL: https://trac.parrot.org/parrot/changeset/38837

Log:
quieted some splint warnings; consted some local vars

Modified:
   trunk/config/gen/makefiles/root.in
   trunk/include/parrot/oo.h
   trunk/src/oo.c

Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in	Sat May 16 20:15:09 2009	(r38836)
+++ trunk/config/gen/makefiles/root.in	Sat May 16 20:20:49 2009	(r38837)
@@ -2077,7 +2077,7 @@
 	$(MKPATH) $(SPLINT_TMP)
 	splint $(CC_INC) @cc_hasjit@ -DNDEBUG "-Isrc/pmc" "-Icompilers/ast" $(SPLINTFLAGS) $(SPLINTFLAGS_TEST) \
 	+partial -memchecks \
-	src/packfile.c \
+	src/oo.c \
     | grep -v 'Source code error generation point'
 
 COVER_FLAGS := -fprofile-arcs -ftest-coverage

Modified: trunk/include/parrot/oo.h
==============================================================================
--- trunk/include/parrot/oo.h	Sat May 16 20:15:09 2009	(r38836)
+++ trunk/include/parrot/oo.h	Sat May 16 20:20:49 2009	(r38837)
@@ -96,8 +96,7 @@
 PARROT_EXPORT
 PARROT_PURE_FUNCTION
 PARROT_CAN_RETURN_NULL
-const char * Parrot_get_vtable_name(PARROT_INTERP, INTVAL idx)
-        __attribute__nonnull__(1);
+const char * Parrot_get_vtable_name(SHIM_INTERP, INTVAL idx);
 
 PARROT_EXPORT
 void Parrot_invalidate_method_cache(PARROT_INTERP,
@@ -197,8 +196,7 @@
 #define ASSERT_ARGS_Parrot_get_vtable_index __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(name)
-#define ASSERT_ARGS_Parrot_get_vtable_name __attribute__unused__ int _ASSERT_ARGS_CHECK = \
-       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_get_vtable_name __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
 #define ASSERT_ARGS_Parrot_invalidate_method_cache \
      __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp)

Modified: trunk/src/oo.c
==============================================================================
--- trunk/src/oo.c	Sat May 16 20:15:09 2009	(r38836)
+++ trunk/src/oo.c	Sat May 16 20:20:49 2009	(r38837)
@@ -453,12 +453,12 @@
 PARROT_PURE_FUNCTION
 PARROT_CAN_RETURN_NULL
 const char *
-Parrot_get_vtable_name(PARROT_INTERP, INTVAL idx)
+Parrot_get_vtable_name(SHIM_INTERP, INTVAL idx)
 {
     ASSERT_ARGS(Parrot_get_vtable_name)
 
-    INTVAL low               = PARROT_VTABLE_LOW;
-    INTVAL high              = NUM_VTABLE_FUNCTIONS + PARROT_VTABLE_LOW;
+    const INTVAL low  = PARROT_VTABLE_LOW;
+    const INTVAL high = NUM_VTABLE_FUNCTIONS + PARROT_VTABLE_LOW;
 
     PARROT_ASSERT(idx > 0);
 
@@ -1117,14 +1117,14 @@
 {
     ASSERT_ARGS(Parrot_ComputeMRO_C3)
 
-    PMC *merge_list        = PMCNULL;
-    PMC *immediate_parents = VTABLE_inspect_str(interp, _class, CONST_STRING(interp, "parents"));
+    PMC * const immediate_parents = VTABLE_inspect_str(interp, _class, CONST_STRING(interp, "parents"));
+    PMC *merge_list;
     PMC *result;
 
-    int  i, parent_count;
+    INTVAL i;
+    INTVAL parent_count;
 
     /* Now get immediate parents list. */
-
     if (!immediate_parents)
         Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_METHOD_NOT_FOUND,
             "Failed to get parents list from class!");
@@ -1140,6 +1140,7 @@
 
     /* Otherwise, need to do merge. For that, need linearizations of all of
      * our parents added to the merge list. */
+    merge_list = PMCNULL;
     for (i = 0; i < parent_count; i++) {
         PMC * const lin = Parrot_ComputeMRO_C3(interp,
             VTABLE_get_pmc_keyed_int(interp, immediate_parents, i));


More information about the parrot-commits mailing list