pack-bitmap: do not use gcc packed attribute
commitc818beddbda0424b6e6e68fcb7982be6328195e2
authorJeff King <peff@peff.net>
Fri, 1 Aug 2014 23:10:44 +0000 (1 19:10 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 4 Aug 2014 17:39:33 +0000 (4 10:39 -0700)
tree71ede2a7d439af4e356974ef03b55bd82868f3c9
parent68f4e1fc6abd332726dd281c76dd63ce7d13d7a1
pack-bitmap: do not use gcc packed attribute

The "__attribute__" flag may be a noop on some compilers.
That's OK as long as the code is correct without the
attribute, but in this case it is not. We would typically
end up with a struct that is 2 bytes too long due to struct
padding, breaking both reading and writing of bitmaps.

We can work around this by using an array of unsigned char
to represent the data, and relying on get/put_be32 to handle
alignment issues as we interact with the array.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pack-bitmap-write.c
pack-bitmap.c
pack-bitmap.h