Skip to content

Commit d0c93db

Browse files
committed
Set FIXNUM_MIN and FIXNUM_MAX to correct values.
1 parent 669d4b0 commit d0c93db

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/cext/include/ruby/ruby.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1];
225225
# endif
226226
#endif
227227

228-
#define RUBY_FIXNUM_MAX (LONG_MAX>>1)
229-
#define RUBY_FIXNUM_MIN RSHIFT((long)LONG_MIN,1)
228+
#define RUBY_FIXNUM_MAX LONG_MAX
229+
#define RUBY_FIXNUM_MIN LONG_MIN
230230
#define FIXNUM_MAX RUBY_FIXNUM_MAX
231231
#define FIXNUM_MIN RUBY_FIXNUM_MIN
232232

@@ -346,7 +346,7 @@ rb_fix2ulong(VALUE x)
346346
return RB_FIX2ULONG(x);
347347
}
348348
int RB_FIXNUM_P(VALUE value);
349-
#define RB_POSFIXABLE(f) ((f) < RUBY_FIXNUM_MAX+1)
349+
#define RB_POSFIXABLE(f) ((f) <= RUBY_FIXNUM_MAX)
350350
#define RB_NEGFIXABLE(f) ((f) >= RUBY_FIXNUM_MIN)
351351
#define RB_FIXABLE(f) (RB_POSFIXABLE(f) && RB_NEGFIXABLE(f))
352352
#define FIX2LONG(x) RB_FIX2LONG(x)

0 commit comments

Comments
 (0)