summaryrefslogtreecommitdiffstats
path: root/TOOLS
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-04 23:49:22 +0100
committerwm4 <wm4@nowhere>2013-11-04 23:49:22 +0100
commitb74edd406989cbb7a74b8462cb608b560918aa7b (patch)
tree9a115cc27a964e0ecce5645c6080a9bf2d0d7a04 /TOOLS
parentf330884b0ae2dac81983e04cc449d4d07aa64c66 (diff)
downloadmpv-b74edd406989cbb7a74b8462cb608b560918aa7b.tar.bz2
mpv-b74edd406989cbb7a74b8462cb608b560918aa7b.tar.xz
demux_mkv: fix compiler warnings
Make TOOLS/matroska.pl output structs with fields sorted by name in ebml_types.h to make the order of fields deterministic. Fix warnings in demux_mkv.c caused by the first struct fields switching between scalar and struct types due to non-deterministic ebml_types.h field order. Since it's deterministic now, this shouldn't change anymore. The warnings produced by the compilers are bogus, but we want to silence them anyway, since this could make developers overlook legitimate warnings. What commits 7b52ba8, 6dd97cc, 4aae1ff were supposed to fix. An earlier attempt sorted fields in the generated C source file, not the header file. Hopefully this is the last commit concerning this issue...
Diffstat (limited to 'TOOLS')
-rwxr-xr-xTOOLS/matroska.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/TOOLS/matroska.pl b/TOOLS/matroska.pl
index 4eda2de44f..28ad1197c5 100755
--- a/TOOLS/matroska.pl
+++ b/TOOLS/matroska.pl
@@ -56,7 +56,7 @@ sub generate_c_header {
my $l = max(map { length $_->{valname} } values %{$el->{subelements}});
# Output each variable, with pointers for array (multiple) elements
- for my $subel (values %{$el->{subelements}}) {
+ for my $subel (sort { $a->{definename} cmp $b->{definename} } values %{$el->{subelements}}) {
printf " %-${l}s %s%s;\n",
$subel->{valname}, $subel->{multiple}?'*':' ', $subel->{fieldname};
}