[PATCH 1/2] compat: move unaligned helpers to bswap.h

2014-01-23 Thread Jeff King
From: Vicent Marti tan...@gmail.com Commit d60c49c (read-cache.c: allow unaligned mapping of the index file, 2012-04-03) introduced helpers to access unaligned data. Let's factor them out to make them more widely available. While we're at it, we'll give the helpers more readable names, add a

Re: [PATCH 1/2] compat: move unaligned helpers to bswap.h

2014-01-23 Thread Jonathan Nieder
Jeff King wrote: Commit d60c49c (read-cache.c: allow unaligned mapping of the index file, 2012-04-03) introduced helpers to access unaligned data. Let's factor them out to make them more widely available. While we're at it, we'll give the helpers more readable names, add a helper for the

Re: [PATCH 1/2] compat: move unaligned helpers to bswap.h

2014-01-23 Thread Jeff King
On Thu, Jan 23, 2014 at 11:41:18AM -0800, Jonathan Nieder wrote: Jeff King wrote: Commit d60c49c (read-cache.c: allow unaligned mapping of the index file, 2012-04-03) introduced helpers to access unaligned data. Let's factor them out to make them more widely available. While we're

Re: [PATCH 1/2] compat: move unaligned helpers to bswap.h

2014-01-23 Thread Jonathan Nieder
Jeff King wrote: I think it was a bug waiting to surface if index v4 ever got wide use. Ah, ok. In that case I think git-compat-util.h should include something like what block-sha1/sha1.c has: #if !defined(__i386__) !defined(__x86_64__) \ !defined(_M_IX86)

Re: [PATCH 1/2] compat: move unaligned helpers to bswap.h

2014-01-23 Thread Jeff King
On Thu, Jan 23, 2014 at 12:08:04PM -0800, Jonathan Nieder wrote: Jeff King wrote: On Thu, Jan 23, 2014 at 11:56:43AM -0800, Jonathan Nieder wrote: In that case I think git-compat-util.h should include something like what block-sha1/sha1.c has: #if !defined(__i386__)

Re: [PATCH 1/2] compat: move unaligned helpers to bswap.h

2014-01-23 Thread Jonathan Nieder
Jeff King wrote: On Thu, Jan 23, 2014 at 11:56:43AM -0800, Jonathan Nieder wrote: In that case I think git-compat-util.h should include something like what block-sha1/sha1.c has: #if !defined(__i386__) !defined(__x86_64__) \ !defined(_M_IX86) !defined(_M_X64) \