Change 26795 by [EMAIL PROTECTED] on 2006/01/11 21:09:19
A few more places that can use hv_fetchs().
Ref change 26676.
Affected files ...
... //depot/perl/ext/POSIX/POSIX.xs#140 edit
... //depot/perl/gv.c#287 edit
... //depot/perl/mg.c#404 edit
... //depot/perl/pp_ctl.c#512 edit
... //depot/perl/toke.c#632 edit
... //depot/perl/universal.c#135 edit
... //depot/perl/utf8.c#270 edit
... //depot/perl/util.c#534 edit
Differences ...
==== //depot/perl/ext/POSIX/POSIX.xs#140 (text) ====
Index: perl/ext/POSIX/POSIX.xs
--- perl/ext/POSIX/POSIX.xs#139~25309~ 2005-08-19 14:19:37.000000000 -0700
+++ perl/ext/POSIX/POSIX.xs 2006-01-11 13:09:19.000000000 -0800
@@ -1317,7 +1317,7 @@
/* Remember old disposition if desired. */
if (oldaction) {
- svp = hv_fetch(oldaction, "HANDLER", 7, TRUE);
+ svp = hv_fetchs(oldaction, "HANDLER", TRUE);
if(!svp)
croak("Can't supply an oldaction without a HANDLER");
if(SvTRUE(*sigsvp)) { /* TBD: what if "0"? */
@@ -1330,7 +1330,7 @@
if(RETVAL == -1)
XSRETURN_UNDEF;
/* Get back the mask. */
- svp = hv_fetch(oldaction, "MASK", 4, TRUE);
+ svp = hv_fetchs(oldaction, "MASK", TRUE);
if (sv_isa(*svp, "POSIX::SigSet")) {
IV tmp = SvIV((SV*)SvRV(*svp));
sigset = INT2PTR(sigset_t*, tmp);
@@ -1342,11 +1342,11 @@
*sigset = oact.sa_mask;
/* Get back the flags. */
- svp = hv_fetch(oldaction, "FLAGS", 5, TRUE);
+ svp = hv_fetchs(oldaction, "FLAGS", TRUE);
sv_setiv(*svp, oact.sa_flags);
/* Get back whether the old handler used safe signals. */
- svp = hv_fetch(oldaction, "SAFE", 4, TRUE);
+ svp = hv_fetchs(oldaction, "SAFE", TRUE);
sv_setiv(*svp,
/* compare incompatible pointers by casting to integer */
PTR2nat(oact.sa_handler) == PTR2nat(PL_csighandlerp));
@@ -1356,7 +1356,7 @@
/* Safe signals use "csighandler", which vectors through the
PL_sighandlerp pointer when it's safe to do so.
(BTW, "csighandler" is very different from "sighandler".) */
- svp = hv_fetch(action, "SAFE", 4, FALSE);
+ svp = hv_fetchs(action, "SAFE", FALSE);
act.sa_handler =
DPTR2FPTR(
void (*)(),
@@ -1366,7 +1366,7 @@
/* Vector new Perl handler through %SIG.
(The core signal handlers read %SIG to dispatch.) */
- svp = hv_fetch(action, "HANDLER", 7, FALSE);
+ svp = hv_fetchs(action, "HANDLER", FALSE);
if (!svp)
croak("Can't supply an action without a HANDLER");
sv_setsv(*sigsvp, *svp);
@@ -1389,7 +1389,7 @@
}
/* Set up any desired mask. */
- svp = hv_fetch(action, "MASK", 4, FALSE);
+ svp = hv_fetchs(action, "MASK", FALSE);
if (svp && sv_isa(*svp, "POSIX::SigSet")) {
IV tmp = SvIV((SV*)SvRV(*svp));
sigset = INT2PTR(sigset_t*, tmp);
@@ -1399,7 +1399,7 @@
sigemptyset(& act.sa_mask);
/* Set up any desired flags. */
- svp = hv_fetch(action, "FLAGS", 5, FALSE);
+ svp = hv_fetchs(action, "FLAGS", FALSE);
act.sa_flags = svp ? SvIV(*svp) : 0;
/* Don't worry about cleaning up *sigsvp if this fails,
==== //depot/perl/gv.c#287 (text) ====
Index: perl/gv.c
--- perl/gv.c#286~26764~ 2006-01-10 02:51:16.000000000 -0800
+++ perl/gv.c 2006-01-11 13:09:19.000000000 -0800
@@ -330,7 +330,7 @@
return 0; /* cache indicates sub doesn't exist */
}
- gvp = (GV**)hv_fetch(stash, "ISA", 3, FALSE);
+ gvp = (GV**)hv_fetchs(stash, "ISA", FALSE);
av = (gvp && (gv = *gvp) && gv != (GV*)&PL_sv_undef) ? GvAV(gv) : NULL;
/* create and re-create @.*::SUPER::ISA on demand */
@@ -342,9 +342,9 @@
packlen -= 7;
basestash = gv_stashpvn(hvname, packlen, TRUE);
- gvp = (GV**)hv_fetch(basestash, "ISA", 3, FALSE);
+ gvp = (GV**)hv_fetchs(basestash, "ISA", FALSE);
if (gvp && (gv = *gvp) != (GV*)&PL_sv_undef && (av = GvAV(gv))) {
- gvp = (GV**)hv_fetch(stash, "ISA", 3, TRUE);
+ gvp = (GV**)hv_fetchs(stash, "ISA", TRUE);
if (!gvp || !(gv = *gvp))
Perl_croak(aTHX_ "Cannot create %s::ISA", hvname);
if (SvTYPE(gv) != SVt_PVGV)
@@ -815,7 +815,7 @@
namend++;
name = namend;
if (!*name)
- return gv ? gv : (GV*)*hv_fetch(PL_defstash, "main::", 6, TRUE);
+ return gv ? gv : (GV*)*hv_fetchs(PL_defstash, "main::", TRUE);
}
}
len = namend - name;
==== //depot/perl/mg.c#404 (text) ====
Index: perl/mg.c
--- perl/mg.c#403~26791~ 2006-01-11 12:50:30.000000000 -0800
+++ perl/mg.c 2006-01-11 13:09:19.000000000 -0800
@@ -818,7 +818,7 @@
* it could have been extended by warnings::register */
SV **bits_all;
HV * const bits=get_hv("warnings::Bits", FALSE);
- if (bits && (bits_all=hv_fetch(bits, "all", 3, FALSE))) {
+ if (bits && (bits_all=hv_fetchs(bits, "all", FALSE))) {
sv_setsv(sv, *bits_all);
}
else {
==== //depot/perl/pp_ctl.c#512 (text) ====
Index: perl/pp_ctl.c
--- perl/pp_ctl.c#511~26764~ 2006-01-10 02:51:16.000000000 -0800
+++ perl/pp_ctl.c 2006-01-11 13:09:19.000000000 -0800
@@ -1703,7 +1703,7 @@
* it could have been extended by warnings::register */
SV **bits_all;
HV * const bits = get_hv("warnings::Bits", FALSE);
- if (bits && (bits_all=hv_fetch(bits, "all", 3, FALSE))) {
+ if (bits && (bits_all=hv_fetchs(bits, "all", FALSE))) {
mask = newSVsv(*bits_all);
}
else {
==== //depot/perl/toke.c#632 (text) ====
Index: perl/toke.c
--- perl/toke.c#631~26767~ 2006-01-10 05:24:26.000000000 -0800
+++ perl/toke.c 2006-01-11 13:09:19.000000000 -0800
@@ -4208,7 +4208,7 @@
else if (gv && !gvp
&& -tmp==KEY_lock /* XXX generalizable kludge */
&& GvCVu(gv)
- && !hv_fetch(GvHVn(PL_incgv), "Thread.pm", 9, FALSE))
+ && !hv_fetchs(GvHVn(PL_incgv), "Thread.pm", FALSE))
{
tmp = 0; /* any sub overrides "weak" keyword */
}
@@ -10013,7 +10013,7 @@
if ((gv_readline
&& GvCVu(gv_readline) && GvIMPORTED_CV(gv_readline))
||
- ((gvp = (GV**)hv_fetch(PL_globalstash, "readline", 8, FALSE))
+ ((gvp = (GV**)hv_fetchs(PL_globalstash, "readline", FALSE))
&& (gv_readline = *gvp) != (GV*)&PL_sv_undef
&& GvCVu(gv_readline) && GvIMPORTED_CV(gv_readline)))
readline_overriden = TRUE;
==== //depot/perl/universal.c#135 (text) ====
Index: perl/universal.c
--- perl/universal.c#134~26675~ 2006-01-06 07:50:34.000000000 -0800
+++ perl/universal.c 2006-01-11 13:09:19.000000000 -0800
@@ -60,7 +60,7 @@
Perl_croak(aTHX_ "Recursive inheritance detected in package '%s'",
hvname);
- gvp = (GV**)hv_fetch(stash, "::ISA::CACHE::", 14, FALSE);
+ gvp = (GV**)hv_fetchs(stash, "::ISA::CACHE::", FALSE);
if (gvp && (gv = *gvp) != (GV*)&PL_sv_undef && (subgen = GvSV(gv))
&& (hv = GvHV(gv)))
@@ -82,11 +82,11 @@
}
}
- gvp = (GV**)hv_fetch(stash,"ISA",3,FALSE);
+ gvp = (GV**)hv_fetchs(stash, "ISA", FALSE);
if (gvp && (gv = *gvp) != (GV*)&PL_sv_undef && (av = GvAV(gv))) {
if (!hv || !subgen) {
- gvp = (GV**)hv_fetch(stash, "::ISA::CACHE::", 14, TRUE);
+ gvp = (GV**)hv_fetchs(stash, "::ISA::CACHE::", TRUE);
gv = *gvp;
@@ -342,7 +342,7 @@
pkg = gv_stashsv(ST(0), FALSE);
}
- gvp = pkg ? (GV**)hv_fetch(pkg,"VERSION",7,FALSE) : Null(GV**);
+ gvp = pkg ? (GV**)hv_fetchs(pkg, "VERSION", FALSE) : Null(GV**);
if (gvp && isGV(gv = *gvp) && (sv = GvSV(gv)) && SvOK(sv)) {
SV * const nsv = sv_newmortal();
==== //depot/perl/utf8.c#270 (text) ====
Index: perl/utf8.c
--- perl/utf8.c#269~26675~ 2006-01-06 07:50:34.000000000 -0800
+++ perl/utf8.c 2006-01-11 13:09:19.000000000 -0800
@@ -1784,11 +1784,11 @@
STRLEN lcur, xcur, scur;
HV* const hv = (HV*)SvRV(swash);
- SV** const listsvp = hv_fetch(hv, "LIST", 4, FALSE);
- SV** const typesvp = hv_fetch(hv, "TYPE", 4, FALSE);
- SV** const bitssvp = hv_fetch(hv, "BITS", 4, FALSE);
- SV** const nonesvp = hv_fetch(hv, "NONE", 4, FALSE);
- SV** const extssvp = hv_fetch(hv, "EXTRAS", 6, FALSE);
+ SV** const listsvp = hv_fetchs(hv, "LIST", FALSE);
+ SV** const typesvp = hv_fetchs(hv, "TYPE", FALSE);
+ SV** const bitssvp = hv_fetchs(hv, "BITS", FALSE);
+ SV** const nonesvp = hv_fetchs(hv, "NONE", FALSE);
+ SV** const extssvp = hv_fetchs(hv, "EXTRAS", FALSE);
const U8* const typestr = (U8*)SvPV_nolen(*typesvp);
const int typeto = typestr[0] == 'T' && typestr[1] == 'o';
const STRLEN bits = SvUV(*bitssvp);
@@ -1991,7 +1991,7 @@
othersvp = hv_fetch(hv, (char *)namestr, namelen, FALSE);
otherhv = (HV*)SvRV(*othersvp);
- otherbitssvp = hv_fetch(otherhv, "BITS", 4, FALSE);
+ otherbitssvp = hv_fetchs(otherhv, "BITS", FALSE);
otherbits = (STRLEN)SvUV(*otherbitssvp);
if (bits < otherbits)
Perl_croak(aTHX_ "panic: swash_get found swatch size mismatch");
==== //depot/perl/util.c#534 (text) ====
Index: perl/util.c
--- perl/util.c#533~26787~ 2006-01-11 06:47:04.000000000 -0800
+++ perl/util.c 2006-01-11 13:09:19.000000000 -0800
@@ -4154,11 +4154,11 @@
if ( hv_exists((HV*)ver, "width", 5 ) )
{
- const I32 width = SvIV(*hv_fetch((HV*)ver, "width", 5, FALSE));
+ const I32 width = SvIV(*hv_fetchs((HV*)ver, "width", FALSE));
hv_store((HV *)hv, "width", 5, newSViv(width), 0);
}
- sav = (AV *)SvRV(*hv_fetch((HV*)ver, "version", 7, FALSE));
+ sav = (AV *)SvRV(*hv_fetchs((HV*)ver, "version", FALSE));
/* This will get reblessed later if a derived class*/
for ( key = 0; key <= av_len(sav); key++ )
{
@@ -4265,7 +4265,7 @@
/* see if the appropriate elements exist */
if ( SvTYPE(vs) == SVt_PVHV
&& hv_exists((HV*)vs, "version", 7)
- && (sv = SvRV(*hv_fetch((HV*)vs, "version", 7, FALSE)))
+ && (sv = SvRV(*hv_fetchs((HV*)vs, "version", FALSE)))
&& SvTYPE(sv) == SVt_PVAV )
return TRUE;
else
@@ -4304,13 +4304,13 @@
if ( hv_exists((HV*)vs, "alpha", 5 ) )
alpha = TRUE;
if ( hv_exists((HV*)vs, "width", 5 ) )
- width = SvIV(*hv_fetch((HV*)vs, "width", 5, FALSE));
+ width = SvIV(*hv_fetchs((HV*)vs, "width", FALSE));
else
width = 3;
/* attempt to retrieve the version array */
- if ( !(av = (AV *)SvRV(*hv_fetch((HV*)vs, "version", 7, FALSE)) ) ) {
+ if ( !(av = (AV *)SvRV(*hv_fetchs((HV*)vs, "version", FALSE)) ) ) {
sv_catpvs(sv,"0");
return sv;
}
@@ -4380,7 +4380,7 @@
if ( hv_exists((HV*)vs, "alpha", 5 ) )
alpha = TRUE;
- av = (AV *)SvRV(*hv_fetch((HV*)vs, "version", 7, FALSE));
+ av = (AV *)SvRV(*hv_fetchs((HV*)vs, "version", FALSE));
len = av_len(av);
if ( len == -1 )
@@ -4468,12 +4468,12 @@
Perl_croak(aTHX_ "Invalid version object");
/* get the left hand term */
- lav = (AV *)SvRV(*hv_fetch((HV*)lhv, "version", 7, FALSE));
+ lav = (AV *)SvRV(*hv_fetchs((HV*)lhv, "version", FALSE));
if ( hv_exists((HV*)lhv, "alpha", 5 ) )
lalpha = TRUE;
/* and the right hand term */
- rav = (AV *)SvRV(*hv_fetch((HV*)rhv, "version", 7, FALSE));
+ rav = (AV *)SvRV(*hv_fetchs((HV*)rhv, "version", FALSE));
if ( hv_exists((HV*)rhv, "alpha", 5 ) )
ralpha = TRUE;
End of Patch.