Fix compilation -Wmismatched-tags warnings

Keep consistency in the code to not generate warnings of this type.

Signed-off-by: Christophe Courtaut <christophe.courtaut@gmail.com>
Merge pull request #491 from kri5/wip-clang-compilation

Fix compilation -Wmismatched-tags warnings

Reviewed-by: Loic Dachary <loic@dachary.org>