This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
ext/B/B.xs: Remove EBCDIC dependency
authorKarl Williamson <public@khwilliamson.com>
Sun, 2 Sep 2012 16:37:26 +0000 (10:37 -0600)
committerKarl Williamson <public@khwilliamson.com>
Fri, 14 Sep 2012 03:14:01 +0000 (21:14 -0600)
These are unnecessary EBCDIC dependencies: It uses isPRINT() on EBCDIC,
and an expression on ASCII, but isPRINT() is defined to be precisely
that expression on ASCII platforms.

ext/B/B.xs

index 9200cc9..69c4aae 100644 (file)
@@ -403,11 +403,7 @@ cstring(pTHX_ SV *sv, bool perlstyle)
                sv_catpvs(sstr, "\\$");
            else if (perlstyle && *s == '@')
                sv_catpvs(sstr, "\\@");
-#ifdef EBCDIC
            else if (isPRINT(*s))
-#else
-           else if (*s >= ' ' && *s < 127)
-#endif /* EBCDIC */
                sv_catpvn(sstr, s, 1);
            else if (*s == '\n')
                sv_catpvs(sstr, "\\n");
@@ -448,11 +444,7 @@ cchar(pTHX_ SV *sv)
        sv_catpvs(sstr, "\\'");
     else if (c == '\\')
        sv_catpvs(sstr, "\\\\");
-#ifdef EBCDIC
     else if (isPRINT(c))
-#else
-    else if (c >= ' ' && c < 127)
-#endif /* EBCDIC */
        sv_catpvn(sstr, s, 1);
     else if (c == '\n')
        sv_catpvs(sstr, "\\n");