}
}
-static const struct object_id *nth_tip_table_ent(size_t ix, void *table_)
+static const struct object_id *nth_tip_table_ent(size_t ix, const void *table_)
{
- struct tip_table_entry *table = table_;
+ const struct tip_table_entry *table = table_;
return &table[ix].oid;
}
return 0;
}
-static const struct object_id *commit_to_oid(size_t index, void *table)
+static const struct object_id *commit_to_oid(size_t index, const void *table)
{
- struct commit **commits = table;
+ const struct commit * const *commits = table;
return &commits[index]->object.oid;
}
return parse_timestamp(dateptr, NULL, 10);
}
-static const struct object_id *commit_graft_oid_access(size_t index, void *table)
+static const struct object_id *commit_graft_oid_access(size_t index, const void *table)
{
- struct commit_graft **commit_graft_table = table;
+ const struct commit_graft * const *commit_graft_table = table;
return &commit_graft_table[index]->oid;
}
* The oid of element i (between 0 and nr - 1) should be returned
* by "fn(i, table)".
*/
-int oid_pos(const struct object_id *oid, void *table, size_t nr,
+int oid_pos(const struct object_id *oid, const void *table, size_t nr,
oid_access_fn fn)
{
size_t hi = nr;
#ifndef HASH_LOOKUP_H
#define HASH_LOOKUP_H
-typedef const struct object_id *oid_access_fn(size_t index, void *table);
+typedef const struct object_id *oid_access_fn(size_t index, const void *table);
int oid_pos(const struct object_id *oid,
- void *table,
+ const void *table,
size_t nr,
oid_access_fn fn);
array->sorted = 1;
}
-static const struct object_id *oid_access(size_t index, void *table)
+static const struct object_id *oid_access(size_t index, const void *table)
{
- struct object_id *array = table;
+ const struct object_id *array = table;
return &array[index];
}
die("Failed to write bitmap index");
}
-static const struct object_id *oid_access(size_t pos, void *table)
+static const struct object_id *oid_access(size_t pos, const void *table)
{
- struct pack_idx_entry **index = table;
+ const struct pack_idx_entry * const *index = table;
return &index[pos]->oid;
}