Skip to content

Commit

Permalink
Use correct conversion functions for the seeds
Browse files Browse the repository at this point in the history
  • Loading branch information
konsolebox committed May 14, 2024
1 parent 12012da commit 6e1e262
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ext/digest/xxhash/ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,10 +642,10 @@ static VALUE _Digest_XXH64_reset(int argc, VALUE* argv, VALUE self)

break;
case T_FIXNUM:
_xxh64_reset(_get_state_xxh64(self), FIX2UINT(seed));
_xxh64_reset(_get_state_xxh64(self), FIX2ULONG(seed));
break;
case T_BIGNUM:
_xxh64_reset(_get_state_xxh64(self), NUM2ULL(seed));
_xxh64_reset(_get_state_xxh64(self), NUM2ULONG(seed));
break;
default:
rb_raise(rb_eArgError, "Invalid argument type for 'seed'. "
Expand Down Expand Up @@ -795,10 +795,10 @@ static VALUE _Digest_XXH3_64bits_reset(int argc, VALUE* argv, VALUE self)

break;
case T_FIXNUM:
_xxh3_64bits_reset(_get_state_xxh3_64bits(self), FIX2UINT(seed));
_xxh3_64bits_reset(_get_state_xxh3_64bits(self), FIX2ULONG(seed));
break;
case T_BIGNUM:
_xxh3_64bits_reset(_get_state_xxh3_64bits(self), NUM2ULL(seed));
_xxh3_64bits_reset(_get_state_xxh3_64bits(self), NUM2ULONG(seed));
break;
default:
rb_raise(rb_eArgError, "Invalid argument type for 'seed'. "
Expand Down Expand Up @@ -982,10 +982,10 @@ static VALUE _Digest_XXH3_128bits_reset(int argc, VALUE* argv, VALUE self)

break;
case T_FIXNUM:
_xxh3_128bits_reset(_get_state_xxh3_128bits(self), FIX2UINT(seed));
_xxh3_128bits_reset(_get_state_xxh3_128bits(self), FIX2ULONG(seed));
break;
case T_BIGNUM:
_xxh3_128bits_reset(_get_state_xxh3_128bits(self), NUM2ULL(seed));
_xxh3_128bits_reset(_get_state_xxh3_128bits(self), NUM2ULONG(seed));
break;
default:
rb_raise(rb_eArgError, "Invalid argument type for 'seed'. "
Expand Down

0 comments on commit 6e1e262

Please sign in to comment.