This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Inline sv_cmp() and sv_cmp_locale() as macros wrapping their flags variants.
authorNicholas Clark <nick@ccl4.org>
Thu, 11 Nov 2010 10:55:27 +0000 (10:55 +0000)
committerNicholas Clark <nick@ccl4.org>
Thu, 11 Nov 2010 10:55:27 +0000 (10:55 +0000)
We can't move Perl_sv_cmp() and Perl_sv_cmp_locale() to mathoms.c, as they
are referenced by function pointer in pp_sort.c - pointers which require the
specific current calling signature.

embed.fnc
embed.h
sv.h

index 9957c86..3baf32e 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -1162,10 +1162,10 @@ pd      |I32    |sv_clean_all
 : Used only in perl.c
 pd     |void   |sv_clean_objs
 Apd    |void   |sv_clear       |NN SV *const orig_sv
-Apd    |I32    |sv_cmp         |NULLOK SV *const sv1|NULLOK SV *const sv2
+Aopd   |I32    |sv_cmp         |NULLOK SV *const sv1|NULLOK SV *const sv2
 Apd    |I32    |sv_cmp_flags   |NULLOK SV *const sv1|NULLOK SV *const sv2 \
                                |const U32 flags
-Apd    |I32    |sv_cmp_locale  |NULLOK SV *const sv1|NULLOK SV *const sv2
+Aopd   |I32    |sv_cmp_locale  |NULLOK SV *const sv1|NULLOK SV *const sv2
 Apd    |I32    |sv_cmp_locale_flags    |NULLOK SV *const sv1 \
                                |NULLOK SV *const sv2|const U32 flags
 #if defined(USE_LOCALE_COLLATE)
diff --git a/embed.h b/embed.h
index 72cdfc0..b743761 100644 (file)
--- a/embed.h
+++ b/embed.h
 #define sv_catsv_flags(a,b,c)  Perl_sv_catsv_flags(aTHX_ a,b,c)
 #define sv_chop(a,b)           Perl_sv_chop(aTHX_ a,b)
 #define sv_clear(a)            Perl_sv_clear(aTHX_ a)
-#define sv_cmp(a,b)            Perl_sv_cmp(aTHX_ a,b)
 #define sv_cmp_flags(a,b,c)    Perl_sv_cmp_flags(aTHX_ a,b,c)
-#define sv_cmp_locale(a,b)     Perl_sv_cmp_locale(aTHX_ a,b)
 #define sv_cmp_locale_flags(a,b,c)     Perl_sv_cmp_locale_flags(aTHX_ a,b,c)
 #define sv_compile_2op(a,b,c,d)        Perl_sv_compile_2op(aTHX_ a,b,c,d)
 #define sv_copypv(a,b)         Perl_sv_copypv(aTHX_ a,b)
diff --git a/sv.h b/sv.h
index 92f5edd..77a9712 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -1848,6 +1848,8 @@ mg.c:1024: warning: left-hand operand of comma expression has no effect
 #define sv_2uv(sv) sv_2uv_flags(sv, SV_GMAGIC)
 #define sv_2nv(sv) sv_2nv_flags(sv, SV_GMAGIC)
 #define sv_eq(sv1, sv2) sv_eq_flags(sv1, sv2, SV_GMAGIC)
+#define sv_cmp(sv1, sv2) sv_cmp_flags(sv1, sv2, SV_GMAGIC)
+#define sv_cmp_locale(sv1, sv2) sv_cmp_locale_flags(sv1, sv2, SV_GMAGIC)
 #define sv_collxfrm(sv, nxp) sv_cmp_flags(sv, nxp, SV_GMAGIC)
 #define sv_2bool(sv) sv_2bool_flags(sv, SV_GMAGIC)
 #define sv_insert(bigstr, offset, len, little, littlelen)              \