*oi->disk_sizep = revidx[1].offset - obj_offset;
}
- if (oi->typep || oi->typename) {
+ if (oi->typep || oi->type_name) {
enum object_type ptot;
ptot = packed_to_object_type(p, obj_offset, type, &w_curs,
curpos);
if (oi->typep)
*oi->typep = ptot;
- if (oi->typename) {
- const char *tn = typename(ptot);
+ if (oi->type_name) {
+ const char *tn = type_name(ptot);
if (tn)
- strbuf_addstr(oi->typename, tn);
+ strbuf_addstr(oi->type_name, tn);
}
if (ptot < 0) {
type = OBJ_BAD;
const uint32_t *level1_ofs = p->index_data;
const unsigned char *index = p->index_data;
unsigned stride;
- int ret;
+ uint32_t result;
if (!index) {
if (open_pack_index(p))
index += 4;
}
- ret = bsearch_hash(sha1, level1_ofs, index, stride);
- if (ret >= 0)
- return nth_packed_object_offset(p, ret);
+ if (bsearch_hash(sha1, level1_ofs, index, stride, &result))
+ return nth_packed_object_offset(p, result);
return 0;
}