summaryrefslogtreecommitdiff
path: root/universal.c
diff options
context:
space:
mode:
authorAndy Lester <andy@petdance.com>2006-03-17 18:28:45 -0600
committerSteve Peters <steve@fisharerojo.org>2006-03-19 16:38:11 +0000
commita9ec700ee9a7d3c376e5e0364a53953654bcc8ea (patch)
treef54462e8b3f4392acb6a8bb19603ad7c6db372a0 /universal.c
parentabc0156ba8cc024916c0d1e664c4488f0cbc55c8 (diff)
downloadperl-a9ec700ee9a7d3c376e5e0364a53953654bcc8ea.tar.gz
Change the semantics of S_isa_lookup
Message-ID: <20060318062845.GA11607@petdance.com> p4raw-id: //depot/perl@27542
Diffstat (limited to 'universal.c')
-rw-r--r--universal.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/universal.c b/universal.c
index 98efe0f869..8802cb29d5 100644
--- a/universal.c
+++ b/universal.c
@@ -31,7 +31,7 @@
* The main guts of traverse_isa was actually copied from gv_fetchmeth
*/
-STATIC SV *
+STATIC bool
S_isa_lookup(pTHX_ HV *stash, const char *name, HV* name_stash,
int len, int level)
{
@@ -46,15 +46,15 @@ S_isa_lookup(pTHX_ HV *stash, const char *name, HV* name_stash,
/* A stash/class can go by many names (ie. User == main::User), so
we compare the stash itself just in case */
if (name_stash && (stash == name_stash))
- return &PL_sv_yes;
+ return TRUE;
hvname = HvNAME_get(stash);
if (strEQ(hvname, name))
- return &PL_sv_yes;
+ return TRUE;
if (strEQ(name, "UNIVERSAL"))
- return &PL_sv_yes;
+ return TRUE;
if (level > 100)
Perl_croak(aTHX_ "Recursive inheritance detected in package '%s'",
@@ -71,7 +71,7 @@ S_isa_lookup(pTHX_ HV *stash, const char *name, HV* name_stash,
if (svp && (sv = *svp) != (SV*)&PL_sv_undef) {
DEBUG_o( Perl_deb(aTHX_ "Using cached ISA %s for package %s\n",
name, hvname) );
- return sv;
+ return (sv == &PL_sv_yes);
}
}
else {
@@ -114,16 +114,15 @@ S_isa_lookup(pTHX_ HV *stash, const char *name, HV* name_stash,
sv, hvname);
continue;
}
- if (&PL_sv_yes == isa_lookup(basestash, name, name_stash,
- len, level + 1)) {
+ if (isa_lookup(basestash, name, name_stash, len, level + 1)) {
(void)hv_store(hv,name,len,&PL_sv_yes,0);
- return &PL_sv_yes;
+ return TRUE;
}
}
(void)hv_store(hv,name,len,&PL_sv_no,0);
}
}
- return &PL_sv_no;
+ return FALSE;
}
/*
@@ -160,7 +159,7 @@ Perl_sv_derived_from(pTHX_ SV *sv, const char *name)
if (stash) {
HV * const name_stash = gv_stashpv(name, FALSE);
- return isa_lookup(stash, name, name_stash, strlen(name), 0) == &PL_sv_yes;
+ return isa_lookup(stash, name, name_stash, strlen(name), 0);
}
else
return FALSE;