summaryrefslogtreecommitdiff
path: root/src/vector.h
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2012-07-24 07:57:58 +0200
committernulltoken <emeric.fermas@gmail.com>2012-07-24 16:10:12 +0200
commitb8457baae24269c9fb777591e2a0e1b425ba31b6 (patch)
tree777a98dbd74f4906ac2faf0042e5118578196db7 /src/vector.h
parent944d250f964698b33d9fa09e2e6af74b1dd84de2 (diff)
downloadlibgit2-b8457baae24269c9fb777591e2a0e1b425ba31b6.tar.gz
portability: Improve x86/amd64 compatibility
Diffstat (limited to 'src/vector.h')
-rw-r--r--src/vector.h10
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;
}