1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-19 22:36:55 +00:00

matroska.pl: Sort the generated struct field list

Newer versions of perl randomize the hash used for hashes every time
it's run; this makes the order of the fields be non-deterministic. Tack
a sort there to make it deterministic. Needed to fix (or allow fixing) a
buggy gcc warning.
This commit is contained in:
Diogo Franco (Kovensky) 2013-11-02 01:43:49 +00:00
parent e0b6fdeb8d
commit 6dd97ccf5c

View File

@ -101,7 +101,7 @@ sub generate_c_definitions {
# define a field for each subelement
# also does lots of macro magic, but doesn't open a scope
for my $subel (values %{$el->{subelements}}) {
for my $subel (sort { $a->{definename} cmp $b->{definename} } values %{$el->{subelements}}) {
print "F($subel->{definename}, $subel->{fieldname}, ".
($subel->{multiple}?'1':'0').")\n";
}
@ -166,4 +166,4 @@ sub process_elem {
} else {
print "$elem->{type} ". $elem->get_value ."\n";
}
}
}