summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2019-06-23 15:16:47 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2019-11-22 15:09:17 +1100
commitbed9fc6b59eafc9ad197a7ff7215ed6be97663ae (patch)
tree8f0ab10bc03df5ef108faf7751a2589663e9b876 /src
parent9b04d0be29caca53a48c683660d1c1ca77de7b02 (diff)
downloadlibgit2-bed9fc6b59eafc9ad197a7ff7215ed6be97663ae.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.
Diffstat (limited to 'src')
-rw-r--r--src/odb.c10
-rw-r--r--src/odb.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/src/odb.c b/src/odb.c
index 06e4930b0..2998a2d43 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -89,7 +89,7 @@ int git_odb__format_object_header(
size_t *written,
char *hdr,
size_t hdr_size,
- git_off_t obj_len,
+ git_object_size_t obj_len,
git_object_t obj_type)
{
const char *type_str = git_object_type2string(obj_type);
@@ -320,7 +320,7 @@ int git_odb__hashlink(git_oid *out, const char *path)
int git_odb_hashfile(git_oid *out, const char *path, git_object_t type)
{
- git_off_t size;
+ git_object_size_t size;
int result, fd = git_futils_open_ro(path);
if (fd < 0)
return fd;
@@ -385,7 +385,7 @@ static void fake_wstream__free(git_odb_stream *_stream)
git__free(stream);
}
-static int init_fake_wstream(git_odb_stream **stream_p, git_odb_backend *backend, git_off_t size, git_object_t type)
+static int init_fake_wstream(git_odb_stream **stream_p, git_odb_backend *backend, git_object_size_t size, git_object_t type)
{
fake_wstream *stream;
size_t blobsize;
@@ -1319,7 +1319,7 @@ int git_odb_write(
return error;
}
-static int hash_header(git_hash_ctx *ctx, git_off_t size, git_object_t type)
+static int hash_header(git_hash_ctx *ctx, git_object_size_t size, git_object_t type)
{
char header[64];
size_t hdrlen;
@@ -1333,7 +1333,7 @@ static int hash_header(git_hash_ctx *ctx, git_off_t size, git_object_t type)
}
int git_odb_open_wstream(
- git_odb_stream **stream, git_odb *db, git_off_t size, git_object_t type)
+ git_odb_stream **stream, git_odb *db, git_object_size_t size, git_object_t type)
{
size_t i, writes = 0;
int error = GIT_ERROR;
diff --git a/src/odb.h b/src/odb.h
index 79ed6b402..8dd4efd64 100644
--- a/src/odb.h
+++ b/src/odb.h
@@ -70,7 +70,7 @@ int git_odb__hashobj(git_oid *id, git_rawobj *obj);
/*
* Format the object header such as it would appear in the on-disk object
*/
-int git_odb__format_object_header(size_t *out_len, char *hdr, size_t hdr_size, git_off_t obj_len, git_object_t obj_type);
+int git_odb__format_object_header(size_t *out_len, char *hdr, size_t hdr_size, git_object_size_t obj_len, git_object_t obj_type);
/*
* Hash an open file descriptor.