Skip to content

Commit

Permalink
Use fixed-size integers for the on-disk pack structure.
Browse files Browse the repository at this point in the history
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 <corecode@fs.ei.tum.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Simon 'corecode' Schubert authored and Junio C Hamano committed Jan 18, 2007
1 parent 917a8f8 commit bb79103
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions git-compat-util.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include <arpa/inet.h>
#include <netdb.h>
#include <pwd.h>
#include <stdint.h>
#undef _ALL_SOURCE /* AIX 5.3L defines a struct list with _ALL_SOURCE. */
#include <grp.h>
#define _ALL_SOURCE 1
Expand Down
6 changes: 3 additions & 3 deletions pack.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

/*
Expand Down

0 comments on commit bb79103

Please sign in to comment.