From: Junio C Hamano Date: Wed, 08 Aug 2012 21:50:33 GMT Subject: Re: [PATCH/RFC v2 09/16] Read index-v5 Message-ID: <7vsjbxqcie.fsf@alter.siamese.dyndns.org> In-Reply-To: <20120808204435.GC25671@tommy-fedora.surfnet.iacbox> Thomas Gummerer writes: > On 08/08, Junio C Hamano wrote: >> Thomas Gummerer writes: >> ... >> After thinking about this, the ptr_add() macro might be the best >> solution, even though I originally called it as a band-aid. We know >> mmap is a blob of memory, byte-offset of each component of which we >> know about, so we can say >> >> name = ptr_add(mmap, *dir_offset); >> beginning = ptr_add(mmap, *dir_offset); >> >> Hmmm.. > > I start to think so too. Casting the mmap variable to "const char *" > in the method call doesn't feel right to me, even though it would work. > Unless there are any objections I'll use ptr_add in the next version. Thanks for sanity checking my thinking.