From: Antonio Ospite Date: Tue, 24 Jan 2012 12:38:35 +0000 (+0100) Subject: Serialize struct am7xxx_header properly before sending it on the wire X-Git-Tag: v0.1.0~19 X-Git-Url: https://git.ao2.it/libam7xxx.git/commitdiff_plain/5e7d217e7f1d40fbfb6bc6375421a21bd5572788?hp=5e7d217e7f1d40fbfb6bc6375421a21bd5572788 Serialize struct am7xxx_header properly before sending it on the wire That is in order to: 1. keep data in the structs always in the host native byte order, this is more natural and less error prone as we might forget to use htole32() when setting struct fields or le32toh() when accessing them; 2. be more portable: this way the buffer sent to the wire is independent of struct alignments or paddings introduced by compilers or required by a particular architecture. ---