[PATCH] fix tools/c2man.pl perl syntax

Alexey Tourbin at at altlinux.ru
Fri Jan 12 01:55:36 CST 2007


Fellas,

tools/c2man.pl have buggy pieca code which work only for accident
reasons.  The patch fixes perl syntax for upcoming perl-5.8.9 who
ain't not gonna tolerate the buggy pieca coda.

http://www.nntp.perl.org/group/perl.perl5.porters/119879
http://www.nntp.perl.org/group/perl.perl5.porters/119881
http://www.nntp.perl.org/group/perl.perl5.porters/119882
http://www.nntp.perl.org/group/perl.perl5.porters/119883

--- tools/c2man.pl-	2006-12-24 00:17:04 +0000
+++ tools/c2man.pl	2007-01-12 07:13:05 +0000
@@ -627,7 +627,7 @@ sub process_comment($)
 
   # When the function is exported twice we have the second name below the first
   # (you see this a lot in ntdll, but also in some other places).
-  my $first_line = ${@{$comment->{TEXT}}}[1];
+  my $first_line = $comment->{TEXT}[1];
 
   if ( $first_line =~ /^(@|[A-Za-z0-9_]+) +(\(|\[)([A-Za-z0-9_]+)\.(([0-9]+)|@)(\)|\])$/ )
   {
@@ -642,14 +642,14 @@ sub process_comment($)
       my $alt_export = @{$spec_details->{EXPORTS}}[$alt_index];
       @$alt_export[4] |= $FLAG_DOCUMENTED;
       $spec_details->{NUM_DOCS}++;
-      ${@{$comment->{TEXT}}}[1] = "";
+      $comment->{TEXT}[1] = "";
     }
   }
 
   if (@{$spec_details->{CURRENT_EXTRA}})
   {
     # We have an extra comment that might be related to this one
-    my $current_comment = ${@{$spec_details->{CURRENT_EXTRA}}}[0];
+    my $current_comment = $spec_details->{CURRENT_EXTRA}[0];
     my $current_name = $current_comment->{COMMENT_NAME};
     if ($comment->{COMMENT_NAME} =~ /^$current_name/ && $comment->{COMMENT_NAME} ne $current_name)
     {
@@ -986,7 +986,7 @@ sub process_extra_comment($)
 
   if (@{$spec_details->{CURRENT_EXTRA}})
   {
-    my $current_comment = ${@{$spec_details->{CURRENT_EXTRA}}}[0];
+    my $current_comment = $spec_details->{CURRENT_EXTRA}[0];
 
     if ($opt_verbose > 0)
     {
@@ -1072,7 +1072,7 @@ sub process_index_files()
       if (@{$spec_details->{CURRENT_EXTRA}})
       {
         # We have an unwritten extra comment, write it
-        my $current_comment = ${@{$spec_details->{CURRENT_EXTRA}}}[0];
+        my $current_comment = $spec_details->{CURRENT_EXTRA}[0];
         process_extra_comment($current_comment);
         @{$spec_details->{CURRENT_EXTRA}} = ();
        }
@@ -1468,7 +1468,7 @@ sub output_api_synopsis($)
   my $biggest_length = 0;
   for(my $i=0; $i < @{$comment->{PROTOTYPE}}; $i++)
   {
-    my $line = ${@{$comment->{PROTOTYPE}}}[$i];
+    my $line = $comment->{PROTOTYPE}[$i];
     if ($line =~ /(.+?)([A-Za-z_][A-Za-z_0-9]*)$/)
     {
       my $length = length $1;
@@ -1482,19 +1482,19 @@ sub output_api_synopsis($)
   # Now pad the string with blanks
   for(my $i=0; $i < @{$comment->{PROTOTYPE}}; $i++)
   {
-    my $line = ${@{$comment->{PROTOTYPE}}}[$i];
+    my $line = $comment->{PROTOTYPE}[$i];
     if ($line =~ /(.+?)([A-Za-z_][A-Za-z_0-9]*)$/)
     {
       my $pad_len = $biggest_length - length $1;
       my $padding = " " x ($pad_len);
-      ${@{$comment->{PROTOTYPE}}}[$i] = $1.$padding.$2;
+      $comment->{PROTOTYPE}[$i] = $1.$padding.$2;
     }
   }
 
   for(my $i=0; $i < @{$comment->{PROTOTYPE}}; $i++)
   {
     # Format the parameter name
-    my $line = ${@{$comment->{PROTOTYPE}}}[$i];
+    my $line = $comment->{PROTOTYPE}[$i];
     my $comma = ($i == @{$comment->{PROTOTYPE}}-1) ? "" : ",";
     $line =~ s/(.+?)([A-Za-z_][A-Za-z_0-9]*)$/  $fmt[0]$1$fmt[2]$2$fmt[3]$comma$fmt[1]/;
     print OUTPUT $line;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-devel/attachments/20070112/b99a978a/attachment.pgp


More information about the wine-devel mailing list