diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2019-06-23 16:42:14 +0100 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2019-11-22 15:14:13 +1100 |
| commit | fefefd1d39420095631987e503402f8ee6956163 (patch) | |
| tree | 22d433415e3d325f5fe5763cc3ee215741291fba | |
| parent | fb2198db6b48ce3c5e3cecaa03ecb179c5a02382 (diff) | |
| download | libgit2-fefefd1d39420095631987e503402f8ee6956163.tar.gz | |
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.
| -rw-r--r-- | include/git2/sys/odb_backend.h | 2 | ||||
| -rw-r--r-- | src/odb_loose.c | 4 | ||||
| -rw-r--r-- | src/patch_parse.c | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/include/git2/sys/odb_backend.h b/include/git2/sys/odb_backend.h index 6614dcf30..4dba460af 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 04b81653b..4a54b3fc0 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 e4031f11d..35fd65a0d 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 ")) { |
