Author: jorton
Date: Mon Dec 10 17:01:24 2012
New Revision: 1419582

URL: http://svn.apache.org/viewvc?rev=1419582&view=rev
Log:
* lib/ModPerl/TypeMap.pm (typedefs_code, sv_convert_code):
  Produce output in sorted order for ease of diff across
  invocations.

Modified:
    perl/modperl/trunk/lib/ModPerl/TypeMap.pm

Modified: perl/modperl/trunk/lib/ModPerl/TypeMap.pm
URL: 
http://svn.apache.org/viewvc/perl/modperl/trunk/lib/ModPerl/TypeMap.pm?rev=1419582&r1=1419581&r2=1419582&view=diff
==============================================================================
--- perl/modperl/trunk/lib/ModPerl/TypeMap.pm (original)
+++ perl/modperl/trunk/lib/ModPerl/TypeMap.pm Mon Dec 10 17:01:24 2012
@@ -442,12 +442,12 @@ sub typedefs_code {
         $code .= qq{\#include "$_"\n}
     }
 
-    for my $t (@{ $self->{struct} }) {
+    for my $t (sort {$a->[1] cmp $b->[1]} @{ $self->{struct} }) {
         next if $seen{ $t->[1] }++;
         $code .= "typedef $t->[0] * $t->[1];\n";
     }
 
-    for my $t (@{ $self->{typedef} }) {
+    for my $t (sort {$a->[1] cmp $b->[1]} @{ $self->{typedef} }) {
         next if $seen{ $t->[1] }++;
         $code .= "typedef $t->[0] $t->[1];\n";
     }
@@ -470,7 +470,9 @@ sub sv_convert_code {
     my %seen;
     my $code = "";
 
-    while (my ($ctype, $ptype) = each %$map) {
+    for my $ctype (sort keys %$map) {
+        my $ptype = $map->{$ctype};
+
         next if $self->special($ptype);
         next if $ctype =~ /\s/;
         my $class = $ptype;


Reply via email to