{"thread":{"id":"6419","subject":"[PATCH 1/2] Use fixed-size integers for the on-disk pack structure.","startedAt":"2007-01-18T07:24:21Z","lastAt":"2007-01-18T07:24:21Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"31944","messageId":"7vejpsol0a.fsf@assigned-by-dhcp.cox.net","threadId":"6419","inReplyTo":null,"subject":"[PATCH 1/2] Use fixed-size integers for the on-disk pack structure.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-18T07:24:21Z","receivedAt":"2007-01-18T07:24:21Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"From: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>\nDate: Wed, 17 Jan 2007 09:07:23 +0100\n\nPlain integer types without a fixed size can vary between platforms.  Even\nthough all common platforms use 32-bit ints, there is no guarantee that\nthis won't change at some point.  Furthermore, specifying an integer type\nwith explicit size makes the definition of structures more obvious.\n\nSigned-off-by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\n * For wider review -- this _might_ have issues with \"not quite\n   POSIX\" systems (such as AIX exporting something undesirable\n   under _ALL_SOURCE for example).\n\n git-compat-util.h |    1 +\n pack.h            |    6 +++---\n 2 files changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 8d244d0..bf3ceb8 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -46,6 +46,7 @@\n #include <arpa/inet.h>\n #include <netdb.h>\n #include <pwd.h>\n+#include <stdint.h>\n #undef _ALL_SOURCE /* AIX 5.3L defines a struct list with _ALL_SOURCE. */\n #include <grp.h>\n #define _ALL_SOURCE 1\ndiff --git a/pack.h b/pack.h\nindex 790ff4a..821706f 100644\n--- a/pack.h\n+++ b/pack.h\n@@ -10,9 +10,9 @@\n #define PACK_VERSION 2\n #define pack_version_ok(v) ((v) == htonl(2) || (v) == htonl(3))\n struct pack_header {\n-\tunsigned int hdr_signature;\n-\tunsigned int hdr_version;\n-\tunsigned int hdr_entries;\n+\tuint32_t hdr_signature;\n+\tuint32_t hdr_version;\n+\tuint32_t hdr_entries;\n };\n \n /*\n-- \n1.5.0.rc1.g05cf8\n"}]}