commit - b4152680fa1d9df8c1eedec06bab56f638e42834
commit + 7bad153797cc0aad421bbca3534ad21e75e84907
blob - 5086b21ee286ee026ca3e242469249be3b075ef0
blob + 580ee4306f0ef90163538a0e25a2ee46e54c5a27
--- libexec/got-index-pack/got-index-pack.c
+++ libexec/got-index-pack/got-index-pack.c
#endif
static void
-update_packidx(int *nlarge, struct got_packidx *packidx, int nobj,
+update_packidx(struct got_packidx *packidx, int nobj,
struct got_indexed_object *obj)
{
int i, n, idx;
if (obj->off < GOT_PACKIDX_OFFSET_VAL_IS_LARGE_IDX)
packidx->hdr.offsets[idx] = htobe32(obj->off);
else {
- packidx->hdr.offsets[idx] = htobe32(*nlarge |
+ packidx->hdr.offsets[idx] = htobe32(packidx->nlargeobj |
GOT_PACKIDX_OFFSET_VAL_IS_LARGE_IDX);
- packidx->hdr.large_offsets[*nlarge] = htobe64(obj->off);
- (*nlarge)++;
+ packidx->hdr.large_offsets[packidx->nlargeobj] =
+ htobe64(obj->off);
+ packidx->nlargeobj++;
}
for (i = obj->id.sha1[0]; i <= 0xff; i++) {
struct got_packfile_hdr hdr;
struct got_packidx packidx;
char buf[8];
- int nobj, nvalid, nloose, nlarge = 0, nresolved = 0, i;
+ int nobj, nvalid, nloose, nresolved = 0, i;
struct got_indexed_object **objects = NULL, *obj;
SHA1_CTX ctx;
uint8_t packidx_hash[SHA1_DIGEST_LENGTH];
obj->type == GOT_OBJ_TYPE_TAG) {
objects[i]->valid = 1;
nloose++;
- update_packidx(&nlarge, &packidx, nobj, obj);
+ update_packidx(&packidx, nobj, obj);
}
}
nvalid = nloose;
objects[i]->valid = 1;
n++;
- update_packidx(&nlarge, &packidx, nobj, obj);
+ update_packidx(&packidx, nobj, obj);
err = got_privsep_send_index_pack_progress(ibuf, nobj, nobj,
nloose, nresolved + n);
if (err)
err = hwrite(idxfd, packidx.hdr.offsets, nobj * sizeof(uint32_t), &ctx);
if (err)
goto done;
- if (nlarge > 0) {
+ if (packidx.nlargeobj > 0) {
err = hwrite(idxfd, packidx.hdr.large_offsets,
- nlarge * sizeof(uint64_t), &ctx);
+ packidx.nlargeobj * sizeof(uint64_t), &ctx);
if (err)
goto done;
}