Change 27976 by [EMAIL PROTECTED] on 2006/04/27 12:29:47

        Subject: [PATCH] Removing unused context
        From: [EMAIL PROTECTED] (Andy Lester)
        Date: Thu, 27 Apr 2006 00:32:15 -0500
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/embed.fnc#364 edit
... //depot/perl/embed.h#591 edit
... //depot/perl/proto.h#709 edit
... //depot/perl/sv.c#1259 edit

Differences ...

==== //depot/perl/embed.fnc#364 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc#363~27947~   2006-04-24 02:40:58.000000000 -0700
+++ perl/embed.fnc      2006-04-27 05:29:47.000000000 -0700
@@ -1368,9 +1368,9 @@
 #  endif
 sR     |I32    |expect_number  |NN char** pattern
 #
-s      |STRLEN |sv_pos_u2b_forwards|NN const U8 *const start \
+sn     |STRLEN |sv_pos_u2b_forwards|NN const U8 *const start \
                |NN const U8 *const send|STRLEN uoffset
-s      |STRLEN |sv_pos_u2b_midway|NN const U8 *const start \
+sn     |STRLEN |sv_pos_u2b_midway|NN const U8 *const start \
                |NN const U8 *send|STRLEN uoffset|STRLEN uend
 s      |STRLEN |sv_pos_u2b_cached|NN SV *sv|NN MAGIC **mgp \
                |NN const U8 *const start|NN const U8 *const send \

==== //depot/perl/embed.h#591 (text+w) ====
Index: perl/embed.h
--- perl/embed.h#590~27947~     2006-04-24 02:40:58.000000000 -0700
+++ perl/embed.h        2006-04-27 05:29:47.000000000 -0700
@@ -3548,8 +3548,8 @@
 #define expect_number(a)       S_expect_number(aTHX_ a)
 #endif
 #ifdef PERL_CORE
-#define sv_pos_u2b_forwards(a,b,c)     S_sv_pos_u2b_forwards(aTHX_ a,b,c)
-#define sv_pos_u2b_midway(a,b,c,d)     S_sv_pos_u2b_midway(aTHX_ a,b,c,d)
+#define sv_pos_u2b_forwards    S_sv_pos_u2b_forwards
+#define sv_pos_u2b_midway      S_sv_pos_u2b_midway
 #define sv_pos_u2b_cached(a,b,c,d,e,f,g)       S_sv_pos_u2b_cached(aTHX_ 
a,b,c,d,e,f,g)
 #define utf8_mg_pos_cache_update(a,b,c,d,e)    
S_utf8_mg_pos_cache_update(aTHX_ a,b,c,d,e)
 #define sv_pos_b2u_forwards(a,b)       S_sv_pos_b2u_forwards(aTHX_ a,b)

==== //depot/perl/proto.h#709 (text+w) ====
Index: perl/proto.h
--- perl/proto.h#708~27947~     2006-04-24 02:40:58.000000000 -0700
+++ perl/proto.h        2006-04-27 05:29:47.000000000 -0700
@@ -3737,13 +3737,13 @@
                        __attribute__nonnull__(pTHX_1);
 
 #
-STATIC STRLEN  S_sv_pos_u2b_forwards(pTHX_ const U8 *const start, const U8 
*const send, STRLEN uoffset)
-                       __attribute__nonnull__(pTHX_1)
-                       __attribute__nonnull__(pTHX_2);
+STATIC STRLEN  S_sv_pos_u2b_forwards(const U8 *const start, const U8 *const 
send, STRLEN uoffset)
+                       __attribute__nonnull__(1)
+                       __attribute__nonnull__(2);
 
-STATIC STRLEN  S_sv_pos_u2b_midway(pTHX_ const U8 *const start, const U8 
*send, STRLEN uoffset, STRLEN uend)
-                       __attribute__nonnull__(pTHX_1)
-                       __attribute__nonnull__(pTHX_2);
+STATIC STRLEN  S_sv_pos_u2b_midway(const U8 *const start, const U8 *send, 
STRLEN uoffset, STRLEN uend)
+                       __attribute__nonnull__(1)
+                       __attribute__nonnull__(2);
 
 STATIC STRLEN  S_sv_pos_u2b_cached(pTHX_ SV *sv, MAGIC **mgp, const U8 *const 
start, const U8 *const send, STRLEN uoffset, STRLEN uoffset0, STRLEN boffset0)
                        __attribute__nonnull__(pTHX_1)

==== //depot/perl/sv.c#1259 (text) ====
Index: perl/sv.c
--- perl/sv.c#1258~27962~       2006-04-26 00:53:36.000000000 -0700
+++ perl/sv.c   2006-04-27 05:29:47.000000000 -0700
@@ -5366,13 +5366,11 @@
 /* Walk forwards to find the byte corresponding to the passed in UTF-8
    offset.  */
 static STRLEN
-S_sv_pos_u2b_forwards(pTHX_ const U8 *const start, const U8 *const send,
+S_sv_pos_u2b_forwards(const U8 *const start, const U8 *const send,
                      STRLEN uoffset)
 {
     const U8 *s = start;
 
-    PERL_UNUSED_CONTEXT;
-
     while (s < send && uoffset--)
        s += UTF8SKIP(s);
     if (s > send) {
@@ -5387,7 +5385,7 @@
    whether to walk forwards or backwards to find the byte corresponding to
    the passed in UTF-8 offset.  */
 static STRLEN
-S_sv_pos_u2b_midway(pTHX_ const U8 *const start, const U8 *send,
+S_sv_pos_u2b_midway(const U8 *const start, const U8 *send,
                      STRLEN uoffset, STRLEN uend)
 {
     STRLEN backw = uend - uoffset;
@@ -5395,7 +5393,7 @@
        /* The assumption is that going forwards is twice the speed of going
           forward (that's where the 2 * backw comes from).
           (The real figure of course depends on the UTF-8 data.)  */
-       return S_sv_pos_u2b_forwards(aTHX_ start, send, uoffset);
+       return sv_pos_u2b_forwards(start, send, uoffset);
     }
 
     while (backw--) {
@@ -5446,12 +5444,12 @@
                if ((*mgp)->mg_len != -1) {
                    /* And we know the end too.  */
                    boffset = boffset0
-                       + S_sv_pos_u2b_midway(aTHX_ start + boffset0, send,
+                       + sv_pos_u2b_midway(start + boffset0, send,
                                              uoffset - uoffset0,
                                              (*mgp)->mg_len - uoffset0);
                } else {
                    boffset = boffset0
-                       + S_sv_pos_u2b_forwards(aTHX_ start + boffset0,
+                       + sv_pos_u2b_forwards(start + boffset0,
                                                send, uoffset - uoffset0);
                }
            }
@@ -5464,13 +5462,13 @@
                }
 
                boffset = boffset0
-                   + S_sv_pos_u2b_midway(aTHX_ start + boffset0,
+                   + sv_pos_u2b_midway(start + boffset0,
                                          start + cache[1],
                                          uoffset - uoffset0,
                                          cache[0] - uoffset0);
            } else {
                boffset = boffset0
-                   + S_sv_pos_u2b_midway(aTHX_ start + boffset0,
+                   + sv_pos_u2b_midway(start + boffset0,
                                          start + cache[3],
                                          uoffset - uoffset0,
                                          cache[2] - uoffset0);
@@ -5482,7 +5480,7 @@
            /* In fact, offset0 is either 0, or less than offset, so don't
               need to worry about the other possibility.  */
            boffset = boffset0
-               + S_sv_pos_u2b_midway(aTHX_ start + boffset0, send,
+               + sv_pos_u2b_midway(start + boffset0, send,
                                      uoffset - uoffset0,
                                      (*mgp)->mg_len - uoffset0);
            found = TRUE;
@@ -5491,7 +5489,7 @@
 
     if (!found || PL_utf8cache < 0) {
        const STRLEN real_boffset
-           = boffset0 + S_sv_pos_u2b_forwards(aTHX_ start + boffset0,
+           = boffset0 + sv_pos_u2b_forwards(start + boffset0,
                                               send, uoffset - uoffset0);
 
        if (found && PL_utf8cache < 0) {
@@ -5546,16 +5544,16 @@
        STRLEN uoffset = (STRLEN) *offsetp;
        const U8 * const send = start + len;
        MAGIC *mg = NULL;
-       STRLEN boffset = S_sv_pos_u2b_cached(aTHX_ sv, &mg, start, send,
+       const STRLEN boffset = sv_pos_u2b_cached(sv, &mg, start, send,
                                             uoffset, 0, 0);
 
        *offsetp = (I32) boffset;
 
        if (lenp) {
            /* Convert the relative offset to absolute.  */
-           STRLEN uoffset2 = uoffset + (STRLEN) *lenp;
-           STRLEN boffset2
-               = S_sv_pos_u2b_cached(aTHX_ sv, &mg, start, send, uoffset2,
+           const STRLEN uoffset2 = uoffset + (STRLEN) *lenp;
+           const STRLEN boffset2
+               = sv_pos_u2b_cached(sv, &mg, start, send, uoffset2,
                                      uoffset, boffset) - boffset;
 
            *lenp = boffset2;
End of Patch.

Reply via email to