stage0 重命名 stage1 ast重新整理
This commit is contained in:
@@ -28,8 +28,8 @@
|
||||
* Type helpers
|
||||
* ================================================================ */
|
||||
|
||||
static int spl_is_float(spl_type_t t) { return t == SPL_F32 || t == SPL_F64; }
|
||||
static int spl_is_signed(spl_type_t t) {
|
||||
static int spl_is_float(spl_vm_kind_t t) { return t == SPL_F32 || t == SPL_F64; }
|
||||
static int spl_is_signed(spl_vm_kind_t t) {
|
||||
switch (t) {
|
||||
case SPL_I8:
|
||||
case SPL_I16:
|
||||
@@ -41,7 +41,7 @@ static int spl_is_signed(spl_type_t t) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
static int spl_type_size(spl_type_t t) {
|
||||
static int spl_type_size(spl_vm_kind_t t) {
|
||||
switch (t) {
|
||||
case SPL_VOID:
|
||||
return 0;
|
||||
@@ -123,7 +123,7 @@ static int spl_type_size(spl_type_t t) {
|
||||
do { \
|
||||
spl_vm_val_t _b = POP(), _a = POP(); \
|
||||
spl_vm_val_t _r = 0; \
|
||||
if (spl_is_float((spl_type_t)ins->type)) { \
|
||||
if (spl_is_float((spl_vm_kind_t)ins->type)) { \
|
||||
double _da, _db, _dr; \
|
||||
if (ins->type == SPL_F32) { \
|
||||
float _fa, _fb; \
|
||||
@@ -185,7 +185,7 @@ static int spl_type_size(spl_type_t t) {
|
||||
if (_b == 0) \
|
||||
VM_ERROR("division by zero"); \
|
||||
spl_vm_val_t _r = 0; \
|
||||
if (spl_is_float((spl_type_t)ins->type)) { \
|
||||
if (spl_is_float((spl_vm_kind_t)ins->type)) { \
|
||||
double _da, _db, _dr; \
|
||||
if (ins->type == SPL_F32) { \
|
||||
float _fa, _fb; \
|
||||
@@ -545,6 +545,7 @@ LONG WINAPI UnhandledExceptionFilterImpl(EXCEPTION_POINTERS *pExceptionInfo) {
|
||||
* ================================================================ */
|
||||
void spl_vm_init_ex(spl_vm_t *vm, int stack_size, int call_depth) {
|
||||
#ifdef _WIN32
|
||||
SetErrorMode(SEM_FAILCRITICALERRORS);
|
||||
SetUnhandledExceptionFilter(UnhandledExceptionFilterImpl);
|
||||
SetConsoleOutputCP(CP_UTF8);
|
||||
SetConsoleCP(CP_UTF8);
|
||||
@@ -843,7 +844,7 @@ int spl_vm_run_once(spl_vm_t *vm) {
|
||||
|
||||
case SPL_NEG: {
|
||||
spl_vm_val_t _a = POP();
|
||||
if (spl_is_float((spl_type_t)ins->type)) {
|
||||
if (spl_is_float((spl_vm_kind_t)ins->type)) {
|
||||
double _d;
|
||||
if (ins->type == SPL_F32) {
|
||||
float _f;
|
||||
|
||||
Reference in New Issue
Block a user