Code

Changed fast-import's pack header creation to use pack.h
authorShawn O. Pearce <spearce@spearce.org>
Wed, 16 Aug 2006 05:57:57 +0000 (01:57 -0400)
committerShawn O. Pearce <spearce@spearce.org>
Sun, 14 Jan 2007 07:15:04 +0000 (02:15 -0500)
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
fast-import.c

index 2953e80cde573ffe461e7917b47c576f74e04612..d5651693ba5e48c980c4eb3854480234f2e536ce 100644 (file)
@@ -800,15 +800,14 @@ del_entry:
 
 static void init_pack_header()
 {
-       const char* magic = "PACK";
-       unsigned long version = 3;
-       unsigned long zero = 0;
-
-       version = htonl(version);
-       ywrite(pack_fd, (char*)magic, 4);
-       ywrite(pack_fd, &version, 4);
-       ywrite(pack_fd, &zero, 4);
-       pack_offset = 4 * 3;
+       struct pack_header hdr;
+
+       hdr.hdr_signature = htonl(PACK_SIGNATURE);
+       hdr.hdr_version = htonl(2);
+       hdr.hdr_entries = 0;
+
+       ywrite(pack_fd, &hdr, sizeof(hdr));
+       pack_offset = sizeof(hdr);
 }
 
 static void fixup_header_footer()