8000 odb: use `git_object_size_t` for object size · libgit2/libgit2@fefefd1 · GitHub
[go: up one dir, main page]

Skip to content

Commit fefefd1

Browse files
committed
odb: use git_object_size_t for object size
Instead of using a signed type (`off_t`) use a new `git_object_size_t` for the sizes of objects.
1 parent fb2198d commit fefefd1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

include/git2/sys/odb_backend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ struct git_odb_backend {
5353
git_odb_backend *, const git_oid *, const void *, size_t, git_object_t);
5454

5555
int GIT_CALLBACK(writestream)(
56-
git_odb_stream **, git_odb_backend *, git_off_t, git_object_t);
56+
git_odb_stream **, git_odb_backend *, git_object_size_t, git_object_t);
5757

5858
int GIT_CALLBACK(readstream)(
5959
git_odb_stream **, size_t *, git_object_t *,

src/odb_loose.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ static int filebuf_flags(loose_backend *backend)
824824
return flags;
825825
}
826826

827-
static int loose_backend__writestream(git_odb_stream **stream_out, git_odb_backend *_backend, git_off_t length, git_object_t type)
827+
static int loose_backend__writestream(git_odb_stream **stream_out, git_odb_backend *_backend, git_object_size_t length, git_object_t type)
828828
{
829829
loose_backend *backend;
830830
loose_writestream *stream = NULL;
@@ -833,7 +833,7 @@ static int loose_backend__writestream(git_odb_stream **stream_out, git_odb_backe
833833
size_t hdrlen;
834834
int error;
835835

836-
assert(_backend && length >= 0);
836+
assert(_backend);
837837

838838
backend = (loose_backend *)_backend;
839839
*stream_out = NULL;

src/patch_parse.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ static int parse_header_git(
491491

492492
static int parse_int(int *out, git_patch_parse_ctx *ctx)
493493
{
494-
git_off_t num;
494+
int64_t num;
495495

496496
if (git_parse_advance_digit(&num, &ctx->parse_ctx, 10) < 0 || !git__is_int(num))
497497
return -1;
@@ -765,7 +765,7 @@ static int parse_patch_binary_side(
765765
{
766766
git_diff_binary_t type = GIT_DIFF_BINARY_NONE;
767767
git_buf base85 = GIT_BUF_INIT, decoded = GIT_BUF_INIT;
768-
git_off_t len;
768+
int64_t len;
769769
int error = 0;
770770

771771
if (git_parse_ctx_contains_s(&ctx->parse_ctx, "literal ")) {

0 commit comments

Comments
 (0)
0