Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ key64_hash (uint64_t key, uint32_t seed)
long
rb_objid_hash(st_index_t index)
{
return key64_hash (index, prime2);
return key64_hash (index, (uint32_t)prime2);
}

static st_index_t
Expand Down Expand Up @@ -315,7 +315,7 @@ rb_ident_hash(st_data_t n)
}
#endif

return (st_index_t) key64_hash((st_index_t)n, prime2);
return (st_index_t) key64_hash((st_index_t)n, (uint32_t)prime2);
}

static const struct st_hash_type identhash = {
Expand Down
6 changes: 3 additions & 3 deletions st.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ get_power2(st_index_t size) {
/* Return value of N-th bin in array BINS of table with bins size
index S. */
static inline st_index_t
get_bin(st_index_t *bins, int s, st_index_t n) {
get_bin(st_index_t *bins, st_index_t s, st_index_t n) {
return (s == 0 ? ((unsigned char *) bins)[n]
: s == 1 ? ((unsigned short *) bins)[n]
: s == 2 ? ((unsigned int *) bins)[n]
Expand All @@ -357,10 +357,10 @@ get_bin(st_index_t *bins, int s, st_index_t n) {
/* Set up N-th bin in array BINS of table with bins size index S to
value V. */
static inline void
set_bin(st_index_t *bins, int s, st_index_t n, st_index_t v) {
set_bin(st_index_t *bins, st_index_t s, st_index_t n, st_index_t v) {
if (s == 0) ((unsigned char *) bins)[n] = v;
else if (s == 1) ((unsigned short *) bins)[n] = v;
else if (s == 2) ((unsigned int *) bins)[n] = v;
else if (s == 2) ((unsigned int *) bins)[n] = (unsigned int)v;
else ((st_index_t *) bins)[n] = v;
}

Expand Down