X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=object.c;h=a6ef439192c1083e367f0a86cb10d93564fc9481;hb=bba0fd22ad654460a81c4b35462b600d9432a869;hp=e1feef9c3329e0370e7caff612b4f6c8684cbaef;hpb=5c44cc9ea29b74ed10f5f239791b2c2f9586f197;p=git.git 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)