diff options
| author | Patrick Steinhardt <ps@pks.im> | 2019-11-28 12:42:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-28 12:42:36 +0100 |
| commit | 0e5243b78ff699709d9e4ec48141a44692618f42 (patch) | |
| tree | 0c2b5b3d6b31de05aadee6bb38b224236ae38a62 /include | |
| parent | 7198d3452c8c90042b4f33687052d545bf12080c (diff) | |
| parent | 6460e8abcfda7692af9bd267bddf6e11a78f8130 (diff) | |
| download | libgit2-0e5243b78ff699709d9e4ec48141a44692618f42.tar.gz | |
Merge pull request #5123 from libgit2/ethomson/off_t
Move `git_off_t` to `git_object_size_t`
Diffstat (limited to 'include')
| -rw-r--r-- | include/git2/blob.h | 2 | ||||
| -rw-r--r-- | include/git2/diff.h | 12 | ||||
| -rw-r--r-- | include/git2/object.h | 2 | ||||
| -rw-r--r-- | include/git2/odb.h | 2 | ||||
| -rw-r--r-- | include/git2/odb_backend.h | 4 | ||||
| -rw-r--r-- | include/git2/sys/odb_backend.h | 2 | ||||
| -rw-r--r-- | include/git2/types.h | 3 |
7 files changed, 16 insertions, 11 deletions
diff --git a/include/git2/blob.h b/include/git2/blob.h index 40f922b71..7e2a745d1 100644 --- a/include/git2/blob.h +++ b/include/git2/blob.h @@ -94,7 +94,7 @@ GIT_EXTERN(const void *) git_blob_rawcontent(const git_blob *blob); * @param blob pointer to the blob * @return size on bytes */ -GIT_EXTERN(git_off_t) git_blob_rawsize(const git_blob *blob); +GIT_EXTERN(git_object_size_t) git_blob_rawsize(const git_blob *blob); /** * Flags to control the functionality of `git_blob_filter`. diff --git a/include/git2/diff.h b/include/git2/diff.h index 73c5e55b9..490b40605 100644 --- a/include/git2/diff.h +++ b/include/git2/diff.h @@ -258,12 +258,12 @@ typedef enum { * abbreviated to something reasonable, like 7 characters. */ typedef struct { - git_oid id; - const char *path; - git_off_t size; - uint32_t flags; - uint16_t mode; - uint16_t id_abbrev; + git_oid id; + const char *path; + git_object_size_t size; + uint32_t flags; + uint16_t mode; + uint16_t id_abbrev; } git_diff_file; /** diff --git a/include/git2/object.h b/include/git2/object.h index 2045dd8dc..984dbb7ac 100644 --- a/include/git2/object.h +++ b/include/git2/object.h @@ -21,6 +21,8 @@ */ GIT_BEGIN_DECL +#define GIT_OBJECT_SIZE_MAX UINT64_MAX + /** * Lookup a reference to one of the objects in a repository. * diff --git a/include/git2/odb.h b/include/git2/odb.h index e8824b727..c4bfa5290 100644 --- a/include/git2/odb.h +++ b/include/git2/odb.h @@ -294,7 +294,7 @@ GIT_EXTERN(int) git_odb_write(git_oid *out, git_odb *odb, const void *data, size * @param type type of the object that will be written * @return 0 if the stream was created; error code otherwise */ -GIT_EXTERN(int) git_odb_open_wstream(git_odb_stream **out, git_odb *db, git_off_t size, git_object_t type); +GIT_EXTERN(int) git_odb_open_wstream(git_odb_stream **out, git_odb *db, git_object_size_t size, git_object_t type); /** * Write to an odb stream diff --git a/include/git2/odb_backend.h b/include/git2/odb_backend.h index 47e0dd4b2..c593bac26 100644 --- a/include/git2/odb_backend.h +++ b/include/git2/odb_backend.h @@ -87,8 +87,8 @@ struct git_odb_stream { unsigned int mode; void *hash_ctx; - git_off_t declared_size; - git_off_t received_bytes; + git_object_size_t declared_size; + git_object_size_t received_bytes; /** * Write at most `len` bytes into `buffer` and advance the stream. 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/include/git2/types.h b/include/git2/types.h index de9ee43dd..ade0c7d32 100644 --- a/include/git2/types.h +++ b/include/git2/types.h @@ -63,6 +63,9 @@ typedef int64_t git_time_t; /**< time in seconds from epoch */ #endif +/** The maximum size of an object */ +typedef uint64_t git_object_size_t; + #include "buffer.h" #include "oid.h" |
