From: Simon 'corecode' Schubert Date: Wed, 17 Jan 2007 08:07:23 +0000 (+0100) Subject: Use fixed-size integers for the on-disk pack structure. X-Git-Tag: v1.5.0-rc2~37 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bb7910319412aea9fecc3625dfcae23da84ee5f1;p=git.git Use fixed-size integers for the on-disk pack structure. Plain integer types without a fixed size can vary between platforms. Even though all common platforms use 32-bit ints, there is no guarantee that this won't change at some point. Furthermore, specifying an integer type with explicit size makes the definition of structures more obvious. Signed-off-by: Simon 'corecode' Schubert Signed-off-by: Junio C Hamano --- diff --git a/git-compat-util.h b/git-compat-util.h index 8d244d0d9..bf3ceb802 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -46,6 +46,7 @@ #include #include #include +#include #undef _ALL_SOURCE /* AIX 5.3L defines a struct list with _ALL_SOURCE. */ #include #define _ALL_SOURCE 1 diff --git a/pack.h b/pack.h index 790ff4a39..821706fbc 100644 --- a/pack.h +++ b/pack.h @@ -10,9 +10,9 @@ #define PACK_VERSION 2 #define pack_version_ok(v) ((v) == htonl(2) || (v) == htonl(3)) struct pack_header { - unsigned int hdr_signature; - unsigned int hdr_version; - unsigned int hdr_entries; + uint32_t hdr_signature; + uint32_t hdr_version; + uint32_t hdr_entries; }; /*