From: Vincent Pit Date: Thu, 27 Aug 2009 08:38:34 +0000 (+0200) Subject: delimcopy(), ibcmp(), ibcmp_locale(), instr(), ninstr() and rninstr() from util.c... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=04c9e624265a2bf3bdeecd0310e754b5ecc8bbeb;p=p5sagit%2Fp5-mst-13.2.git delimcopy(), ibcmp(), ibcmp_locale(), instr(), ninstr() and rninstr() from util.c don't need the interpreter as well --- diff --git a/embed.fnc b/embed.fnc index d1728fa..f2c7050 100644 --- a/embed.fnc +++ b/embed.fnc @@ -209,7 +209,7 @@ Ap |void |debprofdump Ap |I32 |debop |NN const OP* o Ap |I32 |debstack Ap |I32 |debstackptrs -Ap |char* |delimcpy |NN char* to|NN const char* toend|NN const char* from \ +Anp |char* |delimcpy |NN char* to|NN const char* toend|NN const char* from \ |NN const char* fromend|int delim|NN I32* retlen : Used in op.c, perl.c pM |void |delete_eval_scope @@ -424,8 +424,8 @@ Abmd |HE* |hv_store_ent |NULLOK HV *hv|NULLOK SV *key|NULLOK SV *val\ AbmdM |SV** |hv_store_flags |NULLOK HV *hv|NULLOK const char *key \ |I32 klen|NULLOK SV *val|U32 hash|int flags Apd |void |hv_undef |NULLOK HV *hv -ApP |I32 |ibcmp |NN const char* a|NN const char* b|I32 len -ApP |I32 |ibcmp_locale |NN const char* a|NN const char* b|I32 len +AnpP |I32 |ibcmp |NN const char* a|NN const char* b|I32 len +AnpP |I32 |ibcmp_locale |NN const char* a|NN const char* b|I32 len Apd |I32 |ibcmp_utf8 |NN const char *s1|NULLOK char **pe1|UV l1 \ |bool u1|NN const char *s2|NULLOK char **pe2 \ |UV l2|bool u2 @@ -440,7 +440,7 @@ Ap |void |init_stacks Ap |void |init_tm |NN struct tm *ptm : Used in perly.y pd |U32 |intro_my -ApPR |char* |instr |NN const char* big|NN const char* little +AnpPR |char* |instr |NN const char* big|NN const char* little : Used in sv.c p |bool |io_close |NN IO* io|bool not_implicit : Used in perly.y @@ -727,7 +727,7 @@ Apd |SV* |vstringify |NN SV *vs Apd |int |vcmp |NN SV *lhv|NN SV *rhv : Used in pp_hot.c and pp_sys.c p |PerlIO*|nextargv |NN GV* gv -ApP |char* |ninstr |NN const char* big|NN const char* bigend \ +AnpP |char* |ninstr |NN const char* big|NN const char* bigend \ |NN const char* little|NN const char* lend Ap |void |op_free |NULLOK OP* arg : Used in perly.y @@ -861,7 +861,7 @@ EXp |SV*|reg_qr_package|NN REGEXP * const rx : FIXME - why the E? Ep |void |regprop |NULLOK const regexp *prog|NN SV* sv|NN const regnode* o Ap |void |repeatcpy |NN char* to|NN const char* from|I32 len|I32 count -ApP |char* |rninstr |NN const char* big|NN const char* bigend \ +AnpP |char* |rninstr |NN const char* big|NN const char* bigend \ |NN const char* little|NN const char* lend Ap |Sighandler_t|rsignal |int i|Sighandler_t t : Used in pp_sys.c diff --git a/embed.h b/embed.h index 64cc12b..921c63d 100644 --- a/embed.h +++ b/embed.h @@ -2474,7 +2474,7 @@ #define debop(a) Perl_debop(aTHX_ a) #define debstack() Perl_debstack(aTHX) #define debstackptrs() Perl_debstackptrs(aTHX) -#define delimcpy(a,b,c,d,e,f) Perl_delimcpy(aTHX_ a,b,c,d,e,f) +#define delimcpy Perl_delimcpy #ifdef PERL_CORE #define delete_eval_scope() Perl_delete_eval_scope(aTHX) #define deprecate(a) Perl_deprecate(aTHX_ a) @@ -2644,8 +2644,8 @@ #endif #endif #define hv_undef(a) Perl_hv_undef(aTHX_ a) -#define ibcmp(a,b,c) Perl_ibcmp(aTHX_ a,b,c) -#define ibcmp_locale(a,b,c) Perl_ibcmp_locale(aTHX_ a,b,c) +#define ibcmp Perl_ibcmp +#define ibcmp_locale Perl_ibcmp_locale #define ibcmp_utf8(a,b,c,d,e,f,g,h) Perl_ibcmp_utf8(aTHX_ a,b,c,d,e,f,g,h) #if defined(PERL_IN_DOIO_C) || defined(PERL_DECL_PROT) #ifdef PERL_CORE @@ -2661,7 +2661,7 @@ #ifdef PERL_CORE #define intro_my() Perl_intro_my(aTHX) #endif -#define instr(a,b) Perl_instr(aTHX_ a,b) +#define instr Perl_instr #ifdef PERL_CORE #define io_close(a,b) Perl_io_close(aTHX_ a,b) #define invert(a) Perl_invert(aTHX_ a) @@ -2947,7 +2947,7 @@ #ifdef PERL_CORE #define nextargv(a) Perl_nextargv(aTHX_ a) #endif -#define ninstr(a,b,c,d) Perl_ninstr(aTHX_ a,b,c,d) +#define ninstr Perl_ninstr #define op_free(a) Perl_op_free(aTHX_ a) #ifdef PERL_MAD #ifdef PERL_CORE @@ -3077,7 +3077,7 @@ #define regprop(a,b,c) Perl_regprop(aTHX_ a,b,c) #endif #define repeatcpy(a,b,c,d) Perl_repeatcpy(aTHX_ a,b,c,d) -#define rninstr(a,b,c,d) Perl_rninstr(aTHX_ a,b,c,d) +#define rninstr Perl_rninstr #define rsignal(a,b) Perl_rsignal(aTHX_ a,b) #ifdef PERL_CORE #define rsignal_restore(a,b) Perl_rsignal_restore(aTHX_ a,b) diff --git a/locale.c b/locale.c index f7cb79c..16ccce8 100644 --- a/locale.c +++ b/locale.c @@ -522,23 +522,23 @@ Perl_init_i18nl10n(pTHX_ int printwarn) codeset = nl_langinfo(CODESET); #endif if (codeset) - utf8locale = (Perl_ibcmp(aTHX_ codeset, STR_WITH_LEN("UTF-8")) == 0 || - Perl_ibcmp(aTHX_ codeset, STR_WITH_LEN("UTF8") ) == 0); + utf8locale = (ibcmp(codeset, STR_WITH_LEN("UTF-8")) == 0 || + ibcmp(codeset, STR_WITH_LEN("UTF8") ) == 0); #if defined(USE_LOCALE) else { /* nl_langinfo(CODESET) is supposed to correctly * interpret the locale environment variables, * but just in case it fails, let's do this manually. */ if (lang) - utf8locale = (Perl_ibcmp(aTHX_ lang, STR_WITH_LEN("UTF-8")) == 0 || - Perl_ibcmp(aTHX_ lang, STR_WITH_LEN("UTF8") ) == 0); + utf8locale = (ibcmp(lang, STR_WITH_LEN("UTF-8")) == 0 || + ibcmp(lang, STR_WITH_LEN("UTF8") ) == 0); #ifdef USE_LOCALE_CTYPE if (curctype) - utf8locale = (Perl_ibcmp(aTHX_ curctype, STR_WITH_LEN("UTF-8")) == 0 || - Perl_ibcmp(aTHX_ curctype, STR_WITH_LEN("UTF8") ) == 0); + utf8locale = (ibcmp(curctype, STR_WITH_LEN("UTF-8")) == 0 || + ibcmp(curctype, STR_WITH_LEN("UTF8") ) == 0); #endif if (lc_all) - utf8locale = (Perl_ibcmp(aTHX_ lc_all, STR_WITH_LEN("UTF-8")) == 0 || - Perl_ibcmp(aTHX_ lc_all, STR_WITH_LEN("UTF8") ) == 0); + utf8locale = (ibcmp(lc_all, STR_WITH_LEN("UTF-8")) == 0 || + ibcmp(lc_all, STR_WITH_LEN("UTF8") ) == 0); } #endif /* USE_LOCALE */ if (utf8locale) diff --git a/proto.h b/proto.h index 7c18de1..cb04ab8 100644 --- a/proto.h +++ b/proto.h @@ -506,12 +506,12 @@ PERL_CALLCONV I32 Perl_debop(pTHX_ const OP* o) PERL_CALLCONV I32 Perl_debstack(pTHX); PERL_CALLCONV I32 Perl_debstackptrs(pTHX); -PERL_CALLCONV char* Perl_delimcpy(pTHX_ char* to, const char* toend, const char* from, const char* fromend, int delim, I32* retlen) - __attribute__nonnull__(pTHX_1) - __attribute__nonnull__(pTHX_2) - __attribute__nonnull__(pTHX_3) - __attribute__nonnull__(pTHX_4) - __attribute__nonnull__(pTHX_6); +PERL_CALLCONV char* Perl_delimcpy(char* to, const char* toend, const char* from, const char* fromend, int delim, I32* retlen) + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3) + __attribute__nonnull__(4) + __attribute__nonnull__(6); #define PERL_ARGS_ASSERT_DELIMCPY \ assert(to); assert(toend); assert(from); assert(fromend); assert(retlen) @@ -1076,17 +1076,17 @@ STATIC struct refcounted_he * S_refcounted_he_new_common(pTHX_ struct refcounted /* PERL_CALLCONV HE* Perl_hv_store_ent(pTHX_ HV *hv, SV *key, SV *val, U32 hash); */ /* PERL_CALLCONV SV** Perl_hv_store_flags(pTHX_ HV *hv, const char *key, I32 klen, SV *val, U32 hash, int flags); */ PERL_CALLCONV void Perl_hv_undef(pTHX_ HV *hv); -PERL_CALLCONV I32 Perl_ibcmp(pTHX_ const char* a, const char* b, I32 len) +PERL_CALLCONV I32 Perl_ibcmp(const char* a, const char* b, I32 len) __attribute__pure__ - __attribute__nonnull__(pTHX_1) - __attribute__nonnull__(pTHX_2); + __attribute__nonnull__(1) + __attribute__nonnull__(2); #define PERL_ARGS_ASSERT_IBCMP \ assert(a); assert(b) -PERL_CALLCONV I32 Perl_ibcmp_locale(pTHX_ const char* a, const char* b, I32 len) +PERL_CALLCONV I32 Perl_ibcmp_locale(const char* a, const char* b, I32 len) __attribute__pure__ - __attribute__nonnull__(pTHX_1) - __attribute__nonnull__(pTHX_2); + __attribute__nonnull__(1) + __attribute__nonnull__(2); #define PERL_ARGS_ASSERT_IBCMP_LOCALE \ assert(a); assert(b) @@ -1114,11 +1114,11 @@ PERL_CALLCONV void Perl_init_tm(pTHX_ struct tm *ptm) assert(ptm) PERL_CALLCONV U32 Perl_intro_my(pTHX); -PERL_CALLCONV char* Perl_instr(pTHX_ const char* big, const char* little) +PERL_CALLCONV char* Perl_instr(const char* big, const char* little) __attribute__warn_unused_result__ __attribute__pure__ - __attribute__nonnull__(pTHX_1) - __attribute__nonnull__(pTHX_2); + __attribute__nonnull__(1) + __attribute__nonnull__(2); #define PERL_ARGS_ASSERT_INSTR \ assert(big); assert(little) @@ -2309,12 +2309,12 @@ PERL_CALLCONV PerlIO* Perl_nextargv(pTHX_ GV* gv) #define PERL_ARGS_ASSERT_NEXTARGV \ assert(gv) -PERL_CALLCONV char* Perl_ninstr(pTHX_ const char* big, const char* bigend, const char* little, const char* lend) +PERL_CALLCONV char* Perl_ninstr(const char* big, const char* bigend, const char* little, const char* lend) __attribute__pure__ - __attribute__nonnull__(pTHX_1) - __attribute__nonnull__(pTHX_2) - __attribute__nonnull__(pTHX_3) - __attribute__nonnull__(pTHX_4); + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3) + __attribute__nonnull__(4); #define PERL_ARGS_ASSERT_NINSTR \ assert(big); assert(bigend); assert(little); assert(lend) @@ -2671,12 +2671,12 @@ PERL_CALLCONV void Perl_repeatcpy(pTHX_ char* to, const char* from, I32 len, I32 #define PERL_ARGS_ASSERT_REPEATCPY \ assert(to); assert(from) -PERL_CALLCONV char* Perl_rninstr(pTHX_ const char* big, const char* bigend, const char* little, const char* lend) +PERL_CALLCONV char* Perl_rninstr(const char* big, const char* bigend, const char* little, const char* lend) __attribute__pure__ - __attribute__nonnull__(pTHX_1) - __attribute__nonnull__(pTHX_2) - __attribute__nonnull__(pTHX_3) - __attribute__nonnull__(pTHX_4); + __attribute__nonnull__(1) + __attribute__nonnull__(2) + __attribute__nonnull__(3) + __attribute__nonnull__(4); #define PERL_ARGS_ASSERT_RNINSTR \ assert(big); assert(bigend); assert(little); assert(lend) diff --git a/util.c b/util.c index 95bdd37..3f43393 100644 --- a/util.c +++ b/util.c @@ -369,10 +369,9 @@ Free_t Perl_mfree (Malloc_t where) /* copy a string up to some (non-backslashed) delimiter, if any */ char * -Perl_delimcpy(pTHX_ register char *to, register const char *toend, register const char *from, register const char *fromend, register int delim, I32 *retlen) +Perl_delimcpy(register char *to, register const char *toend, register const char *from, register const char *fromend, register int delim, I32 *retlen) { register I32 tolen; - PERL_UNUSED_CONTEXT; PERL_ARGS_ASSERT_DELIMCPY; @@ -400,10 +399,9 @@ Perl_delimcpy(pTHX_ register char *to, register const char *toend, register cons /* This routine was donated by Corey Satten. */ char * -Perl_instr(pTHX_ register const char *big, register const char *little) +Perl_instr(register const char *big, register const char *little) { register I32 first; - PERL_UNUSED_CONTEXT; PERL_ARGS_ASSERT_INSTR; @@ -435,10 +433,9 @@ Perl_instr(pTHX_ register const char *big, register const char *little) /* same as instr but allow embedded nulls */ char * -Perl_ninstr(pTHX_ const char *big, const char *bigend, const char *little, const char *lend) +Perl_ninstr(const char *big, const char *bigend, const char *little, const char *lend) { PERL_ARGS_ASSERT_NINSTR; - PERL_UNUSED_CONTEXT; if (little >= lend) return (char*)big; { @@ -462,12 +459,11 @@ Perl_ninstr(pTHX_ const char *big, const char *bigend, const char *little, const /* reverse of the above--find last substring */ char * -Perl_rninstr(pTHX_ register const char *big, const char *bigend, const char *little, const char *lend) +Perl_rninstr(register const char *big, const char *bigend, const char *little, const char *lend) { register const char *bigbeg; register const I32 first = *little; register const char * const littleend = lend; - PERL_UNUSED_CONTEXT; PERL_ARGS_ASSERT_RNINSTR; @@ -883,11 +879,10 @@ Perl_screaminstr(pTHX_ SV *bigstr, SV *littlestr, I32 start_shift, I32 end_shift } I32 -Perl_ibcmp(pTHX_ const char *s1, const char *s2, register I32 len) +Perl_ibcmp(const char *s1, const char *s2, register I32 len) { register const U8 *a = (const U8 *)s1; register const U8 *b = (const U8 *)s2; - PERL_UNUSED_CONTEXT; PERL_ARGS_ASSERT_IBCMP; @@ -900,12 +895,11 @@ Perl_ibcmp(pTHX_ const char *s1, const char *s2, register I32 len) } I32 -Perl_ibcmp_locale(pTHX_ const char *s1, const char *s2, register I32 len) +Perl_ibcmp_locale(const char *s1, const char *s2, register I32 len) { dVAR; register const U8 *a = (const U8 *)s1; register const U8 *b = (const U8 *)s2; - PERL_UNUSED_CONTEXT; PERL_ARGS_ASSERT_IBCMP_LOCALE;