Get rid of type punning in pb_encode_fixedXX().
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>
Tue, 26 Jan 2016 20:10:09 +0000 (22:10 +0200)
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>
Tue, 26 Jan 2016 20:12:09 +0000 (22:12 +0200)
commitd79b15d8aa377116735c87e4d694fc2d20a5fef5
tree125387275bde67b1bcab9325c706fba0ff10d8df
parentcad502a1d690ad129af9d4942185cfdbf1fa1504
Get rid of type punning in pb_encode_fixedXX().

This was never very clean code, but it was fast. Hopefully
compilers are smart enough to optimize it away, or the speed
difference is not very large. This should be checked.

However working code is always more important than fast code,
and the previous way couldn't really work for platforms that
do not have byte-sized memory access. Related to PR #191.
pb_decode.c
pb_encode.c