Permalink
Browse files

* lib/ModPerl/TypeMap.pm (typedefs_code, sv_convert_code):

  Produce output in sorted order for ease of diff across
  invocations.


git-svn-id: https://svn.apache.org/repos/asf/perl/modperl/trunk@1419582 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 9d67981 commit febe2a4f3675023d07a60d2a3bd34eed718a7600 @notroj notroj committed Dec 10, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/ModPerl/TypeMap.pm
View
@@ -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;

0 comments on commit febe2a4

Please sign in to comment.