本文整理汇总了C++中check_type函数的典型用法代码示例。如果您正苦于以下问题:C++ check_type函数的具体用法?C++ check_type怎么用?C++ check_type使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check_type函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: zinstopped
/* <mask> .instopped <result> true */
static int
zinstopped(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
uint count;
check_type(*op, t_integer);
count = count_to_stopped(i_ctx_p, op->value.intval);
if (count) {
push(1);
op[-1] = *ref_stack_index(&e_stack, count - 2); /* default result */
make_true(op);
} else
make_false(op);
return 0;
}
开发者ID:jonathan-mui,项目名称:ruby-ghostscript,代码行数:17,代码来源:zcontrol.c
示例2: zif
/* <bool> <proc> if - */
int
zif(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
check_proc(*op);
check_type(op[-1], t_boolean);
if (op[-1].value.boolval) {
check_estack(1);
++esp;
ref_assign(esp, op);
esfile_check_cache();
}
pop(2);
return o_push_estack;
}
开发者ID:jonathan-mui,项目名称:ruby-ghostscript,代码行数:17,代码来源:zcontrol.c
示例3: zundef
/* <dict> <key> undef - */
static int
zundef(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
os_ptr op1 = op - 1;
int code;
check_type(*op1, t_dictionary);
if (i_ctx_p->in_superexec == 0)
check_dict_write(*op1);
code = idict_undef(op1, op);
if (code < 0 && code != gs_error_undefined) /* ignore undefined error */
return code;
pop(2);
return 0;
}
开发者ID:computersforpeace,项目名称:ghostpdl,代码行数:17,代码来源:zdict.c
示例4: zsetlanguagelevel
/* <int> .setlanguagelevel - */
static int
zsetlanguagelevel(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
int code = 0;
check_type(*op, t_integer);
if (op->value.intval != LANGUAGE_LEVEL) {
code = set_language_level(i_ctx_p, (int)op->value.intval);
if (code < 0)
return code;
}
LANGUAGE_LEVEL = op->value.intval;
pop(1);
return code;
}
开发者ID:BorodaZizitopa,项目名称:ghostscript,代码行数:17,代码来源:zmisc2.c
示例5: Bytes_length
BOOL Bytes_length(MVALUE** stack_ptr, MVALUE* lvar, sVMInfo* info, CLObject vm_type, sCLClass* klass)
{
CLObject self;
self = lvar->mObjectValue.mValue;
if(!check_type(self, gBytesTypeObject, info)) {
vm_mutex_unlock();
return FALSE;
}
(*stack_ptr)->mObjectValue.mValue = create_int_object(CLBYTES(self)->mLen);
(*stack_ptr)++;
return TRUE;
}
开发者ID:smorimura,项目名称:clover,代码行数:16,代码来源:obj_bytes.c
示例6: dynamic_value_object
static bool dynamic_value_object(compile_t* c, LLVMValueRef object,
LLVMValueRef desc, ast_t* pattern, LLVMBasicBlockRef next_block)
{
// Get the type of the right-hand side of the pattern's eq() function.
ast_t* param_type = eq_param_type(pattern);
// Build a base pointer that skips the object header.
LLVMValueRef ptr = gendesc_ptr_to_fields(c, object, desc);
// Check the runtime type. We pass a pointer to the fields because we may
// still need to match a tuple type inside a type expression.
if(!check_type(c, ptr, desc, param_type, next_block))
return false;
return check_value(c, pattern, param_type, object, next_block);
}
开发者ID:dwillmer,项目名称:ponyc,代码行数:16,代码来源:genmatch.c
示例7: check_isect
static bool check_isect(compile_t* c, LLVMValueRef ptr, LLVMValueRef desc,
ast_t* pattern_type, LLVMBasicBlockRef next_block)
{
// We have to match all component types.
ast_t* child = ast_child(pattern_type);
while(child != NULL)
{
if(!check_type(c, ptr, desc, child, next_block))
return false;
child = ast_sibling(child);
}
return true;
}
开发者ID:dwillmer,项目名称:ponyc,代码行数:16,代码来源:genmatch.c
示例8: zsetdebug
/* <string> <bool> .setdebug - */
static int
zsetdebug(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
check_read_type(op[-1], t_string);
check_type(*op, t_boolean);
{
int i;
for (i = 0; i < r_size(op - 1); i++)
gs_debug[op[-1].value.bytes[i] & 127] =
op->value.boolval;
}
pop(2);
return 0;
}
开发者ID:ststeiger,项目名称:ghostsvg,代码行数:17,代码来源:zmisc.c
示例9: zzstopped
/* <obj> <result> <mask> .stopped <result> */
static int
zzstopped(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
check_type(*op, t_integer);
check_op(3);
/* Mark the execution stack, and push the default result */
/* in case control returns normally. */
check_estack(5);
push_mark_estack(es_stopped, no_cleanup);
*++esp = op[-1]; /* save the result */
*++esp = *op; /* save the signal mask */
push_op_estack(stopped_push);
push_op_estack(zexec); /* execute the operand */
pop(2);
return o_push_estack;
}
开发者ID:jonathan-mui,项目名称:ruby-ghostscript,代码行数:18,代码来源:zcontrol.c
示例10: Range_tail
BOOL Range_tail(MVALUE** stack_ptr, MVALUE* lvar, sVMInfo* info, CLObject vm_type)
{
CLObject self;
CLObject new_obj;
int tail_value;
self = lvar->mObjectValue.mValue; // self
if(!check_type(self, gRangeTypeObject, info)) {
return FALSE;
}
(*stack_ptr)->mObjectValue.mValue = CLRANGE(self)->mTail; // push result
(*stack_ptr)++;
return TRUE;
}
开发者ID:ab25cq,项目名称:clover,代码行数:17,代码来源:obj_range.c
示例11: zrepeatform
/*
* <int> .repeatform -
*/
static int zrepeatform(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
gx_device *cdev = gs_currentdevice_inline(igs);
int code;
gs_form_template_t tmplate;
float BBox[4], Matrix[6];
check_type(*op, t_integer);
code = read_matrix(imemory, op - 2, &tmplate.CTM);
if (code < 0)
return code;
code = dict_floats_param(imemory, op - 1, "BBox", 4, BBox, NULL);
if (code < 0)
return code;
if (code == 0)
return_error(gs_error_undefined);
tmplate.BBox.p.x = BBox[0];
tmplate.BBox.p.y = BBox[1];
code = dict_floats_param(imemory, op - 1, "Matrix", 6, Matrix, NULL);
if (code < 0)
return code;
if (code == 0)
return_error(gs_error_undefined);
tmplate.form_matrix.xx = Matrix[0];
tmplate.form_matrix.xy = Matrix[1];
tmplate.form_matrix.yx = Matrix[2];
tmplate.form_matrix.yy = Matrix[3];
tmplate.form_matrix.tx = Matrix[4];
tmplate.form_matrix.ty = Matrix[5];
tmplate.pcpath = igs->clip_path;
tmplate.FormID = op->value.intval;
code = dev_proc(cdev, dev_spec_op)(cdev, gxdso_repeat_form,
&tmplate, sizeof(gs_form_template_t));
pop(3);
return code;
}
开发者ID:jianglei12138,项目名称:ghostscript,代码行数:49,代码来源:zform.c
示例12: zrepeat
int
zrepeat(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
check_proc(*op);
check_type(op[-1], t_integer);
if (op[-1].value.intval < 0)
return_error(e_rangecheck);
check_estack(5);
/* Push a mark, the count, and the procedure, and invoke */
/* the continuation operator. */
push_mark_estack(es_for, no_cleanup);
*++esp = op[-1];
*++esp = *op;
make_op_estack(esp + 1, repeat_continue);
pop(2);
return repeat_continue(i_ctx_p);
}
开发者ID:jonathan-mui,项目名称:ruby-ghostscript,代码行数:18,代码来源:zcontrol.c
示例13: z1pathbbox
/* <bool> .pathbbox <llx> <lly> <urx> <ury> */
static int
z1pathbbox(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
gs_rect box;
int code;
check_type(*op, t_boolean);
code = gs_upathbbox(igs, &box, op->value.boolval);
if (code < 0)
return code;
push(3);
make_real(op - 3, box.p.x);
make_real(op - 2, box.p.y);
make_real(op - 1, box.q.x);
make_real(op, box.q.y);
return 0;
}
开发者ID:MasterPlexus,项目名称:vendor_goldenve,代码行数:19,代码来源:zpath1.c
示例14: zcopydevice2
/* <device> <keep_open> .copydevice2 <newdevice> */
static int
zcopydevice2(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
gx_device *new_dev;
int code;
check_read_type(op[-1], t_device);
check_type(*op, t_boolean);
code = gs_copydevice2(&new_dev, op[-1].value.pdevice, op->value.boolval,
imemory);
if (code < 0)
return code;
new_dev->memory = imemory;
make_tav(op - 1, t_device, icurrent_space | a_all, pdevice, new_dev);
pop(1);
return 0;
}
开发者ID:MasterPlexus,项目名称:vendor_goldenve,代码行数:19,代码来源:zdevice.c
示例15: zgetdevice
/* <int> .getdevice <device> */
static int
zgetdevice(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
const gx_device *dev;
check_type(*op, t_integer);
if (op->value.intval != (int)(op->value.intval))
return_error(e_rangecheck); /* won't fit in an int */
dev = gs_getdevice((int)(op->value.intval));
if (dev == 0) /* index out of range */
return_error(e_rangecheck);
/* Device prototypes are read-only; */
/* the cast is logically unnecessary. */
make_tav(op, t_device, avm_foreign | a_readonly, pdevice,
(gx_device *) dev);
return 0;
}
开发者ID:MasterPlexus,项目名称:vendor_goldenve,代码行数:19,代码来源:zdevice.c
示例16: zsettrapparams
/* <dict> .settrapparams - */
static int
zsettrapparams(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
dict_param_list list;
int code;
check_type(*op, t_dictionary);
code = dict_param_list_read(&list, op, NULL, false, iimemory);
if (code < 0)
return code;
code = gs_settrapparams(&i_trap_params, (gs_param_list *) & list);
iparam_list_release(&list);
if (code < 0)
return code;
pop(1);
return 0;
}
开发者ID:jonathan-mui,项目名称:ruby-ghostscript,代码行数:19,代码来源:ztrap.c
示例17: get_type
void upkg::get_types(void)
{
int i, j;
char readbuf[UPKG_MAX_ORDERS * 4];
for (i = 0; i < hdr->export_count; i++) {
if ((j = get_types_isgood(i)) != -1) {
reader->seek(exports[i].serial_offset);
reader->read(readbuf, 4 * UPKG_MAX_ORDERS);
get_type(readbuf, i, j);
check_type(i, j);
} else {
exports[i].type_name = -1;
}
}
}
开发者ID:roman5566,项目名称:foo_dumb,代码行数:18,代码来源:unrealfmt.cpp
示例18: dynamic_capture_object
static bool dynamic_capture_object(compile_t* c, LLVMValueRef object,
LLVMValueRef desc, ast_t* pattern, LLVMBasicBlockRef next_block)
{
ast_t* pattern_type = ast_type(pattern);
// Build a base pointer that skips the object header.
LLVMValueRef ptr = gendesc_ptr_to_fields(c, object, desc);
// Check the runtime type. We pass a pointer to the fields because we may
// still need to match a tuple type inside a type expression.
if(!check_type(c, ptr, desc, pattern_type, next_block))
return false;
// As long as the type is correct, we can assign it, with gen_assign_value()
// handling boxing and unboxing. We pass the type of the pattern as the type
// of the object.
return gen_assign_value(c, pattern, object, pattern_type) != NULL;
}
开发者ID:danielaRiesgo,项目名称:ponyc,代码行数:18,代码来源:genmatch.c
示例19: resolve_string
static scp_result resolve_string(sc_memory_context *context, const sc_char *operator_name, const sc_char *parameter_name, scp_operand *param, char **str)
{
sc_stream *stream;
sc_uint32 length = 0, read_length = 0;
sc_char *data;
if (SCP_ASSIGN == param->param_type)
{
return print_parameter_error(operator_name, parameter_name, "must have FIXED modifier");
}
if (SC_FALSE == sc_memory_is_element(context, param->addr))
{
return print_parameter_error(operator_name, parameter_name, "has not value");
}
if (SCP_RESULT_FALSE == check_type(context, param->addr, scp_type_link))
{
return print_parameter_error(operator_name, parameter_name, "must have link type");
}
if (SCP_RESULT_FALSE == check_string_type(context, param->addr))
{
return print_parameter_error(operator_name, parameter_name, "must have string format");
}
if (SC_RESULT_OK != sc_memory_get_link_content(context, param->addr, &stream))
{
return print_parameter_error(operator_name, parameter_name, "content reading error");
}
sc_stream_get_length(stream, &length);
// extra byte needed for string terminator, which is neither counted nor read from an sc_stream
data = calloc(length + 1, sizeof(sc_char));
sc_stream_read_data(stream, data, length, &read_length);
sc_stream_free(stream);
size_t str_length = strlen(data) + 1;
*str = calloc(str_length, sizeof(sc_char));
memcpy(*str, data, str_length);
free(data);
return SCP_RESULT_TRUE;
}
开发者ID:MaximDanilov,项目名称:sc-machine,代码行数:44,代码来源:scp_utils.c
示例20: test_rename_dir
static int test_rename_dir(void)
{
int err = 0;
int res;
start_test("rename dir");
res = create_dir(testdir, testdir_files);
if (res == -1)
return -1;
rmdir(testdir2);
res = rename(testdir, testdir2);
if (res == -1) {
PERROR("rename");
cleanup_dir(testdir, testdir_files, 1);
return -1;
}
res = check_nonexist(testdir);
if (res == -1) {
cleanup_dir(testdir, testdir_files, 1);
return -1;
}
res = check_type(testdir2, S_IFDIR);
if (res == -1) {
cleanup_dir(testdir2, testdir_files, 1);
return -1;
}
err += check_mode(testdir2, 0755);
err += check_dir_contents(testdir2, testdir_files);
err += cleanup_dir(testdir2, testdir_files, 0);
res = rmdir(testdir2);
if (res == -1) {
PERROR("rmdir");
return -1;
}
res = check_nonexist(testdir2);
if (res == -1)
return -1;
if (err)
return -1;
success();
return 0;
}
开发者ID:daddy366,项目名称:anarchy-fuse,代码行数:44,代码来源:test.c
注:本文中的check_type函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论