This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Eliminate Perl_my_swabn(), as it is now unused.
authorNicholas Clark <nick@ccl4.org>
Tue, 7 May 2013 16:17:39 +0000 (18:17 +0200)
committerNicholas Clark <nick@ccl4.org>
Mon, 20 May 2013 19:19:44 +0000 (21:19 +0200)
It is not marked as part of the API, and no code on CPAN is using it.

embed.fnc
embed.h
proto.h
util.c

index 43b2e7b..0e2d854 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -2459,10 +2459,6 @@ sMd      |SV*    |find_uninit_var|NULLOK const OP *const obase \
                |NULLOK const SV *const uninit_sv|bool top
 #endif
 
-: I think that these are only used by the above, which are macros, and in turn
-: currently they are only used in pp_pack.c, but this is in util.c
-np     |void   |my_swabn       |NN void* ptr|int n
-
 Ap     |GV*    |gv_fetchpvn_flags|NN const char* name|STRLEN len|I32 flags|const svtype sv_type
 Ap     |GV*    |gv_fetchsv|NN SV *name|I32 flags|const svtype sv_type
 
diff --git a/embed.h b/embed.h
index dd7708f..1f398d6 100644 (file)
--- a/embed.h
+++ b/embed.h
 #define my_clearenv()          Perl_my_clearenv(aTHX)
 #define my_lstat_flags(a)      Perl_my_lstat_flags(aTHX_ a)
 #define my_stat_flags(a)       Perl_my_stat_flags(aTHX_ a)
-#define my_swabn               Perl_my_swabn
 #define my_unexec()            Perl_my_unexec(aTHX)
 #define newATTRSUB_flags(a,b,c,d,e,f)  Perl_newATTRSUB_flags(aTHX_ a,b,c,d,e,f)
 #define newSTUB(a,b)           Perl_newSTUB(aTHX_ a,b)
diff --git a/proto.h b/proto.h
index 22d081c..f1d303f 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -2628,11 +2628,6 @@ PERL_CALLCONV char *     Perl_my_strftime(pTHX_ const char *fmt, int sec, int min, i
 #define PERL_ARGS_ASSERT_MY_STRFTIME   \
        assert(fmt)
 
-PERL_CALLCONV void     Perl_my_swabn(void* ptr, int n)
-                       __attribute__nonnull__(1);
-#define PERL_ARGS_ASSERT_MY_SWABN      \
-       assert(ptr)
-
 PERL_CALLCONV void     Perl_my_unexec(pTHX);
 PERL_CALLCONV int      Perl_my_vsnprintf(char *buffer, const Size_t len, const char *format, va_list ap)
                        __attribute__nonnull__(1)
diff --git a/util.c b/util.c
index ae088dd..e1bbed3 100644 (file)
--- a/util.c
+++ b/util.c
@@ -2253,22 +2253,6 @@ LETOH(vtohs,short)
 LETOH(vtohl,long)
 #endif
 
-void
-Perl_my_swabn(void *ptr, int n)
-{
-    char *s = (char *)ptr;
-    char *e = s + (n-1);
-    char tc;
-
-    PERL_ARGS_ASSERT_MY_SWABN;
-
-    for (n /= 2; n > 0; s++, e--, n--) {
-      tc = *s;
-      *s = *e;
-      *e = tc;
-    }
-}
-
 PerlIO *
 Perl_my_popen_list(pTHX_ const char *mode, int n, SV **args)
 {