Skip to content

Commit

Permalink
Tree: API uniformasation: Use unsigned int for all index number.
Browse files Browse the repository at this point in the history
  • Loading branch information
Romain-Geissler committed Jun 5, 2011
1 parent 3a42e0a commit e5c8009
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/git2/tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ GIT_EXTERN(const git_oid *) git_tree_id(git_tree *tree);
* @param tree a previously loaded tree.
* @return the number of entries in the tree
*/
GIT_EXTERN(size_t) git_tree_entrycount(git_tree *tree);
GIT_EXTERN(unsigned int) git_tree_entrycount(git_tree *tree);

/**
* Lookup a tree entry by its filename
Expand All @@ -102,7 +102,7 @@ GIT_EXTERN(const git_tree_entry *) git_tree_entry_byname(git_tree *tree, const c
* @param idx the position in the entry list
* @return the tree entry; NULL if not found
*/
GIT_EXTERN(const git_tree_entry *) git_tree_entry_byindex(git_tree *tree, int idx);
GIT_EXTERN(const git_tree_entry *) git_tree_entry_byindex(git_tree *tree, unsigned int idx);

/**
* Get the UNIX file attributes of a tree entry
Expand Down
6 changes: 3 additions & 3 deletions src/tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ const git_tree_entry *git_tree_entry_byname(git_tree *tree, const char *filename
return git_vector_get(&tree->entries, idx);
}

const git_tree_entry *git_tree_entry_byindex(git_tree *tree, int idx)
const git_tree_entry *git_tree_entry_byindex(git_tree *tree, unsigned int idx)
{
assert(tree);
return git_vector_get(&tree->entries, (unsigned int)idx);
return git_vector_get(&tree->entries, idx);
}

size_t git_tree_entrycount(git_tree *tree)
unsigned int git_tree_entrycount(git_tree *tree)
{
assert(tree);
return tree->entries.length;
Expand Down

0 comments on commit e5c8009

Please sign in to comment.