From: Craig A. Berry Date: Fri, 18 May 2007 21:42:56 +0000 (+0000) Subject: When trimming long XS symbols on VMS, avoid warnings from operator X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b4ff380f20561274e4b6f0c9fde2644d95c98ac8;p=p5sagit%2Fp5-mst-13.2.git When trimming long XS symbols on VMS, avoid warnings from operator precedence mistakes, but for now give the same symbol mangling results as before. p4raw-id: //depot/perl@31236 --- diff --git a/vms/ext/XSSymSet.pm b/vms/ext/XSSymSet.pm index 18aa261..5fd59e7 100644 --- a/vms/ext/XSSymSet.pm +++ b/vms/ext/XSSymSet.pm @@ -2,7 +2,7 @@ package ExtUtils::XSSymSet; use strict; use vars qw( $VERSION ); -$VERSION = '1.0'; +$VERSION = '1.1'; sub new { @@ -36,9 +36,10 @@ sub trimsym { if (length $trimmed > $maxlen) { my $squeezed = $trimmed; my($xs,$prefix,$func) = $trimmed =~ /^(XS_)?(.*)_([^_]*)$/; + $xs ||= ''; + my $frac = 3; # replaces broken length-based calculations but w/same result + my $pat = '([^_])'; if (length $func <= 12) { # Try to preserve short function names - my $frac = int(length $prefix / (length $trimmed - $maxlen) + 0.5); - my $pat = '([^_])'; if ($frac > 1) { $pat .= '[^A-Z_]{' . ($frac - 1) . '}'; } $prefix =~ s/$pat/$1/g; $squeezed = "$xs$prefix" . "_$func"; @@ -49,8 +50,6 @@ sub trimsym { } } else { - my $frac = int(length $trimmed / (length $trimmed - $maxlen) + 0.5); - my $pat = '([^_])'; if ($frac > 1) { $pat .= '[^A-Z_]{' . ($frac - 1) . '}'; } $squeezed = "$prefix$func"; $squeezed =~ s/$pat/$1/g;