diff options
Diffstat (limited to 'mysys/hash.c')
-rw-r--r-- | mysys/hash.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/mysys/hash.c b/mysys/hash.c index 924f0ef418d..5ff3c2e99ce 100644 --- a/mysys/hash.c +++ b/mysys/hash.c @@ -182,8 +182,9 @@ my_hash_key(const HASH *hash, const uchar *record, size_t *length, static uint my_hash_mask(size_t hashnr, size_t buffmax, size_t maxlength) { - if ((hashnr & (buffmax-1)) < maxlength) return (hashnr & (buffmax-1)); - return (hashnr & ((buffmax >> 1) -1)); + if ((hashnr & (buffmax-1)) < maxlength) + return (uint) (hashnr & (buffmax-1)); + return (uint) (hashnr & ((buffmax >> 1) -1)); } static uint my_hash_rec_mask(const HASH *hash, HASH_LINK *pos, @@ -484,7 +485,8 @@ my_bool my_hash_insert(HASH *info, const uchar *record) my_bool my_hash_delete(HASH *hash, uchar *record) { - uint blength,pos2,pos_hashnr,lastpos_hashnr,idx,empty_index; + uint pos2,pos_hashnr,lastpos_hashnr,idx,empty_index; + size_t blength; HASH_LINK *data,*lastpos,*gpos,*pos,*pos3,*empty; DBUG_ENTER("my_hash_delete"); if (!hash->records) @@ -573,8 +575,8 @@ exit: my_bool my_hash_update(HASH *hash, uchar *record, uchar *old_key, size_t old_key_length) { - uint new_index,new_pos_index,blength,records; - size_t idx,empty; + uint new_index,new_pos_index,records; + size_t idx, empty, blength; HASH_LINK org_link,*data,*previous,*pos; DBUG_ENTER("my_hash_update"); @@ -656,7 +658,7 @@ my_bool my_hash_update(HASH *hash, uchar *record, uchar *old_key, if (new_index != new_pos_index) { /* Other record in wrong position */ data[empty] = *pos; - movelink(data,new_index,new_pos_index,empty); + movelink(data,new_index,new_pos_index, (uint) empty); org_link.next=NO_RECORD; data[new_index]= org_link; } @@ -664,7 +666,7 @@ my_bool my_hash_update(HASH *hash, uchar *record, uchar *old_key, { /* Link in chain at right position */ org_link.next=data[new_index].next; data[empty]=org_link; - data[new_index].next=empty; + data[new_index].next= (uint) empty; } DBUG_RETURN(0); } @@ -728,7 +730,8 @@ my_bool my_hash_check(HASH *hash) { int error; uint i,rec_link,found,max_links,seek,links,idx; - uint records,blength; + uint records; + size_t blength; HASH_LINK *data,*hash_info; records=hash->records; blength=hash->blength; |