diff options
| author | Kurebayashi, Takahiro <[email protected]> | 2013-03-17 17:44:18 +0900 |
|---|---|---|
| committer | Kurebayashi, Takahiro <[email protected]> | 2013-03-17 17:44:18 +0900 |
| commit | 83ddef68800a7b269cb08dd987e2f8df6f291710 (patch) | |
| tree | b93e96ed8e3b801057ae336e10c7282e3d3dd26e /src | |
| parent | 2e937a5bba696ce851178f89af1abe9d7f2bcbc2 (diff) | |
| download | mruby-83ddef68800a7b269cb08dd987e2f8df6f291710.tar.gz mruby-83ddef68800a7b269cb08dd987e2f8df6f291710.zip | |
remove bit-shift operation.
Diffstat (limited to 'src')
| -rw-r--r-- | src/codegen.c | 4 | ||||
| -rw-r--r-- | src/crc.c | 2 | ||||
| -rw-r--r-- | src/opcode.h | 2 | ||||
| -rw-r--r-- | src/vm.c | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/src/codegen.c b/src/codegen.c index ace9697e9..b9b52ad10 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -541,11 +541,11 @@ for_body(codegen_scope *s, node *tree) // generate loop variable n2 = tree->car; if (n2->car && !n2->car->cdr && !n2->cdr) { - genop(s, MKOP_Ax(OP_ENTER, 1<<18)); + genop(s, MKOP_Ax(OP_ENTER, 0x40000)); gen_assignment(s, n2->car->car, 1, NOVAL); } else { - genop(s, MKOP_Ax(OP_ENTER, 1<<18)); + genop(s, MKOP_Ax(OP_ENTER, 0x40000)); gen_vmassignment(s, n2, 1, VAL); } codegen(s, tree->cdr->cdr->car, VAL); @@ -13,7 +13,7 @@ // carry #define CRC_16_CCITT 0x11021ul //x^16+x^12+x^5+1 #define CRC_XOR_PATTERN (CRC_16_CCITT << 8) -#define CRC_CARRY_BIT (1 << 24) +#define CRC_CARRY_BIT (0x01000000) uint16_t calc_crc_16_ccitt(unsigned char *src, int nbytes) diff --git a/src/opcode.h b/src/opcode.h index d77e2451f..7c2ec204d 100644 --- a/src/opcode.h +++ b/src/opcode.h @@ -7,7 +7,7 @@ #ifndef OPCODE_H #define OPCODE_H -#define MAXARG_Bx ((1<<16)-1) +#define MAXARG_Bx (0xffff) #define MAXARG_sBx (MAXARG_Bx>>1) /* `sBx' is signed */ /* instructions OP:A:B:C = 7:9:9:7 (32 bits) */ @@ -45,7 +45,7 @@ /* Maximum stack depth. Should be set lower on memory constrained systems. The value below allows about 60000 recursive calls in the simplest case. */ #ifndef MRB_STACK_MAX -#define MRB_STACK_MAX ((1<<18) - MRB_STACK_GROWTH) +#define MRB_STACK_MAX (0x40000 - MRB_STACK_GROWTH) #endif #ifdef VM_DEBUG |
