diff options
author | Gisle Aas <gisle@activestate.com> | 2006-01-04 13:53:16 +0000 |
---|---|---|
committer | Gisle Aas <gisle@activestate.com> | 2006-01-04 13:53:16 +0000 |
commit | 6a245ed1e7ef6f728779f8328fb52e42b1aa0b8c (patch) | |
tree | 2b22d2ba828e88be62274986b1e187fcf3861313 | |
parent | 359e8da2ef248b0ae5eba7c150226268a764452f (diff) | |
download | perl-6a245ed1e7ef6f728779f8328fb52e42b1aa0b8c.tar.gz |
Get rid of a few more hardcoded string lengths.
p4raw-id: //depot/perl@26645
-rw-r--r-- | locale.c | 16 | ||||
-rw-r--r-- | mg.c | 2 | ||||
-rw-r--r-- | perl.c | 2 | ||||
-rw-r--r-- | perlio.c | 10 | ||||
-rw-r--r-- | sv.c | 2 |
5 files changed, 16 insertions, 16 deletions
@@ -499,23 +499,23 @@ Perl_init_i18nl10n(pTHX_ int printwarn) codeset = nl_langinfo(CODESET); #endif if (codeset) - utf8locale = (ibcmp(codeset, "UTF-8", 5) == 0 || - ibcmp(codeset, "UTF8", 4) == 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 = (ibcmp(lang, "UTF-8", 5) == 0 || - ibcmp(lang, "UTF8", 4) == 0); + utf8locale = (ibcmp(lang, STR_WITH_LEN("UTF-8")) == 0 || + ibcmp(lang, STR_WITH_LEN("UTF8") ) == 0); #ifdef USE_LOCALE_CTYPE if (curctype) - utf8locale = (ibcmp(curctype, "UTF-8", 5) == 0 || - ibcmp(curctype, "UTF8", 4) == 0); + utf8locale = (ibcmp(curctype, STR_WITH_LEN("UTF-8")) == 0 || + ibcmp(curctype, STR_WITH_LEN("UTF8") ) == 0); #endif if (lc_all) - utf8locale = (ibcmp(lc_all, "UTF-8", 5) == 0 || - ibcmp(lc_all, "UTF8", 4) == 0); + utf8locale = (ibcmp(lc_all, STR_WITH_LEN("UTF-8")) == 0 || + ibcmp(lc_all, STR_WITH_LEN("UTF8") ) == 0); } #endif /* USE_LOCALE */ if (utf8locale) @@ -1444,7 +1444,7 @@ Perl_magic_setsig(pTHX_ SV *sv, MAGIC *mg) * tell whether HINT_STRICT_REFS is in force or not. */ if (!strchr(s,':') && !strchr(s,'\'')) - sv_insert(sv, 0, 0, "main::", 6); + sv_insert(sv, 0, 0, STR_WITH_LEN("main::")); if (i) (void)rsignal(i, PL_csighandlerp); else @@ -1861,7 +1861,7 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit) opts = space - pv; sv_insert(opts_prog, opts, 0, - "\\n ", 25); + STR_WITH_LEN("\\n ")); } sv_catpvs(opts_prog,"\\n\","); @@ -1414,20 +1414,20 @@ PerlIO_layer_from_ref(pTHX_ SV *sv) * For any scalar type load the handler which is bundled with perl */ if (SvTYPE(sv) < SVt_PVAV) - return PerlIO_find_layer(aTHX_ "scalar", 6, 1); + return PerlIO_find_layer(aTHX_ STR_WITH_LEN("scalar"), 1); /* * For other types allow if layer is known but don't try and load it */ switch (SvTYPE(sv)) { case SVt_PVAV: - return PerlIO_find_layer(aTHX_ "Array", 5, 0); + return PerlIO_find_layer(aTHX_ STR_WITH_LEN("Array"), 0); case SVt_PVHV: - return PerlIO_find_layer(aTHX_ "Hash", 4, 0); + return PerlIO_find_layer(aTHX_ STR_WITH_LEN("Hash"), 0); case SVt_PVCV: - return PerlIO_find_layer(aTHX_ "Code", 4, 0); + return PerlIO_find_layer(aTHX_ STR_WITH_LEN("Code"), 0); case SVt_PVGV: - return PerlIO_find_layer(aTHX_ "Glob", 4, 0); + return PerlIO_find_layer(aTHX_ STR_WITH_LEN("Glob"), 0); } return NULL; } @@ -11175,7 +11175,7 @@ S_varname(pTHX_ GV *gv, const char gvtype, PADOFFSET targ, Perl_sv_catpvf(aTHX_ name, "[%"IVdf"]", (IV)aindex); } else if (subscript_type == FUV_SUBSCRIPT_WITHIN) - sv_insert(name, 0, 0, "within ", 7); + sv_insert(name, 0, 0, STR_WITH_LEN("within ")); return name; } |