unaligned.h: rationalise; provide buf_append_uint8 et al
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 25 Jul 2013 17:30:46 +0000 (18:30 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 25 Jul 2013 17:30:46 +0000 (18:30 +0100)
commit993db2a680648967ff59128c1aa003b9e87c6824
treef19561feeb28b435d976e2dba96fbba1ca726212
parentf15aefe4e0bb264fc1ceac17c7bbe1a534d190c9
unaligned.h: rationalise; provide buf_append_uint8 et al

Replace the formulaic macros
  buf_{,un}{append,prepend}_{uint32,uint16}
with some macro-generated inline functions.  These have better
typechecking, and are also better because it's not possible to
accidentally mess up one of the definitions by failing to permute it
in the right way.

Add the functions for uint8 too.  This involves providing put_uint8
and get_uint8 macros, which we do along the lines of the existing put_
and get_ macros.

Use the new uint8 function in the one place where it's currently useful.
More call sites will appear shortly.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
slip.c
unaligned.h