Re: [PATCH/RFC v2 09/16] Read index-v5

2012-08-08 Thread Junio C Hamano
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 w

Re: [PATCH/RFC v2 09/16] Read index-v5

2012-08-08 Thread Thomas Gummerer
On 08/08, Junio C Hamano wrote: > Thomas Gummerer writes: > > >> > +name = (char *)mmap + *dir_offset; > >> > +beginning = mmap + *dir_table_offset; > >> > >> Notice how you computed name with pointer arithmetic by first > >> casting mmap (which is "void *") and when computing

Re: [PATCH/RFC v2 09/16] Read index-v5

2012-08-08 Thread Junio C Hamano
Thomas Gummerer writes: >> > + name = (char *)mmap + *dir_offset; >> > + beginning = mmap + *dir_table_offset; >> >> Notice how you computed name with pointer arithmetic by first >> casting mmap (which is "void *") and when computing beginning, you >> forgot to cast mmap and attempted pointer

Re: [PATCH/RFC v2 09/16] Read index-v5

2012-08-08 Thread Thomas Gummerer
On 08/05, Junio C Hamano wrote: > Thomas Gummerer writes: > > > +static struct directory_entry *read_directories_v5(unsigned int > > *dir_offset, > > + unsigned int *dir_table_offset, > > + void *mmap, > > + int mmap_s

Re: [PATCH/RFC v2 09/16] Read index-v5

2012-08-05 Thread Junio C Hamano
Thomas Gummerer writes: > +static struct directory_entry *read_directories_v5(unsigned int *dir_offset, > + unsigned int *dir_table_offset, > + void *mmap, > + int mmap_size) > +{ > + int i, ondisk_directory_s

[PATCH/RFC v2 09/16] Read index-v5

2012-08-05 Thread Thomas Gummerer
Make git read the index file version 5 without complaining. This version of the reader doesn't read neither the cache-tree nor the resolve undo data, but doesn't choke on an index that includes such data. Helped-by: Thomas Rast Signed-off-by: Thomas Gummerer --- cache.h | 72 +++ re