Commit fefefd1d by Edward Thomson

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.
parent fb2198db
...@@ -53,7 +53,7 @@ struct git_odb_backend { ...@@ -53,7 +53,7 @@ struct git_odb_backend {
git_odb_backend *, const git_oid *, const void *, size_t, git_object_t); git_odb_backend *, const git_oid *, const void *, size_t, git_object_t);
int GIT_CALLBACK(writestream)( 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)( int GIT_CALLBACK(readstream)(
git_odb_stream **, size_t *, git_object_t *, git_odb_stream **, size_t *, git_object_t *,
......
...@@ -824,7 +824,7 @@ static int filebuf_flags(loose_backend *backend) ...@@ -824,7 +824,7 @@ static int filebuf_flags(loose_backend *backend)
return flags; 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_backend *backend;
loose_writestream *stream = NULL; loose_writestream *stream = NULL;
...@@ -833,7 +833,7 @@ static int loose_backend__writestream(git_odb_stream **stream_out, git_odb_backe ...@@ -833,7 +833,7 @@ static int loose_backend__writestream(git_odb_stream **stream_out, git_odb_backe
size_t hdrlen; size_t hdrlen;
int error; int error;
assert(_backend && length >= 0); assert(_backend);
backend = (loose_backend *)_backend; backend = (loose_backend *)_backend;
*stream_out = NULL; *stream_out = NULL;
......
...@@ -491,7 +491,7 @@ done: ...@@ -491,7 +491,7 @@ done:
static int parse_int(int *out, git_patch_parse_ctx *ctx) 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)) if (git_parse_advance_digit(&num, &ctx->parse_ctx, 10) < 0 || !git__is_int(num))
return -1; return -1;
...@@ -765,7 +765,7 @@ static int parse_patch_binary_side( ...@@ -765,7 +765,7 @@ static int parse_patch_binary_side(
{ {
git_diff_binary_t type = GIT_DIFF_BINARY_NONE; git_diff_binary_t type = GIT_DIFF_BINARY_NONE;
git_buf base85 = GIT_BUF_INIT, decoded = GIT_BUF_INIT; git_buf base85 = GIT_BUF_INIT, decoded = GIT_BUF_INIT;
git_off_t len; int64_t len;
int error = 0; int error = 0;
if (git_parse_ctx_contains_s(&ctx->parse_ctx, "literal ")) { if (git_parse_ctx_contains_s(&ctx->parse_ctx, "literal ")) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment