Skip to content

Commit b8457ba

Browse files
committed
portability: Improve x86/amd64 compatibility
1 parent 944d250 commit b8457ba

35 files changed

Lines changed: 82 additions & 81 deletions

include/git2/blob.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ GIT_INLINE(int) git_blob_lookup(git_blob **blob, git_repository *repo, const git
4646
* @param len the length of the short identifier
4747
* @return 0 or an error code
4848
*/
49-
GIT_INLINE(int) git_blob_lookup_prefix(git_blob **blob, git_repository *repo, const git_oid *id, unsigned int len)
49+
GIT_INLINE(int) git_blob_lookup_prefix(git_blob **blob, git_repository *repo, const git_oid *id, size_t len)
5050
{
5151
return git_object_lookup_prefix((git_object **)blob, repo, id, len, GIT_OBJ_BLOB);
5252
}

include/git2/commit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ GIT_INLINE(int) git_commit_lookup(git_commit **commit, git_repository *repo, con
4848
* @param len the length of the short identifier
4949
* @return 0 or an error code
5050
*/
51-
GIT_INLINE(int) git_commit_lookup_prefix(git_commit **commit, git_repository *repo, const git_oid *id, unsigned len)
51+
GIT_INLINE(int) git_commit_lookup_prefix(git_commit **commit, git_repository *repo, const git_oid *id, size_t len)
5252
{
5353
return git_object_lookup_prefix((git_object **)commit, repo, id, len, GIT_OBJ_COMMIT);
5454
}

include/git2/index.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ GIT_EXTERN(int) git_index_remove(git_index *index, int position);
279279
* @param n the position of the entry
280280
* @return a pointer to the entry; NULL if out of bounds
281281
*/
282-
GIT_EXTERN(git_index_entry *) git_index_get(git_index *index, unsigned int n);
282+
GIT_EXTERN(git_index_entry *) git_index_get(git_index *index, size_t n);
283283

284284
/**
285285
* Get the count of entries currently in the index
@@ -319,7 +319,7 @@ GIT_EXTERN(const git_index_entry_unmerged *) git_index_get_unmerged_bypath(git_i
319319
* @param n the position of the entry
320320
* @return a pointer to the unmerged entry; NULL if out of bounds
321321
*/
322-
GIT_EXTERN(const git_index_entry_unmerged *) git_index_get_unmerged_byindex(git_index *index, unsigned int n);
322+
GIT_EXTERN(const git_index_entry_unmerged *) git_index_get_unmerged_byindex(git_index *index, size_t n);
323323

324324
/**
325325
* Return the stage number from a git index entry

include/git2/object.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ GIT_EXTERN(int) git_object_lookup_prefix(
7575
git_object **object_out,
7676
git_repository *repo,
7777
const git_oid *id,
78-
unsigned int len,
78+
size_t len,
7979
git_otype type);
8080

8181
/**

include/git2/odb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ GIT_EXTERN(int) git_odb_read(git_odb_object **out, git_odb *db, const git_oid *i
139139
* GIT_ENOTFOUND if the object is not in the database.
140140
* GIT_EAMBIGUOUS if the prefix is ambiguous (several objects match the prefix)
141141
*/
142-
GIT_EXTERN(int) git_odb_read_prefix(git_odb_object **out, git_odb *db, const git_oid *short_id, unsigned int len);
142+
GIT_EXTERN(int) git_odb_read_prefix(git_odb_object **out, git_odb *db, const git_oid *short_id, size_t len);
143143

144144
/**
145145
* Read the header of an object from the database, without

include/git2/odb_backend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct git_odb_backend {
4242
void **, size_t *, git_otype *,
4343
struct git_odb_backend *,
4444
const git_oid *,
45-
unsigned int);
45+
size_t);
4646

4747
int (* read_header)(
4848
size_t *, git_otype *,

include/git2/oid.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ GIT_EXTERN(int) git_oid_cmp(const git_oid *a, const git_oid *b);
147147
* @param len the number of hex chars to compare
148148
* @return 0 in case of a match
149149
*/
150-
GIT_EXTERN(int) git_oid_ncmp(const git_oid *a, const git_oid *b, unsigned int len);
150+
GIT_EXTERN(int) git_oid_ncmp(const git_oid *a, const git_oid *b, size_t len);
151151

152152
/**
153153
* Check if an oid equals an hex formatted object id.

include/git2/reflog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ GIT_EXTERN(unsigned int) git_reflog_entrycount(git_reflog *reflog);
8484
* @param idx the position to lookup
8585
* @return the entry; NULL if not found
8686
*/
87-
GIT_EXTERN(const git_reflog_entry *) git_reflog_entry_byindex(git_reflog *reflog, unsigned int idx);
87+
GIT_EXTERN(const git_reflog_entry *) git_reflog_entry_byindex(git_reflog *reflog, size_t idx);
8888

8989
/**
9090
* Get the old oid

include/git2/tag.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ GIT_INLINE(int) git_tag_lookup(git_tag **tag, git_repository *repo, const git_oi
4646
* @param len the length of the short identifier
4747
* @return 0 or an error code
4848
*/
49-
GIT_INLINE(int) git_tag_lookup_prefix(git_tag **tag, git_repository *repo, const git_oid *id, unsigned int len)
49+
GIT_INLINE(int) git_tag_lookup_prefix(git_tag **tag, git_repository *repo, const git_oid *id, size_t len)
5050
{
5151
return git_object_lookup_prefix((git_object **)tag, repo, id, len, (git_otype)GIT_OBJ_TAG);
5252
}

include/git2/tree.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ GIT_INLINE(int) git_tree_lookup_prefix(
5050
git_tree **tree,
5151
git_repository *repo,
5252
const git_oid *id,
53-
unsigned int len)
53+
size_t len)
5454
{
5555
return git_object_lookup_prefix((git_object **)tree, repo, id, len, GIT_OBJ_TREE);
5656
}
@@ -126,7 +126,7 @@ GIT_EXTERN(const git_tree_entry *) git_tree_entry_byname(git_tree *tree, const c
126126
* @param idx the position in the entry list
127127
* @return the tree entry; NULL if not found
128128
*/
129-
GIT_EXTERN(const git_tree_entry *) git_tree_entry_byindex(git_tree *tree, unsigned int idx);
129+
GIT_EXTERN(const git_tree_entry *) git_tree_entry_byindex(git_tree *tree, size_t idx);
130130

131131
/**
132132
* Get the UNIX file attributes of a tree entry

0 commit comments

Comments
 (0)