summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2012-11-17 14:02:18 +0100
committerYves Orton <demerphq@gmail.com>2012-11-17 14:02:18 +0100
commit122a2d8fe9130b9626e234dde2dd530756407ab0 (patch)
tree6fff7045abada65ede2254ed31362e2ef191816b
parentee98d22d3f83f14ecaaaefd176f9630c0f262afd (diff)
downloadperl-122a2d8fe9130b9626e234dde2dd530756407ab0.tar.gz
make regcharclass hash order determinisitic
-rw-r--r--regcharclass.h4
-rwxr-xr-xregen/regcharclass.pl10
2 files changed, 7 insertions, 7 deletions
diff --git a/regcharclass.h b/regcharclass.h
index c977a56c3b..f7b42294d4 100644
--- a/regcharclass.h
+++ b/regcharclass.h
@@ -563,7 +563,7 @@
: ( 0xE1 == ((U8*)s)[0] ) ? \
( ( 0xBC == ((U8*)s)[1] ) ? \
( ( ( ( ( ((U8*)s)[2] & 0xD8 ) == 0x80 ) && ( 0xCE == ((U8*)s)[3] ) ) && ( 0xB9 == ((U8*)s)[4] ) ) ? 5 : 0 )\
- : ( ( ( ( 0xBD == ((U8*)s)[1] ) && ( ( ( ((U8*)s)[2] & 0xF8 ) == 0xA0 ) || ((U8*)s)[2] == 0xB0 || ( ( ((U8*)s)[2] & 0xF7 ) == 0xB4 ) ) ) && ( 0xCE == ((U8*)s)[3] ) ) && ( 0xB9 == ((U8*)s)[4] ) ) ? 5 : 0 )\
+ : ( ( ( ( 0xBD == ((U8*)s)[1] ) && ( ( ( ((U8*)s)[2] & 0xF8 ) == 0xA0 ) || ( ( ((U8*)s)[2] & 0xFB ) == 0xB0 ) || ((U8*)s)[2] == 0xBC ) ) && ( 0xCE == ((U8*)s)[3] ) ) && ( 0xB9 == ((U8*)s)[4] ) ) ? 5 : 0 )\
: 0 ) \
: ((e)-(s) > 4) ? \
( ( 0x61 == ((U8*)s)[0] ) ? \
@@ -615,7 +615,7 @@
: ( 0xE1 == ((U8*)s)[0] ) ? \
( ( 0xBC == ((U8*)s)[1] ) ? \
( ( ( ( ( ((U8*)s)[2] & 0xD8 ) == 0x80 ) && ( 0xCE == ((U8*)s)[3] ) ) && ( 0xB9 == ((U8*)s)[4] ) ) ? 5 : 0 )\
- : ( ( ( ( 0xBD == ((U8*)s)[1] ) && ( ( ( ((U8*)s)[2] & 0xF8 ) == 0xA0 ) || ((U8*)s)[2] == 0xB0 || ( ( ((U8*)s)[2] & 0xF7 ) == 0xB4 ) ) ) && ( 0xCE == ((U8*)s)[3] ) ) && ( 0xB9 == ((U8*)s)[4] ) ) ? 5 : 0 )\
+ : ( ( ( ( 0xBD == ((U8*)s)[1] ) && ( ( ( ((U8*)s)[2] & 0xF8 ) == 0xA0 ) || ( ( ((U8*)s)[2] & 0xFB ) == 0xB0 ) || ((U8*)s)[2] == 0xBC ) ) && ( 0xCE == ((U8*)s)[3] ) ) && ( 0xB9 == ((U8*)s)[4] ) ) ? 5 : 0 )\
: 0 ) \
: ((e)-(s) > 3) ? \
( ( 0x61 == ((U8*)s)[0] ) ? \
diff --git a/regen/regcharclass.pl b/regen/regcharclass.pl
index 944f61b976..508f687dcb 100755
--- a/regen/regcharclass.pl
+++ b/regen/regcharclass.pl
@@ -758,7 +758,7 @@ sub calculate_mask(@) {
my @final_results;
foreach my $count (reverse sort { $a <=> $b } keys %hash) {
my $need = 2 ** $count; # Need 8 values for 3 differing bits, etc
- foreach my $bits (keys $hash{$count}) {
+ foreach my $bits (sort keys $hash{$count}) {
print STDERR __LINE__, ": For $count bit(s) difference ($bits), need $need; have ", scalar @{$hash{$count}{$bits}}, "\n" if DEBUG;
@@ -831,8 +831,8 @@ sub calculate_mask(@) {
# These values are now spoken for. Remove them from future
# consideration
- foreach my $remove_count (keys %hash) {
- foreach my $bits (keys %{$hash{$remove_count}}) {
+ foreach my $remove_count (sort keys %hash) {
+ foreach my $bits (sort keys %{$hash{$remove_count}}) {
foreach my $to_remove (@subset) {
@{$hash{$remove_count}{$bits}} = grep { $_ != $to_remove } @{$hash{$remove_count}{$bits}};
}
@@ -846,7 +846,7 @@ sub calculate_mask(@) {
# individually.
my @individuals;
foreach my $count (reverse sort { $a <=> $b } keys %hash) {
- foreach my $bits (keys $hash{$count}) {
+ foreach my $bits (sort keys $hash{$count}) {
foreach my $remaining (@{$hash{$count}{$bits}}) {
# If we already know about this value, just ignore it.
@@ -1221,7 +1221,7 @@ if ( !caller ) {
# first, as
# traditional
if (%mods) {
- die "Unknown modifiers: ", join ", ", map { "'$_'" } keys %mods;
+ die "Unknown modifiers: ", join ", ", map { "'$_'" } sort keys %mods;
}
foreach my $type_spec ( @types ) {