aboutsummaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authorDan McGee <dpmcgee@gmail.com>2009-05-18 23:34:02 -0500
committerJunio C Hamano <gitster@pobox.com>2009-05-20 00:02:24 -0700
commit91fe2f909154c5cda3b40c68e72c3172a7f137f6 (patch)
tree9400d0ea436fec81b226f2abe612f50df60273fb /object.c
parent99ddd24ad7753458043016bf1b7d88915aaeb396 (diff)
downloadgit-91fe2f909154c5cda3b40c68e72c3172a7f137f6.tar.gz
git-91fe2f909154c5cda3b40c68e72c3172a7f137f6.tar.xz
Unify signedness in hashing calls
Our hash_obj and hashtable_index calls and functions were doing a lot of funny things with signedness. Unify all of it to 'unsigned int'. Signed-off-by: Dan McGee <dpmcgee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object.c')
-rw-r--r--object.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/object.c b/object.c
index e1feef9c3..a6ef43919 100644
--- a/object.c
+++ b/object.c
@@ -52,7 +52,7 @@ static unsigned int hash_obj(struct object *obj, unsigned int n)
static void insert_obj_hash(struct object *obj, struct object **hash, unsigned int size)
{
- int j = hash_obj(obj, size);
+ unsigned int j = hash_obj(obj, size);
while (hash[j]) {
j++;
@@ -62,16 +62,16 @@ static void insert_obj_hash(struct object *obj, struct object **hash, unsigned i
hash[j] = obj;
}
-static int hashtable_index(const unsigned char *sha1)
+static unsigned int hashtable_index(const unsigned char *sha1)
{
unsigned int i;
memcpy(&i, sha1, sizeof(unsigned int));
- return (int)(i % obj_hash_size);
+ return i % obj_hash_size;
}
struct object *lookup_object(const unsigned char *sha1)
{
- int i;
+ unsigned int i;
struct object *obj;
if (!obj_hash)