]> git.imager.perl.org - imager.git/commitdiff
[rt #71675] make the APIRef synopsis ordering consistent
authorTony Cook <tony@develop-help.com>
Sat, 15 Oct 2011 02:00:23 +0000 (13:00 +1100)
committerTony Cook <tony@develop-help.com>
Sat, 15 Oct 2011 02:08:20 +0000 (13:08 +1100)
Older versions of perl could order it differently

Changes
apidocs.perl
lib/Imager/APIRef.pod

diff --git a/Changes b/Changes
index a57f364f002d32d764d66452619ce921ba7ff7eb..666a2cadfbe84edbd8d52291c032c7841b479436 100644 (file)
--- a/Changes
+++ b/Changes
@@ -56,6 +56,10 @@ Bug fixes:
  - check there's at least one coefficient for the convolution filter
    https://rt.cpan.org/Ticket/Display.html?id=68993
 
+ - make the APIRef synopsis ordering consistent, older versions of
+   perl could order it differently.
+   https://rt.cpan.org/Ticket/Display.html?id=71675
+
 Imager 0.85_01 - 10 Oct 2011
 ==============
 
index c0c389a5b37f8ebebe62ab20758743b81619e086..b516472a8f1904823b2952998eef341df2f4c0f7 100644 (file)
@@ -10,7 +10,7 @@ my %funcs = map { $_ => 1 } @funcs;
 # look for files to parse
 
 my $mani = maniread;
-my @files = grep /\.(c|im|h)$/, keys %$mani;
+my @files = sort grep /\.(c|im|h)$/, keys %$mani;
 
 # scan each file for =item <func>\b
 my $func;
@@ -107,7 +107,11 @@ EOS
 
 for my $cat (sort { lc $a cmp lc $b } keys %cats) {
   print OUT "\n  # $cat\n";
-  for my $func (grep $funcsyns{$_}, sort { $order{$a} <=> $order{$b} } @{$cats{$cat}}) {
+  my @funcs = @{$cats{$cat}};
+  my %orig;
+  @orig{@funcs} = 0 .. $#funcs;
+  @funcs = sort { $order{$a} <=> $order{$b} || $orig{$a} <=> $orig{$b} } @funcs;
+  for my $func (grep $funcsyns{$_}, @funcs) {
     my $syn = $funcsyns{$func};
     $syn =~ s/^/  /gm;
     print OUT $syn;
index b03206bb8a7e0c8e2499bda92fd287e9abf4c3b4..afd956de45c5d6ce5feefbfda0ad1b1bb6eb161a 100644 (file)
@@ -70,12 +70,12 @@ Imager::APIRef - Imager's C API - reference.
   # Image
 
   # Image creation/destruction
-  i_img *img = i_img_8_new(width, height, channels);
   i_img *img = i_sametype(src, width, height);
   i_img *img = i_sametype_chans(src, width, height, channels);
-  i_img *img = i_img_pal_new(width, height, channels, max_palette_size)
-  i_img *img = i_img_double_new(width, height, channels);
   i_img *img = i_img_16_new(width, height, channels);
+  i_img *img = i_img_8_new(width, height, channels);
+  i_img *img = i_img_double_new(width, height, channels);
+  i_img *img = i_img_pal_new(width, height, channels, max_palette_size)
   i_img_destroy(img)
 
   # Image Implementation