index-pack: minor fixes to comment and function name
Use proper english. Be more exact in one comment. [jc: I threw in a bit of style clean-up as well] Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Nicolas Pitre committed
Oct 27, 2006 at 16:14 UTC
b89c4e93cc1939493c2bb9b6c3f60eabaf653eff
1 file changed
+12
-12
index-pack.c
+12
-12
@@ -105,7 +105,7 @@ static void flush()
105
* Make sure at least "min" bytes are available in the buffer, and
106
* return the pointer to the buffer.
107
*/
108
-static void * fill(int min)
108
+static void *fill(int min)
109
{
110
if (min <= input_len)
111
return input_buffer + input_offset;
@@ -134,7 +134,7 @@ static void use(int bytes)
134
consumed_bytes += bytes;
135
}
136
137
-static const char * open_pack_file(const char *pack_name)
137
+static const char *open_pack_file(const char *pack_name)
138
{
139
if (from_stdin) {
140
input_fd = 0;
@@ -275,7 +275,7 @@ static void *unpack_raw_entry(struct object_entry *obj, union delta_base *delta_
275
return unpack_entry_data(obj->offset, obj->size);
276
}
277
278
-static void * get_data_from_pack(struct object_entry *obj)
278
+static void *get_data_from_pack(struct object_entry *obj)
279
{
280
unsigned long from = obj[0].offset + obj[0].hdr_size;
281
unsigned long len = obj[1].offset - from;
@@ -324,8 +324,8 @@ static int find_delta(const union delta_base *base)
324
return -first-1;
325
}
326
327
-static int find_delta_childs(const union delta_base *base,
328
- int *first_index, int *last_index)
327
+static int find_delta_children(const union delta_base *base,
328
+ int *first_index, int *last_index)
329
{
330
int first = find_delta(base);
331
int last = first;
@@ -389,7 +389,7 @@ static void resolve_delta(struct object_entry *delta_obj, void *base_data,
389
nr_resolved_deltas++;
390
391
hashcpy(delta_base.sha1, delta_obj->sha1);
392
- if (!find_delta_childs(&delta_base, &first, &last)) {
392
+ if (!find_delta_children(&delta_base, &first, &last)) {
393
for (j = first; j <= last; j++) {
394
struct object_entry *child = objects + deltas[j].obj_no;
395
if (child->real_type == OBJ_REF_DELTA)
@@ -399,7 +399,7 @@ static void resolve_delta(struct object_entry *delta_obj, void *base_data,
399
400
memset(&delta_base, 0, sizeof(delta_base));
401
delta_base.offset = delta_obj->offset;
402
- if (!find_delta_childs(&delta_base, &first, &last)) {
402
+ if (!find_delta_children(&delta_base, &first, &last)) {
403
for (j = first; j <= last; j++) {
404
struct object_entry *child = objects + deltas[j].obj_no;
405
if (child->real_type == OBJ_OFS_DELTA)
@@ -429,7 +429,7 @@ static void parse_pack_objects(unsigned char *sha1)
429
* First pass:
430
* - find locations of all objects;
431
* - calculate SHA1 of all non-delta objects;
432
- * - remember base SHA1 for all deltas.
432
+ * - remember base (SHA1 or offset) for all deltas.
433
*/
434
if (verbose)
435
fprintf(stderr, "Indexing %d objects.\n", nr_objects);
@@ -489,10 +489,10 @@ static void parse_pack_objects(unsigned char *sha1)
489
if (obj->type == OBJ_REF_DELTA || obj->type == OBJ_OFS_DELTA)
490
continue;
491
hashcpy(base.sha1, obj->sha1);
492
- ref = !find_delta_childs(&base, &ref_first, &ref_last);
492
+ ref = !find_delta_children(&base, &ref_first, &ref_last);
493
memset(&base, 0, sizeof(base));
494
base.offset = obj->offset;
495
- ofs = !find_delta_childs(&base, &ofs_first, &ofs_last);
495
+ ofs = !find_delta_children(&base, &ofs_first, &ofs_last);
496
if (!ref && !ofs)
497
continue;
498
data = get_data_from_pack(obj);
@@ -615,7 +615,7 @@ static void fix_unresolved_deltas(int nr_unresolved)
615
else die("base object %s is of type '%s'",
616
sha1_to_hex(d->base.sha1), type);
617
618
- find_delta_childs(&d->base, &first, &last);
618
+ find_delta_children(&d->base, &first, &last);
619
for (j = first; j <= last; j++) {
620
struct object_entry *child = objects + deltas[j].obj_no;
621
if (child->real_type == OBJ_REF_DELTA)
@@ -675,7 +675,7 @@ static int sha1_compare(const void *_a, const void *_b)
675
* On entry *sha1 contains the pack content SHA1 hash, on exit it is
676
* the SHA1 hash of sorted object names.
677
*/
678
-static const char * write_index_file(const char *index_name, unsigned char *sha1)
678
+static const char *write_index_file(const char *index_name, unsigned char *sha1)
679
{
680
struct sha1file *f;
681
struct object_entry **sorted_by_sha, **list, **last;