Subject: | remove extranous const casting |
Drop const casting of single string literals
Should be unnecessary since the arrays are const char* const,
and makes at least IRIX cc whine mightily. Tested in a few
C and C++ compilers. Also verified by bulk88 not to undo
the constifications made for Win32 in rt.cpan.org #101170.
Patch attached.
Subject: | 0001-Drop-const-casting-of-single-string-literals.patch |
From 5bab2e3fc87618bf91a545ead687ab9492d78ec5 Mon Sep 17 00:00:00 2001
From: Jarkko Hietaniemi <jhi@iki.fi>
Date: Thu, 5 Feb 2015 16:45:41 -0500
Subject: [PATCH] Drop const casting of single string literals
Should be unnecessary since the arrays are const char* const,
and makes at least IRIX cc whine mightily. Tested in a few
C and C++ compilers. Also verified by bulk88 not to undo
the constifications made for Win32 in rt.cpan.org #101170.
---
cpan/Unicode-Collate/mkheader | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cpan/Unicode-Collate/mkheader b/cpan/Unicode-Collate/mkheader
index 11f85b6..4954b51 100644
--- a/cpan/Unicode-Collate/mkheader
+++ b/cpan/Unicode-Collate/mkheader
@@ -114,7 +114,7 @@ my $init = '';
$line =~ s/\s*\z//;
next if $line eq '';
$init .= "/*$line*/\n" if $line =~ /^[A-Za-z0-9_.:;@\ \[\]]+\z/;
- $init .= "($type)".stringify($line).",\n";
+ $init .= stringify($line).",\n";
}
$init .= "NULL\n"; # sentinel
$init .= "};\n\n";
@@ -167,7 +167,7 @@ EOF
printf "static const $type ${head}_%02x_%02x [256] = {\n", $p, $r;
for (my $c = 0; $c < 256; $c++) {
print "\t", defined $val{$p}{$r}{$c}
- ? "($type)".$val{$p}{$r}{$c}
+ ? $val{$p}{$r}{$c}
: $null;
print ',' if $c != 255;
print "\n" if $c % 8 == 7;
--
2.2.2