mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
add a few const qualifier
This commit is contained in:
@@ -91,7 +91,7 @@ typedef short mrb_sym;
|
||||
# define PRIo64 "I64o"
|
||||
# define PRIx64 "I64x"
|
||||
# define PRIX64 "I64X"
|
||||
static unsigned int IEEE754_INFINITY_BITS_SINGLE = 0x7F800000;
|
||||
static const unsigned int IEEE754_INFINITY_BITS_SINGLE = 0x7F800000;
|
||||
# define INFINITY (*(float *)&IEEE754_INFINITY_BITS_SINGLE)
|
||||
# define NAN ((float)(INFINITY - INFINITY))
|
||||
# else
|
||||
|
||||
@@ -32,7 +32,7 @@ void mrb_random_init_genrand(mt_state *t, unsigned long s)
|
||||
unsigned long mrb_random_genrand_int32(mt_state *t)
|
||||
{
|
||||
unsigned long y;
|
||||
static unsigned long mag01[2]={0x0UL, MATRIX_A};
|
||||
static const unsigned long mag01[2]={0x0UL, MATRIX_A};
|
||||
/* mag01[x] = x * MATRIX_A for x=0,1 */
|
||||
|
||||
if (t->mti >= N) { /* generate N words at one time */
|
||||
@@ -126,7 +126,7 @@ void init_by_array(unsigned long init_key[], int key_length)
|
||||
unsigned long genrand_int32(void)
|
||||
{
|
||||
unsigned long y;
|
||||
static unsigned long mag01[2]={0x0UL, MATRIX_A};
|
||||
static const unsigned long mag01[2]={0x0UL, MATRIX_A};
|
||||
/* mag01[x] = x * MATRIX_A for x=0,1 */
|
||||
|
||||
if (mti >= N) { /* generate N words at one time */
|
||||
|
||||
@@ -19,7 +19,7 @@ static const char utf8len_codepage[256] =
|
||||
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,1,1,1,1,1,1,1,1,1,1,1,
|
||||
};
|
||||
|
||||
static char utf8len_codepage_zero[256] =
|
||||
static const char utf8len_codepage_zero[256] =
|
||||
{
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
||||
|
||||
Reference in New Issue
Block a user