您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ type_size函数代码示例

51自学网 2021-06-03 09:02:38
  C++
这篇教程C++ type_size函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中type_size函数的典型用法代码示例。如果您正苦于以下问题:C++ type_size函数的具体用法?C++ type_size怎么用?C++ type_size使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了type_size函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: sizeof

// Load all variables from EEPROM//bool AP_Param::load_all(void){    struct Param_header phdr;    uint16_t ofs = sizeof(AP_Param::EEPROM_header);    while (ofs < _eeprom_size) {        hal.storage->read_block(&phdr, ofs, sizeof(phdr));        // note that this is an || not an && for robustness        // against power off while adding a variable        if (phdr.type == _sentinal_type ||            phdr.key == _sentinal_key ||            phdr.group_element == _sentinal_group) {            // we've reached the sentinal            return true;        }        const struct AP_Param::Info *info;        void *ptr;        info = find_by_header(phdr, &ptr);        if (info != NULL) {            hal.storage->read_block(ptr, ofs+sizeof(phdr), type_size((enum ap_var_type)phdr.type));        }        ofs += type_size((enum ap_var_type)phdr.type) + sizeof(phdr);    }    // we didn't find the sentinal    serialDebug("no sentinal in load_all");    return false;}
开发者ID:CptMacHammer,项目名称:au_uav_pkg,代码行数:33,


示例2: build_struct

symbol_t *build_struct (int su, symbol_t *tag, symtab_t *symtab, type_t *type){	symbol_t   *sym = find_struct (su, tag, type);	symbol_t   *s;	symtab->parent = 0;		// disconnect struct's symtab from parent scope	if (sym->table == current_symtab && sym->type->t.symtab) {		error (0, "%s defined as wrong kind of tag", tag->name);		return sym;	}	for (s = symtab->symbols; s; s = s->next) {		if (s->sy_type != sy_var)			continue;		if (su == 's') {			s->s.offset = symtab->size;			symtab->size += type_size (s->type);		} else {			int         size = type_size (s->type);			if (size > symtab->size)				symtab->size = size;		}	}	if (!type)		sym->type = find_type (sym->type);	// checks the tag, not the symtab	sym->type->t.symtab = symtab;	if (!type && sym->type->type_def->external)	//FIXME should not be necessary		sym->type->type_def = qfo_encode_type (sym->type);	return sym;}
开发者ID:EIREXE,项目名称:Quakeforge-gcw0,代码行数:31,


示例3: type_size

static unsignedtype_size(const struct glsl_type *type){   unsigned int size, i;   switch (glsl_get_base_type(type)) {   case GLSL_TYPE_UINT:   case GLSL_TYPE_INT:   case GLSL_TYPE_FLOAT:   case GLSL_TYPE_BOOL:      return glsl_get_components(type);   case GLSL_TYPE_ARRAY:      return type_size(glsl_get_array_element(type)) * glsl_get_length(type);   case GLSL_TYPE_STRUCT:      size = 0;      for (i = 0; i < glsl_get_length(type); i++) {         size += type_size(glsl_get_struct_field(type, i));      }      return size;   case GLSL_TYPE_SAMPLER:      return 0;   case GLSL_TYPE_ATOMIC_UINT:      return 0;   case GLSL_TYPE_INTERFACE:      return 0;   case GLSL_TYPE_IMAGE:      return 0;   case GLSL_TYPE_VOID:   case GLSL_TYPE_ERROR:   case GLSL_TYPE_DOUBLE:      unreachable("not reached");   }   return 0;}
开发者ID:maxenceledore,项目名称:mesa,代码行数:35,


示例4: print_instr_cat1

static void print_instr_cat1(instr_t *instr){	instr_cat1_t *cat1 = &instr->cat1;	if (cat1->ul)		printf("(ul)");	if (cat1->src_type == cat1->dst_type) {		if ((cat1->src_type == TYPE_S16) && (((reg_t)cat1->dst).num == REG_A0)) {			/* special case (nmemonic?): */			printf("mova");		} else {			printf("mov.%s%s", type[cat1->src_type], type[cat1->dst_type]);		}	} else {		printf("cov.%s%s", type[cat1->src_type], type[cat1->dst_type]);	}	printf(" ");	if (cat1->even)		printf("(even)");	if (cat1->pos_inf)		printf("(pos_infinity)");	print_reg_dst((reg_t)(cat1->dst), type_size(cat1->dst_type) == 32,			cat1->dst_rel);	printf(", ");	/* ugg, have to special case this.. vs print_reg().. */	if (cat1->src_im) {		if (type_float(cat1->src_type))			printf("(%f)", cat1->fim_val);		else if (type_uint(cat1->src_type))			printf("0x%08x", cat1->uim_val);		else			printf("%d", cat1->iim_val);	} else if (cat1->src_rel && !cat1->src_c) {		/* I would just use %+d but trying to make it diff'able with		 * libllvm-a3xx...		 */		char type = cat1->src_rel_c ? 'c' : 'r';		if (cat1->off < 0)			printf("%c<a0.x - %d>", type, -cat1->off);		else if (cat1->off > 0)			printf("%c<a0.x + %d>", type, cat1->off);		else			printf("c<a0.x>");	} else {		print_reg_src((reg_t)(cat1->src), type_size(cat1->src_type) == 32,				cat1->src_r, cat1->src_c, cat1->src_im, false, false, false);	}	if ((debug & PRINT_VERBOSE) && (cat1->must_be_0))		printf("/t{1: %x}", cat1->must_be_0);}
开发者ID:Distrotech,项目名称:Mesa,代码行数:58,


示例5: type_size

unsigned type_size(type *r, const where *from){	switch(r->type){		case type_auto:			ICE("__auto_type");		case type_btype:			return btype_size(r->bits.type, from);		case type_tdef:		{			decl *d = r->bits.tdef.decl;			type *sub;			if(d)				return type_size(d->ref, from);			sub = r->bits.tdef.type_of->tree_type;			UCC_ASSERT(sub, "type_size for unfolded typedef");			return type_size(sub, from);		}		case type_attr:		case type_cast:		case type_where:			return type_size(r->ref, from);		case type_ptr:		case type_block:			return platform_word_size();		case type_func:			/* function size is one, sizeof(main) is valid */			return 1;		case type_array:		{			integral_t sz;			if(type_is_void(r->ref))				die_at(from, "array of void");			if(!r->bits.array.size)				die_at(from, "array has an incomplete size");			sz = const_fold_val_i(r->bits.array.size);			return sz * type_size(r->ref, from);		}	}	ucc_unreach(0);}
开发者ID:8l,项目名称:ucc-c-compiler,代码行数:53,


示例6: builder_emit_dst_store

static voidbuilder_emit_dst_store(struct builder *bld, int avx_reg,		       struct inst *inst, struct inst_dst *dst){	struct inst_common common = unpack_inst_common(inst);	int subnum;	/* FIXME: write masks */	if (dst->hstride > 1)		stub("eu: dst hstride %d is > 1", dst->hstride);	if (common.saturate) {		int zero = builder_get_reg_with_uniform(bld, 0);		int one = builder_get_reg_with_uniform(bld, float_to_u32(1.0f));		ksim_assert(is_float(dst->file, dst->type));		builder_emit_vmaxps(bld, avx_reg, avx_reg, zero);		builder_emit_vminps(bld, avx_reg, avx_reg, one);	}	if (common.access_mode == BRW_ALIGN_1)		subnum = dst->da1_subnum;	else		subnum = dst->da16_subnum;	uint32_t offset =		offsetof(struct thread, grf[dst->num]) + subnum +		bld->exec_offset * dst->hstride * type_size(dst->type);	switch (bld->exec_size * type_size(dst->type)) {	case 32:		builder_emit_m256i_store(bld, avx_reg, offset);		break;	case 16:		builder_emit_m128i_store(bld, avx_reg, offset);		break;	case 4:		builder_emit_u32_store(bld, avx_reg, offset);		break;	default:		stub("eu: type size %d in dest store", type_size(dst->type));		break;	}	/* FIXME: For a straight move, this makes the AVX2 register	 * refer to the dst region.  That's fine, but the register may	 * still also shadow the src region, but since we only track	 * one region per AVX2 reg, that is lost. */	fill_region_for_dst(&bld->regs[avx_reg].region, dst, offset, bld);	builder_invalidate_region(bld, &bld->regs[avx_reg].region);	bld->regs[avx_reg].contents |= BUILDER_REG_CONTENTS_EU_REG;}
开发者ID:krh,项目名称:ksim,代码行数:52,


示例7: find_var_info

// Save the variable to EEPROM, if supported//bool AP_Param::save(void){    uint8_t group_element = 0;    const struct GroupInfo *ginfo;    uint8_t idx;    const struct AP_Param::Info *info = find_var_info(&group_element, &ginfo, &idx);    const AP_Param *ap;    if (info == NULL) {        // we don't have any info on how to store it        return false;    }    struct Param_header phdr;    // create the header we will use to store the variable    if (ginfo != NULL) {        phdr.type = PGM_UINT8(&ginfo->type);    } else {        phdr.type = PGM_UINT8(&info->type);    }    phdr.key  = PGM_UINT8(&info->key);    phdr.group_element = group_element;    ap = this;    if (phdr.type != AP_PARAM_VECTOR3F && idx != 0) {        // only vector3f can have non-zero idx for now        return false;    }    if (idx != 0) {        ap = (const AP_Param *)((uintptr_t)ap) - (idx*sizeof(float));    }    // scan EEPROM to find the right location    uint16_t ofs;    if (scan(&phdr, &ofs)) {        // found an existing copy of the variable        eeprom_write_check(ap, ofs+sizeof(phdr), type_size((enum ap_var_type)phdr.type));        return true;    }    if (ofs == (uint16_t)~0) {        return false;    }    // write a new sentinal, then the data, then the header    write_sentinal(ofs + sizeof(phdr) + type_size((enum ap_var_type)phdr.type));    eeprom_write_check(ap, ofs+sizeof(phdr), type_size((enum ap_var_type)phdr.type));    eeprom_write_check(&phdr, ofs, sizeof(phdr));    return true;}
开发者ID:54dashayu,项目名称:arducam-osd,代码行数:52,


示例8: START_TEST

END_TESTSTART_TEST (test_type_size){	Type t;	t = (Type){INT,0,0};	ck_assert_int_eq(4, type_size(t));	t = (Type){REAL,0,0};	ck_assert_int_eq(8, type_size(t));	t = (Type){AREAL,4,8};	ck_assert_int_eq(40, type_size(t));}
开发者ID:jaredtking,项目名称:cs4013-4,代码行数:15,


示例9: dst

oz::gpu_image oz::cpu_image::gpu() const {    if (!is_valid()) return gpu_image();    gpu_image dst(size(), format(), type_size());    cudaMemcpy2D(dst.ptr<void>(), dst.pitch(), ptr<void>(), pitch(),                 row_size(), h(), cudaMemcpyHostToDevice);    return dst;}
开发者ID:emailhy,项目名称:jhfan88-liboz,代码行数:7,


示例10: dst

oz::cpu_image oz::gpu_image::cpu() const {    if (!is_valid()) return cpu_image();    cpu_image dst(size(), format(), type_size());    OZ_CUDA_SAFE_CALL(cudaMemcpy2D(dst.ptr<void>(), dst.pitch(), ptr<void>(), pitch(),                                   row_size(), h(), cudaMemcpyDeviceToHost));    return dst;}
开发者ID:emailhy,项目名称:jhfan88-liboz,代码行数:7,


示例11: find_var_info

bool AS_Param::load(void){     uint8_t idx;    const struct AS_Param::Info *info = find_var_info();    if (info == NULL) {        // we don't have any info on how to load it        return false;    }    struct Param_header phdr;     phdr.type = info->type;    phdr.key  = info->key;    // scan EEPROM to find the right location    uint16_t ofs;    if (!scan(&phdr, &ofs)) {         set_value((enum as_var_type)phdr.type, (void*) info->ptr,  info->value);        return false;    }        AS_Param *ap;    ap = this;    if (idx != 0) {        ap = (AS_Param *)((uintptr_t)ap) - (idx*sizeof(float));    }    // found it    eeprom_read_block(ap,(void*)(ofs+sizeof(phdr)), type_size((enum as_var_type)phdr.type));    return true;}
开发者ID:andbet39,项目名称:Arduboat,代码行数:35,


示例12: store_identifier_table

/*===========================================================================*/void store_identifier_table(){   identifier_info_type *idinfo,*idovf;   relative_address_type reladdr;   long count;   object_table_type ooo,ooostore;   type_flagword_type sc;   Memix ixid;   Boolean is_array,is_double;   /*-------------------------------------------------------*/   idinfo=identifier_table;   idovf=idinfo+nele_identifier_table;   for (ixid=0;idinfo<idovf;++idinfo,++ixid){      ooo = cvt_to_object_table_type((*idinfo).flags);      if (bitset((*idinfo).flags,SSVAR_TYPE)) ooo = OBJ_SOFF_DATA;      sc = ooo;      if (sc == OBJ_SOFF_DATA)         count = 1;      else{         DECIDE_IS_ARRAY_IS_DOUBLE(idinfo);         count = 1;         if (is_array){            count = dim_range((*idinfo).index.dims.first);            if (is_double) count *= dim_range((*idinfo).index.dims.second);}}      Set_ooostore();      if ((*idinfo).ptr.vvv==NULL) reladdr=NIX_ADDR;      else reladdr =         store_in_object_file(ooostore,(*idinfo).ptr.vvv,type_size(sc),count);      (*idinfo).ptr.relative_address = reladdr;}   store_in_object_file(OBJ_IDTABLE,(void *) identifier_table,                        sizeof(identifier_info_type),nele_identifier_table);   /*-------------------------------------------------------*/}
开发者ID:E-LLP,项目名称:WinASSIST,代码行数:34,


示例13: decl_size_align_inc_bitfield

void decl_size_align_inc_bitfield(decl *d, unsigned *const sz, unsigned *const align){	type *ty = decl_type_for_bitfield(d);	*sz = type_size(ty, NULL);	*align = type_align(ty, NULL);}
开发者ID:bobrippling,项目名称:ucc-c-compiler,代码行数:7,


示例14: initialize

int initialize() {	sample_t d_type;	if (param_get_int_name("data_type",&data_type)) {		moderror("Error getting parameter data_type/n");		return -1;	}	if (type_param_2_type(data_type,&d_type)) {		moderror_msg("Invalid data_type parameter %d/n",data_type);		return -1;	}	input_sample_sz = type_size(d_type);	output_sample_sz = input_sample_sz;	if (param_get_int_name("nof_inputs",&nof_inputs)) {		moderror("Error getting parameter nof_inputs/n");		return -1;	}	nof_input_itf = nof_inputs;	if (nof_inputs > NOF_INPUT_ITF) {		moderror_msg("Only %d interfaces are supported. nof_inputs=%d/n",NOF_INPUT_ITF,nof_inputs);		return -1;	}	memset(input_padding_pre,0,sizeof(int)*nof_inputs);	return 0;}
开发者ID:a4a881d4,项目名称:aloe,代码行数:27,


示例15: ptr_inc_sz

staticptr_inc_sz(type) {    if ( type[0] == '[]' || type[0] == '*' )        return type_size( type[3] );    else        return 1;}
开发者ID:ras52,项目名称:bootstrap,代码行数:7,


示例16: subscript

staticsubscript(stream, node, need_lval) {    auto type = node[3][2];  /* type being subscripted */    /* For (hopefully temporary) compatibility with stage-4, we allow an      * implicit int to be dereferenced as an int*. */    extern compat_flag;    auto elt_sz = compat_flag && type == implct_int() ? 4         : type_size( type[3] );        /* remove * or [] from type */    auto sz = type_size( node[2] );    scale_elt(stream, elt_sz, 1);    pop_add(stream, 0, 4);    dereference(stream, sz, need_lval);}
开发者ID:ras52,项目名称:bootstrap,代码行数:16,


示例17: out_aalloc

const out_val *out_aalloct(out_ctx *octx, type *ty){	return out_aalloc(octx,			type_size(ty, NULL),			type_align(ty, NULL),			ty);}
开发者ID:8l,项目名称:ucc-c-compiler,代码行数:7,


示例18: init_common

void init_common(symbol *s){    //printf("init_common('%s')/n", s->Sident);    dtnzeros(&s->Sdt,type_size(s->Stype));    if (s->Sdt)        s->Sdt->dt = DT_common;}
开发者ID:Govelius,项目名称:dmd,代码行数:7,


示例19: PGM_UINT8

// convert one old vehicle parameter to new object parametervoid AP_Param::convert_old_parameter(const struct ConversionInfo *info){    // find the old value in EEPROM.    uint16_t pofs;    AP_Param::Param_header header;    header.type = PGM_UINT8(&info->type);    header.key = PGM_UINT8(&info->old_key);    header.group_element = PGM_UINT8(&info->old_group_element);    if (!scan(&header, &pofs)) {        // the old parameter isn't saved in the EEPROM. It was        // probably still set to the default value, which isn't stored        // no need to convert        return;    }    // load the old value from EEPROM    uint8_t old_value[type_size((enum ap_var_type)header.type)];    _storage.read_block(old_value, pofs+sizeof(header), sizeof(old_value));    const AP_Param *ap = (const AP_Param *)&old_value[0];    // find the new variable in the variable structures    enum ap_var_type ptype;    AP_Param *ap2;    ap2 = find_P((const prog_char_t *)&info->new_name[0], &ptype);    if (ap2 == NULL) {        hal.console->printf_P(PSTR("Unknown conversion '%s'/n"), info->new_name);        return;    }    // see if we can load it from EEPROM    if (ap2->load()) {        // the new parameter already has a value set by the user, or        // has already been converted        return;    }    // see if they are the same type    if (ptype == (ap_var_type)header.type) {        // copy the value over only if the new parameter does not already        // have the old value (via a default).        if (memcmp(ap2, ap, sizeof(old_value)) != 0) {            memcpy(ap2, ap, sizeof(old_value));            // and save            ap2->save();        }    } else if (ptype <= AP_PARAM_FLOAT && header.type <= AP_PARAM_FLOAT) {        // perform scalar->scalar conversion        float v = ap->cast_to_float((enum ap_var_type)header.type);        if (!is_equal(v,ap2->cast_to_float(ptype))) {            // the value needs to change            set_value(ptype, ap2, v);            ap2->save();        }    } else {        // can't do vector<->scalar conversion, or different vector types        hal.console->printf_P(PSTR("Bad conversion type '%s'/n"), info->new_name);    }}
开发者ID:rioth,项目名称:ardupilot-1,代码行数:60,


示例20: emit_structure

def_t *emit_structure (const char *name, int su, struct_def_t *defs, type_t *type,				void *data, storage_class_t storage){	int         i, j;	int         saw_null = 0;	int         saw_func = 0;	symbol_t   *struct_sym;	symbol_t   *field_sym;	def_t      *struct_def;	def_t       field_def;	name = save_string (name);	if (!type)		type = make_structure (0, su, defs, 0)->type;	if (!is_struct (type) || (su == 's' && type->meta != ty_struct)		|| (su == 'u' && type->meta != ty_union))		internal_error (0, "structure %s type mismatch", name);	for (i = 0, field_sym = type->t.symtab->symbols; field_sym;		 i++, field_sym = field_sym->next) {		if (!defs[i].name)			internal_error (0, "structure %s unexpected end of defs", name);		if (field_sym->type != defs[i].type)			internal_error (0, "structure %s.%s field type mismatch", name,							defs[i].name);		if ((!defs[i].emit && saw_func) || (defs[i].emit && saw_null))			internal_error (0, "structure %s mixed emit/copy", name);		if (!defs[i].emit)			saw_null = 1;		if (defs[i].emit)			saw_func = 1;	}	if (defs[i].name)		internal_error (0, "structure %s too many defs", name);	if (storage != sc_global && storage != sc_static)		internal_error (0, "structure %s must be global or static", name);	struct_sym = make_symbol (name, type, pr.far_data, storage);	struct_def = struct_sym->s.def;	if (struct_def->initialized)		internal_error (0, "structure %s already initialized", name);	struct_def->initialized = struct_def->constant = 1;	struct_def->nosave = 1;	for (i = 0, field_sym = type->t.symtab->symbols; field_sym;		 i++, field_sym = field_sym->next) {		field_def.type = field_sym->type;		field_def.name = save_string (va ("%s.%s", name, field_sym->name));		field_def.space = struct_def->space;		field_def.offset = struct_def->offset + field_sym->s.offset;		if (!defs[i].emit) {			//FIXME relocs? arrays? structs?			pr_type_t  *val = (pr_type_t *) data;			memcpy (D_POINTER (void, &field_def), val,					type_size (field_def.type) * sizeof (pr_type_t));			data = &val[type_size (field_def.type)];		} else {			if (is_array (field_def.type)) {
开发者ID:EIREXE,项目名称:Quakeforge-gcw0,代码行数:59,


示例21: calloc

static struct type *type_new(enum enum_type et){    struct type *t = calloc(sizeof *t, 1);    t->type = et;    t->size = type_size(t);    t->is_vector = false; // the default    return t;}
开发者ID:tomtix,项目名称:uuc,代码行数:8,


示例22: type_to_blocks

size_t type_to_blocks(xn_elem_t type, int nelem) {	long size;	if((size = type_size(type)) < 0)		fatal(Type must be in catalogue!);        return bytes_to_blocks(nelem * size);}
开发者ID:aunali1,项目名称:exopc,代码行数:8,


示例23: nir_assign_var_locations_scalar_direct_first

/* Identical to nir_assign_var_locations_packed except that it assigns * locations to the variables that are used 100% directly first and then * assigns locations to variables that are used indirectly. */voidnir_assign_var_locations_scalar_direct_first(nir_shader *shader,                                             struct exec_list *var_list,                                             unsigned *direct_size,                                             unsigned *size){   struct set *indirect_set = _mesa_set_create(NULL, _mesa_hash_pointer,                                               _mesa_key_pointer_equal);   nir_foreach_overload(shader, overload) {      if (overload->impl)         nir_foreach_block(overload->impl, mark_indirect_uses_block,                           indirect_set);   }   unsigned location = 0;   foreach_list_typed(nir_variable, var, node, var_list) {      if (var->data.mode == nir_var_uniform && var->interface_type != NULL)         continue;      if (_mesa_set_search(indirect_set, var))         continue;      var->data.driver_location = location;      location += type_size(var->type);   }   *direct_size = location;   foreach_list_typed(nir_variable, var, node, var_list) {      if (var->data.mode == nir_var_uniform && var->interface_type != NULL)         continue;      if (!_mesa_set_search(indirect_set, var))         continue;      var->data.driver_location = location;      location += type_size(var->type);   }   *size = location;   _mesa_set_destroy(indirect_set, NULL);}
开发者ID:maxenceledore,项目名称:mesa,代码行数:49,


示例24: add_op

staticadd_op(stream, node, is_ass, argsz) {    auto op = node[0];    /* Pointer plus integer needs scaling.  We canonicalised this during     * parsing so the pointer is always the first arg which is in node[3]. */    if ( is_pointer( node[3][2] ) && is_integral( node[4][2] ) )        scale_elt( stream, type_size( node[3][2][3] ), 1 );       if ( op == '-' || op == '-=' )        pop_sub(stream, is_ass, argsz);    else         pop_add(stream, is_ass, argsz);    /* Pointer minus pointer needs scaling down. */    if ( is_pointer( node[3][2] ) && is_pointer( node[4][2] ) )        scale_elt( stream, type_size( node[3][2][3] ), -1 );}
开发者ID:ras52,项目名称:bootstrap,代码行数:18,


示例25: type_jparam

int type_jparam(type *t){    targ_size_t sz;    type_debug(t);    return tyjparam(t->Tty) ||                ((tybasic(t->Tty) == TYstruct || tybasic(t->Tty) == TYarray) &&                 (sz = type_size(t)) <= NPTRSIZE &&                 (sz == 1 || sz == 2 || sz == 4 || sz == 8));}
开发者ID:michelf,项目名称:dmd,代码行数:9,


示例26: entries

bool Frame::has_references () const{  std::set<symbol> all;  entries (all);    for (std::set<symbol>::const_iterator i = all.begin ();       i != all.end ();       i++)    {      const symbol key = *i;      if (is_reference (key))        return true;;      if (!check (key))        continue;            Attribute::type type = lookup (key);      int size = type_size (key);      switch (type)        {        case Attribute::Submodel:          if (size == Attribute::Singleton)            {              if (submodel (key).has_references ())                return true;            }          else            {              const std::vector<boost::shared_ptr<const FrameSubmodel> >& models                = submodel_sequence (key);              for (size_t i = 0; i < models.size (); i++)                if (models[i]->has_references ())                  return true;            }          break;        case Attribute::Model:          if (size == Attribute::Singleton)            {              if (model (key).has_references ())                return true;            }          else            {              const std::vector<boost::shared_ptr<const FrameModel> >& models                = model_sequence (key);              for (size_t i = 0; i < models.size (); i++)                if (models[i]->has_references ())                  return true;            }          break;        default:          break;        }    }  return false;}
开发者ID:pamoakoy,项目名称:daisy-model,代码行数:56,


示例27: unary_post

staticunary_post(stream, node, need_lval) {    auto sz = type_size(node[2]), elt_sz = ptr_inc_sz(node[2]);    expr_code( stream, node[3], 1 );    if      ( node[0] == '++' ) postfix_inc( stream, sz,  elt_sz );    else if ( node[0] == '--' ) postfix_inc( stream, sz, -elt_sz );    else int_error( "Unknown operator: '%Mc'", node[0] );}
开发者ID:ras52,项目名称:bootstrap,代码行数:10,


示例28: decl_size

unsigned decl_size(decl *d){	if(type_is_void(d->ref))		die_at(&d->where, "%s is void", d->spel);	if(!type_is(d->ref, type_func) && d->bits.var.field_width)		die_at(&d->where, "can't take size of a bitfield");	return type_size(d->ref, &d->where);}
开发者ID:bobrippling,项目名称:ucc-c-compiler,代码行数:10,


示例29: main

int main(){	object_t o;	init();	o = make_env(scheme_null,scheme_null);	printf("object->type: %s/n",type_name(o));	printf("object->type: %d/n",type_size(o));	return 0;}
开发者ID:localchart,项目名称:yasfs,代码行数:10,



注:本文中的type_size函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ typeerror函数代码示例
C++ type_register_static函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。