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 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
diff --git a/include/git2/sys/odb_backend.h b/include/git2/sys/odb_backend.h
index 6614dcf..4dba460 100644
--- a/include/git2/sys/odb_backend.h
+++ b/include/git2/sys/odb_backend.h
@@ -53,7 +53,7 @@ struct git_odb_backend {
git_odb_backend *, const git_oid *, const void *, size_t, git_object_t);
int GIT_CALLBACK(writestream)(
- git_odb_stream **, git_odb_backend *, git_off_t, git_object_t);
+ git_odb_stream **, git_odb_backend *, git_object_size_t, git_object_t);
int GIT_CALLBACK(readstream)(
git_odb_stream **, size_t *, git_object_t *,
diff --git a/src/odb_loose.c b/src/odb_loose.c
index 04b8165..4a54b3f 100644
--- a/src/odb_loose.c
+++ b/src/odb_loose.c
@@ -824,7 +824,7 @@ static int filebuf_flags(loose_backend *backend)
return flags;
}
-static int loose_backend__writestream(git_odb_stream **stream_out, git_odb_backend *_backend, git_off_t length, git_object_t type)
+static int loose_backend__writestream(git_odb_stream **stream_out, git_odb_backend *_backend, git_object_size_t length, git_object_t type)
{
loose_backend *backend;
loose_writestream *stream = NULL;
@@ -833,7 +833,7 @@ static int loose_backend__writestream(git_odb_stream **stream_out, git_odb_backe
size_t hdrlen;
int error;
- assert(_backend && length >= 0);
+ assert(_backend);
backend = (loose_backend *)_backend;
*stream_out = NULL;
diff --git a/src/patch_parse.c b/src/patch_parse.c
index e4031f1..35fd65a 100644
--- a/src/patch_parse.c
+++ b/src/patch_parse.c
@@ -491,7 +491,7 @@ done:
static int parse_int(int *out, git_patch_parse_ctx *ctx)
{
- git_off_t num;
+ int64_t num;
if (git_parse_advance_digit(&num, &ctx->parse_ctx, 10) < 0 || !git__is_int(num))
return -1;
@@ -765,7 +765,7 @@ static int parse_patch_binary_side(
{
git_diff_binary_t type = GIT_DIFF_BINARY_NONE;
git_buf base85 = GIT_BUF_INIT, decoded = GIT_BUF_INIT;
- git_off_t len;
+ int64_t len;
int error = 0;
if (git_parse_ctx_contains_s(&ctx->parse_ctx, "literal ")) {