Skip to content

Commit db3d72a

Browse files
committed
move RSHIFT from numeric.h to numeric.c
1 parent 6a5019d commit db3d72a

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

include/mruby/numeric.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ extern "C" {
1313

1414
#include <limits.h>
1515

16-
#define RSHIFT(x,y) ((x)>>(int)(y))
1716
#define POSFIXABLE(f) ((f) <= INT_MAX)
1817
#define NEGFIXABLE(f) ((f) >= INT_MIN)
1918
#define FIXABLE(f) (POSFIXABLE(f) && NEGFIXABLE(f))

src/numeric.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <ieeefp.h>
2929
#endif
3030

31-
#define SIGNED_VALUE intptr_t
31+
#define RSHIFT(x,y) ((x)>>(int)(y))
3232

3333
#ifdef MRB_USE_FLOAT
3434
#define floor(f) floorf(f)
@@ -697,7 +697,7 @@ int_succ(mrb_state *mrb, mrb_value num)
697697
return mrb_funcall(mrb, num, "+", 1, mrb_fixnum_value(1));
698698
}
699699

700-
#define SQRT_INT_MAX ((SIGNED_VALUE)1<<((sizeof(mrb_int)*CHAR_BIT-1)/2))
700+
#define SQRT_INT_MAX ((mrb_int)1<<((sizeof(mrb_int)*CHAR_BIT-1)/2))
701701
/*tests if N*N would overflow*/
702702
#define FIT_SQRT_INT(n) (((n)<SQRT_INT_MAX)&&((n)>=-SQRT_INT_MAX))
703703

0 commit comments

Comments
 (0)