📄 gbx_subr_conv.c
字号:
/*************************************************************************** subr_conv.c Type and conversion subroutines (c) 2000-2004 Beno顃 Minisini <gambas@users.sourceforge.net> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.***************************************************************************/#include "gb_common.h"#include "gbx_value.h"#include "gbx_subr.h"#include "gbx_local.h"#include "gbx_string.h"#include "gbx_date.h"#include "gbx_number.h"PUBLIC void SUBR_is_type(void){ static void *jump[] = { &&__BAD, &&__BOOLEAN, &&__BYTE, &&__SHORT, &&__INTEGER, &&__LONG, &&__FLOAT, &&__DATE, &&__STRING, &&__BAD, &&__BAD, &&__BAD, &&__BAD, &&__BAD, &&__BAD, &&__NULL, &&__OBJECT, &&__NUMBER }; boolean test; TYPE type; SUBR_ENTER_PARAM(1); VARIANT_undo(PARAM); type = EXEC_code & 0x3F; goto *jump[type];__BOOLEAN:__BYTE:__SHORT:__INTEGER:__LONG:__FLOAT:__DATE: test = PARAM->type == type; goto __END;__STRING: test = PARAM->type == T_STRING || PARAM->type == T_CSTRING; if (test) goto __END; else goto __NULL;__NULL: test = VALUE_is_null(PARAM); goto __END;__OBJECT: test = TYPE_is_object_null(PARAM->type); goto __END;__NUMBER: test = TYPE_is_number(PARAM->type); goto __END;__BAD: THROW(E_ILLEGAL);__END: RETURN->type = T_BOOLEAN; RETURN->_integer.value = test ? -1 : 0; SUBR_LEAVE();}PUBLIC void SUBR_conv(void){ VALUE_conv(SP - 1, EXEC_code & 0x3F);}PUBLIC void SUBR_type(void){ long type; SUBR_ENTER_PARAM(1); /* pas bon ! Ne respecte pas la transitivit
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -