diff options
author | nulltoken <emeric.fermas@gmail.com> | 2012-07-24 07:57:58 +0200 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2012-07-24 16:10:12 +0200 |
commit | b8457baae24269c9fb777591e2a0e1b425ba31b6 (patch) | |
tree | 777a98dbd74f4906ac2faf0042e5118578196db7 /src/vector.h | |
parent | 944d250f964698b33d9fa09e2e6af74b1dd84de2 (diff) | |
download | libgit2-b8457baae24269c9fb777591e2a0e1b425ba31b6.tar.gz |
portability: Improve x86/amd64 compatibility
Diffstat (limited to 'src/vector.h')
-rw-r--r-- | src/vector.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vector.h b/src/vector.h index 9139db345..f75e634ba 100644 --- a/src/vector.h +++ b/src/vector.h @@ -12,16 +12,16 @@ typedef int (*git_vector_cmp)(const void *, const void *); typedef struct git_vector { - unsigned int _alloc_size; + size_t _alloc_size; git_vector_cmp _cmp; void **contents; - unsigned int length; + size_t length; int sorted; } git_vector; #define GIT_VECTOR_INIT {0} -int git_vector_init(git_vector *v, unsigned int initial_size, git_vector_cmp cmp); +int git_vector_init(git_vector *v, size_t initial_size, git_vector_cmp cmp); void git_vector_free(git_vector *v); void git_vector_clear(git_vector *v); void git_vector_swap(git_vector *a, git_vector *b); @@ -45,12 +45,12 @@ GIT_INLINE(int) git_vector_bsearch2( return git_vector_bsearch3(NULL, v, cmp, key); } -GIT_INLINE(void *) git_vector_get(git_vector *v, unsigned int position) +GIT_INLINE(void *) git_vector_get(git_vector *v, size_t position) { return (position < v->length) ? v->contents[position] : NULL; } -GIT_INLINE(const void *) git_vector_get_const(const git_vector *v, unsigned int position) +GIT_INLINE(const void *) git_vector_get_const(const git_vector *v, size_t position) { return (position < v->length) ? v->contents[position] : NULL; } |