commit 04aed1557bf2e67bfef8d3a991fd54526142c8a8 from: Christian Weisgerber date: Sun Jul 24 21:41:50 2022 UTC fix off_t type mismatches off_t is a signed type and depending on the platform, it can be "long" or "long long", so cast to long long for printf(). ok stsp commit - 10a16316a03005a07c45b2bbf1b5644b64e846fb commit + 04aed1557bf2e67bfef8d3a991fd54526142c8a8 blob - 0674100de40bf388b34dec547fb8529e9ba5096a blob + 904fe2806d161dfaee79db5f0f3c73e691d3f4dc --- lib/deltify.c +++ lib/deltify.c @@ -523,8 +523,8 @@ stretchblk_file_mem(uint8_t *basedata, off_t base_offs if (base_offset > basefile_size) { return got_error_fmt(GOT_ERR_RANGE, - "read beyond the size of delta base at offset %llu", - base_offset); + "read beyond the size of delta base at offset %lld", + (long long)base_offset); } while (buf_equal && *blocklen < (1 << 24) - 1) { @@ -559,8 +559,8 @@ stretchblk_mem_file(FILE *basefile, off_t base_offset0 if (fileoffset > filesize) { return got_error_fmt(GOT_ERR_RANGE, - "read beyond the size of deltify file at offset %llu", - fileoffset); + "read beyond the size of deltify file at offset %lld", + (long long)fileoffset); } if (fseeko(basefile, base_offset0 + block->offset + *blocklen, @@ -599,14 +599,14 @@ stretchblk_mem_mem(uint8_t *basedata, off_t base_offse if (base_offset > basefile_size) { return got_error_fmt(GOT_ERR_RANGE, - "read beyond the size of delta base at offset %llu", - base_offset); + "read beyond the size of delta base at offset %lld", + (long long)base_offset); } if (fileoffset > filesize) { return got_error_fmt(GOT_ERR_RANGE, - "read beyond the size of deltify file at offset %llu", - fileoffset); + "read beyond the size of deltify file at offset %lld", + (long long)fileoffset); } p = data + fileoffset; blob - 57864428e7494edbd3e3308f2be2e34368445bf9 blob + 7319d5ef83b73fc2ce80bffde945fc06670f947f --- lib/pack.c +++ lib/pack.c @@ -1135,7 +1135,7 @@ resolve_ref_delta(struct got_delta_chain *deltas, stru return got_error(GOT_ERR_NO_OBJ); base_offset = got_packidx_get_object_offset(packidx, idx); - if (base_offset == (uint64_t)-1) + if (base_offset == -1) return got_error(GOT_ERR_BAD_PACKIDX); if (base_offset >= pack->filesize) @@ -1238,7 +1238,7 @@ got_packfile_open_object(struct got_object **obj, stru *obj = NULL; offset = got_packidx_get_object_offset(packidx, idx); - if (offset == (uint64_t)-1) + if (offset == -1) return got_error(GOT_ERR_BAD_PACKIDX); err = got_pack_parse_object_type_and_size(&type, &size, &tslen, @@ -1816,7 +1816,7 @@ got_packfile_extract_raw_delta(uint8_t **delta_buf, si *result_size = 0; offset = got_packidx_get_object_offset(packidx, idx); - if (offset == (uint64_t)-1) + if (offset == -1) return got_error(GOT_ERR_BAD_PACKIDX); if (offset >= pack->filesize) @@ -1846,8 +1846,8 @@ got_packfile_extract_raw_delta(uint8_t **delta_buf, si break; default: return got_error_fmt(GOT_ERR_OBJ_TYPE, - "non-delta object type %d found at offset %llu", - type, offset); + "non-delta object type %d found at offset %lld", + type, (long long)offset); } if (tslen + delta_hdrlen < delta_hdrlen ||