diff options
author | David Mitchell <davem@iabyn.com> | 2010-12-30 16:29:12 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2010-12-31 12:01:48 +0000 |
commit | 31d632c315ee363ec7894471fe0f73dc96f5c042 (patch) | |
tree | dbfeaf1f0c28237ece34455e1c08645b62f2e1cc /pp_sort.c | |
parent | ada6eeb82df60fbe63c781f1a102393fd56d104b (diff) | |
download | perl-31d632c315ee363ec7894471fe0f73dc96f5c042.tar.gz |
standardise amagic method naming
Some amagic-related macros take the full method enumeration name,
(e.g. "add_amg"); while others "helpfully" allow you to pass a shortened
version, ("add"), and do a CAT2(meth,_amg) behind the scenes.
Standardise on passing the full name; this makes it less confusing and
allows you to grep for the enumeration name in the source.
It updates two macros to accept full enumeration names: tryAMAGICunTARGET
(which isn't used outside the core apparently), and AMG_CALLun, which is
replaced by a new AMG_CALLunary (since AMG_CALLun is used outside the
core).
Diffstat (limited to 'pp_sort.c')
-rw-r--r-- | pp_sort.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1868,7 +1868,7 @@ S_sv_i_ncmp(pTHX_ SV *const a, SV *const b) #define tryCALL_AMAGICbin(left,right,meth) \ (SvAMAGIC(left)||SvAMAGIC(right)) \ - ? amagic_call(left, right, CAT2(meth,_amg), 0) \ + ? amagic_call(left, right, meth, 0) \ : NULL; #define SORT_NORMAL_RETURN_VALUE(val) (((val) > 0) ? 1 : ((val) ? -1 : 0)) @@ -1877,7 +1877,7 @@ static I32 S_amagic_ncmp(pTHX_ register SV *const a, register SV *const b) { dVAR; - SV * const tmpsv = tryCALL_AMAGICbin(a,b,ncmp); + SV * const tmpsv = tryCALL_AMAGICbin(a,b,ncmp_amg); PERL_ARGS_ASSERT_AMAGIC_NCMP; @@ -1898,7 +1898,7 @@ static I32 S_amagic_i_ncmp(pTHX_ register SV *const a, register SV *const b) { dVAR; - SV * const tmpsv = tryCALL_AMAGICbin(a,b,ncmp); + SV * const tmpsv = tryCALL_AMAGICbin(a,b,ncmp_amg); PERL_ARGS_ASSERT_AMAGIC_I_NCMP; @@ -1919,7 +1919,7 @@ static I32 S_amagic_cmp(pTHX_ register SV *const str1, register SV *const str2) { dVAR; - SV * const tmpsv = tryCALL_AMAGICbin(str1,str2,scmp); + SV * const tmpsv = tryCALL_AMAGICbin(str1,str2,scmp_amg); PERL_ARGS_ASSERT_AMAGIC_CMP; @@ -1940,7 +1940,7 @@ static I32 S_amagic_cmp_locale(pTHX_ register SV *const str1, register SV *const str2) { dVAR; - SV * const tmpsv = tryCALL_AMAGICbin(str1,str2,scmp); + SV * const tmpsv = tryCALL_AMAGICbin(str1,str2,scmp_amg); PERL_ARGS_ASSERT_AMAGIC_CMP_LOCALE; |