[svn:parrot] r45265 - trunk/src/string/encoding

petdance at svn.parrot.org petdance at svn.parrot.org
Mon Mar 29 04:54:38 UTC 2010


Author: petdance
Date: Mon Mar 29 04:54:38 2010
New Revision: 45265
URL: https://trac.parrot.org/parrot/changeset/45265

Log:
localizing vars and shimming unused parms

Modified:
   trunk/src/string/encoding/utf8.c

Modified: trunk/src/string/encoding/utf8.c
==============================================================================
--- trunk/src/string/encoding/utf8.c	Mon Mar 29 04:24:37 2010	(r45264)
+++ trunk/src/string/encoding/utf8.c	Mon Mar 29 04:54:38 2010	(r45265)
@@ -41,14 +41,12 @@
 
 PARROT_WARN_UNUSED_RESULT
 static UINTVAL find_cclass(PARROT_INTERP,
-    ARGIN(STRING *s),
-    ARGIN(const INTVAL *typetable),
-    INTVAL flags,
-    UINTVAL pos,
-    UINTVAL end)
-        __attribute__nonnull__(1)
-        __attribute__nonnull__(2)
-        __attribute__nonnull__(3);
+    SHIM(STRING *s),
+    SHIM(const INTVAL *typetable),
+    SHIM(INTVAL flags),
+    SHIM(UINTVAL pos),
+    SHIM(UINTVAL end))
+        __attribute__nonnull__(1);
 
 static UINTVAL get_byte(SHIM_INTERP,
     ARGIN(const STRING *src),
@@ -193,9 +191,7 @@
        PARROT_ASSERT_ARG(interp) \
     , PARROT_ASSERT_ARG(src))
 #define ASSERT_ARGS_find_cclass __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
-       PARROT_ASSERT_ARG(interp) \
-    , PARROT_ASSERT_ARG(s) \
-    , PARROT_ASSERT_ARG(typetable))
+       PARROT_ASSERT_ARG(interp))
 #define ASSERT_ARGS_get_byte __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
        PARROT_ASSERT_ARG(src))
 #define ASSERT_ARGS_get_bytes __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
@@ -286,6 +282,8 @@
 
 Returns the number of characters in the C<byte_len> bytes from C<*ptr>.
 
+XXX This function is unused.
+
 =cut
 
 */
@@ -421,6 +419,8 @@
 
 Moves C<ptr> C<n> characters back.
 
+XXX This function is unused.
+
 =cut
 
 */
@@ -585,7 +585,7 @@
     String_iter src_iter;
     UINTVAL offs, dest_len, dest_pos, src_len;
     const int in_place = (dest == NULL);
-    unsigned char *new_pos, *pos, *p;
+    unsigned char *p;
 
     if (src->encoding == Parrot_utf8_encoding_ptr)
         return in_place ? src : Parrot_str_copy(interp, src);
@@ -625,6 +625,9 @@
         dest_pos = 0;
         for (offs = 0; offs < src_len; ++offs) {
             const UINTVAL c = src_iter.get_and_advance(interp, &src_iter);
+            unsigned char *new_pos;
+            unsigned char *pos;
+
             if (dest_len - dest_pos < 6) {
                 UINTVAL need = (UINTVAL)((src->strlen - offs) * 1.5);
                 if (need < 16)
@@ -709,8 +712,8 @@
 
 PARROT_WARN_UNUSED_RESULT
 static UINTVAL
-find_cclass(PARROT_INTERP, ARGIN(STRING *s), ARGIN(const INTVAL *typetable),
-INTVAL flags, UINTVAL pos, UINTVAL end)
+find_cclass(PARROT_INTERP, SHIM(STRING *s), SHIM(const INTVAL *typetable),
+SHIM(INTVAL flags), SHIM(UINTVAL pos), SHIM(UINTVAL end))
 {
     Parrot_ex_throw_from_c_args(interp, NULL,
         EXCEPTION_UNIMPLEMENTED,


More information about the parrot-commits mailing list