From: Vincent Pit Date: Wed, 26 Aug 2009 22:11:38 +0000 (+0200) Subject: Don't pass the the interpreter to is_ascii_string(), is_utf8_char(), is_utf8_string... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=668b6d8dc2c481045b335f0fb7fe2ccf9cc6e594;p=p5sagit%2Fp5-mst-13.2.git Don't pass the the interpreter to is_ascii_string(), is_utf8_char(), is_utf8_string(), is_utf8_string_loclen() as they don't need it --- diff --git a/embed.fnc b/embed.fnc index 3e829b6..d1728fa 100644 --- a/embed.fnc +++ b/embed.fnc @@ -481,11 +481,11 @@ ApPR |bool |is_uni_lower_lc|UV c ApPR |bool |is_uni_print_lc|UV c ApPR |bool |is_uni_punct_lc|UV c ApPR |bool |is_uni_xdigit_lc|UV c -Apd |bool |is_ascii_string|NN const U8 *s|STRLEN len -Apd |STRLEN |is_utf8_char |NN const U8 *s -Apd |bool |is_utf8_string |NN const U8 *s|STRLEN len -Apdmb |bool |is_utf8_string_loc|NN const U8 *s|STRLEN len|NULLOK const U8 **p -Apd |bool |is_utf8_string_loclen|NN const U8 *s|STRLEN len|NULLOK const U8 **ep|NULLOK STRLEN *el +Anpd |bool |is_ascii_string|NN const U8 *s|STRLEN len +Anpd |STRLEN |is_utf8_char |NN const U8 *s +Anpd |bool |is_utf8_string |NN const U8 *s|STRLEN len +Anpdmb |bool |is_utf8_string_loc|NN const U8 *s|STRLEN len|NULLOK const U8 **p +Anpd |bool |is_utf8_string_loclen|NN const U8 *s|STRLEN len|NULLOK const U8 **ep|NULLOK STRLEN *el ApR |bool |is_utf8_alnum |NN const U8 *p ApR |bool |is_utf8_alnumc |NN const U8 *p ApR |bool |is_utf8_idfirst|NN const U8 *p diff --git a/embed.h b/embed.h index ba78d60..64cc12b 100644 --- a/embed.h +++ b/embed.h @@ -2702,10 +2702,10 @@ #define is_uni_print_lc(a) Perl_is_uni_print_lc(aTHX_ a) #define is_uni_punct_lc(a) Perl_is_uni_punct_lc(aTHX_ a) #define is_uni_xdigit_lc(a) Perl_is_uni_xdigit_lc(aTHX_ a) -#define is_ascii_string(a,b) Perl_is_ascii_string(aTHX_ a,b) -#define is_utf8_char(a) Perl_is_utf8_char(aTHX_ a) -#define is_utf8_string(a,b) Perl_is_utf8_string(aTHX_ a,b) -#define is_utf8_string_loclen(a,b,c,d) Perl_is_utf8_string_loclen(aTHX_ a,b,c,d) +#define is_ascii_string Perl_is_ascii_string +#define is_utf8_char Perl_is_utf8_char +#define is_utf8_string Perl_is_utf8_string +#define is_utf8_string_loclen Perl_is_utf8_string_loclen #define is_utf8_alnum(a) Perl_is_utf8_alnum(aTHX_ a) #define is_utf8_alnumc(a) Perl_is_utf8_alnumc(aTHX_ a) #define is_utf8_idfirst(a) Perl_is_utf8_idfirst(aTHX_ a) diff --git a/proto.h b/proto.h index 8c52f5a..7c18de1 100644 --- a/proto.h +++ b/proto.h @@ -1281,28 +1281,28 @@ PERL_CALLCONV bool Perl_is_uni_xdigit_lc(pTHX_ UV c) __attribute__warn_unused_result__ __attribute__pure__; -PERL_CALLCONV bool Perl_is_ascii_string(pTHX_ const U8 *s, STRLEN len) - __attribute__nonnull__(pTHX_1); +PERL_CALLCONV bool Perl_is_ascii_string(const U8 *s, STRLEN len) + __attribute__nonnull__(1); #define PERL_ARGS_ASSERT_IS_ASCII_STRING \ assert(s) -PERL_CALLCONV STRLEN Perl_is_utf8_char(pTHX_ const U8 *s) - __attribute__nonnull__(pTHX_1); +PERL_CALLCONV STRLEN Perl_is_utf8_char(const U8 *s) + __attribute__nonnull__(1); #define PERL_ARGS_ASSERT_IS_UTF8_CHAR \ assert(s) -PERL_CALLCONV bool Perl_is_utf8_string(pTHX_ const U8 *s, STRLEN len) - __attribute__nonnull__(pTHX_1); +PERL_CALLCONV bool Perl_is_utf8_string(const U8 *s, STRLEN len) + __attribute__nonnull__(1); #define PERL_ARGS_ASSERT_IS_UTF8_STRING \ assert(s) -/* PERL_CALLCONV bool Perl_is_utf8_string_loc(pTHX_ const U8 *s, STRLEN len, const U8 **p) - __attribute__nonnull__(pTHX_1); */ +/* PERL_CALLCONV bool Perl_is_utf8_string_loc(const U8 *s, STRLEN len, const U8 **p) + __attribute__nonnull__(1); */ #define PERL_ARGS_ASSERT_IS_UTF8_STRING_LOC \ assert(s) -PERL_CALLCONV bool Perl_is_utf8_string_loclen(pTHX_ const U8 *s, STRLEN len, const U8 **ep, STRLEN *el) - __attribute__nonnull__(pTHX_1); +PERL_CALLCONV bool Perl_is_utf8_string_loclen(const U8 *s, STRLEN len, const U8 **ep, STRLEN *el) + __attribute__nonnull__(1); #define PERL_ARGS_ASSERT_IS_UTF8_STRING_LOCLEN \ assert(s) diff --git a/utf8.c b/utf8.c index 4bf4705..9a242e0 100644 --- a/utf8.c +++ b/utf8.c @@ -66,13 +66,12 @@ See also is_utf8_string(), is_utf8_string_loclen(), and is_utf8_string_loc(). */ bool -Perl_is_ascii_string(pTHX_ const U8 *s, STRLEN len) +Perl_is_ascii_string(const U8 *s, STRLEN len) { const U8* const send = s + (len ? len : strlen((const char *)s)); const U8* x = s; PERL_ARGS_ASSERT_IS_ASCII_STRING; - PERL_UNUSED_CONTEXT; for (; x < send; ++x) { if (!UTF8_IS_INVARIANT(*x)) @@ -285,12 +284,11 @@ character will be returned if it is valid, otherwise 0. =cut */ STRLEN -Perl_is_utf8_char(pTHX_ const U8 *s) +Perl_is_utf8_char(const U8 *s) { const STRLEN len = UTF8SKIP(s); PERL_ARGS_ASSERT_IS_UTF8_CHAR; - PERL_UNUSED_CONTEXT; #ifdef IS_UTF8_CHAR if (IS_UTF8_CHAR_FAST(len)) return IS_UTF8_CHAR(s, len) ? len : 0; @@ -313,13 +311,12 @@ See also is_ascii_string(), is_utf8_string_loclen(), and is_utf8_string_loc(). */ bool -Perl_is_utf8_string(pTHX_ const U8 *s, STRLEN len) +Perl_is_utf8_string(const U8 *s, STRLEN len) { const U8* const send = s + (len ? len : strlen((const char *)s)); const U8* x = s; PERL_ARGS_ASSERT_IS_UTF8_STRING; - PERL_UNUSED_CONTEXT; while (x < send) { STRLEN c; @@ -378,7 +375,7 @@ See also is_utf8_string_loc() and is_utf8_string(). */ bool -Perl_is_utf8_string_loclen(pTHX_ const U8 *s, STRLEN len, const U8 **ep, STRLEN *el) +Perl_is_utf8_string_loclen(const U8 *s, STRLEN len, const U8 **ep, STRLEN *el) { const U8* const send = s + (len ? len : strlen((const char *)s)); const U8* x = s; @@ -386,7 +383,6 @@ Perl_is_utf8_string_loclen(pTHX_ const U8 *s, STRLEN len, const U8 **ep, STRLEN STRLEN outlen = 0; PERL_ARGS_ASSERT_IS_UTF8_STRING_LOCLEN; - PERL_UNUSED_CONTEXT; while (x < send) { /* Inline the easy bits of is_utf8_char() here for speed... */