summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 566f442)
raw | patch | inline | side by side (parent: 566f442)
author | Shawn O. Pearce <spearce@spearce.org> | |
Thu, 18 Jan 2007 16:30:17 +0000 (11:30 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Thu, 18 Jan 2007 16:30:17 +0000 (11:30 -0500) |
Currently the pack .idx file format uses 32-bit unsigned integers
for the fan-out table and the object offsets. We had previously
defined these as 'unsigned int', but not every system will define
that type to be a 32 bit value. To ensure maximum portability we
should always use 'uint32_t'.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
for the fan-out table and the object offsets. We had previously
defined these as 'unsigned int', but not every system will define
that type to be a 32 bit value. To ensure maximum portability we
should always use 'uint32_t'.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
fast-import.c | patch | blob | history | |
git-compat-util.h | patch | blob | history |
diff --git a/fast-import.c b/fast-import.c
index fb7d912eff8535b028b49895788a3c55b65ec5c2..7f519b4de33874e6efcedc251d9e5493a887b1bd 100644 (file)
--- a/fast-import.c
+++ b/fast-import.c
struct sha1file *f;
struct object_entry **idx, **c, **last, *e;
struct object_entry_pool *o;
- unsigned int array[256];
+ uint32_t array[256];
int i, idx_fd;
/* Build the sorted table of object IDs. */
sha1write(f, array, 256 * sizeof(int));
SHA1_Init(&ctx);
for (c = idx; c != last; c++) {
- unsigned int offset = htonl((*c)->offset);
+ uint32_t offset = htonl((*c)->offset);
sha1write(f, &offset, 4);
sha1write(f, (*c)->sha1, sizeof((*c)->sha1));
SHA1_Update(&ctx, (*c)->sha1, 20);
diff --git a/git-compat-util.h b/git-compat-util.h
index 614583e56adecb3217d18bd27a2f5b873ae0d55e..ac06963e8d89b3da84b66c4d2ddc3eba399ba1e4 100644 (file)
--- a/git-compat-util.h
+++ b/git-compat-util.h
#include <arpa/inet.h>
#include <netdb.h>
#include <pwd.h>
+#include <stdint.h>
#include <grp.h>
#ifndef NO_ICONV