167 e->cval =
c->eval->cval;
175 error_loc(
"multi-character constants are endian dependent\n");
194 error_loc(
"invalid storage class for type expression\n");
196 tref =
var->declspec.type;
201 e->u.tref =
var->declspec;
218 unsigned int cast_mask;
223 cast_mask = (1u << (cast_type_bits - 1)) - 1;
224 if (
expr->cval & (1u << (cast_type_bits - 1)))
225 e->cval = -((-
expr->cval) & cast_mask);
227 e->cval =
expr->cval & cast_mask;
232 cast_mask = ((1u << (cast_type_bits - 1)) - 1) |
233 1u << (cast_type_bits - 1);
234 e->cval =
expr->cval & cast_mask;
240 e->cval =
expr->cval;
261 e->cval = !
expr->cval;
264 e->cval = +
expr->cval;
267 e->cval = -
expr->cval;
301 if (expr2->
cval == 0)
303 error_loc(
"divide by zero in expression\n");
313 if (expr2->
cval == 0)
315 error_loc(
"divide by zero in expression\n");
431 *found_in_cont_type = 0;
474 *found_in_cont_type = 1;
535 int found_in_cont_type;
633 error_at( &
expr_loc->
v->
where,
"'.' or '->' operator applied to a type that isn't a structure, union or enumeration in expression%s%s\n",
681 int toplevel,
const char *toplevel_prefix,
682 const type_t *cont_type,
const char *local_var_prefix)
689 if (
e->u.integer.is_hex)
693 if (
e->u.integer.is_unsigned)
695 if (
e->u.integer.is_long)
702 if (
e->u.integer.
value == 0)
708 if (
toplevel && toplevel_prefix && cont_type)
710 int found_in_cont_type;
712 if (found_in_cont_type)
714 fprintf(
h,
"%s%s", toplevel_prefix,
e->u.sval);
718 fprintf(
h,
"%s%s", local_var_prefix,
e->u.sval);
821 write_expr(
h,
e->u.ext, 1, 0, toplevel_prefix, cont_type,
"");
837 write_expr(
h,
e->u.ext, 1, 1, toplevel_prefix, cont_type, local_var_prefix);
864 if (
a->type !=
b->type)
865 return a->type -
b->type;
871 return a->u.integer.value -
b->u.integer.value;
873 return a->u.dval -
b->u.dval;
878 return strcmp(
a->u.sval,
b->u.sval);
int strcmp(const char *String1, const char *String2)
static void check_integer_type(const struct expr_loc *expr_loc, const type_t *cont_type, const type_t *type)
expr_t * make_expr(enum expr_type type)
expr_t * make_expr1(enum expr_type type, expr_t *expr)
static int is_signed_integer_type(const type_t *type)
static void check_scalar_type(const struct expr_loc *expr_loc, const type_t *cont_type, const type_t *type)
int compare_expr(const expr_t *a, const expr_t *b)
const type_t * expr_resolve_type(const struct expr_loc *expr_loc, const type_t *cont_type, const expr_t *expr)
expr_t * make_exprs(enum expr_type type, char *val)
expr_t * make_exprt(enum expr_type type, var_t *var, expr_t *expr)
expr_t * make_exprl(enum expr_type type, const struct integer *integer)
static void check_arithmetic_type(const struct expr_loc *expr_loc, const type_t *cont_type, const type_t *type)
static struct expression_type resolve_expression(const struct expr_loc *expr_loc, const type_t *cont_type, const expr_t *e)
expr_t * make_expr3(enum expr_type type, expr_t *expr1, expr_t *expr2, expr_t *expr3)
static int is_float_type(const type_t *type)
void write_expr(FILE *h, const expr_t *e, int brackets, int toplevel, const char *toplevel_prefix, const type_t *cont_type, const char *local_var_prefix)
static int is_valid_member_operand(const type_t *type)
static int compare_type(const type_t *a, const type_t *b)
expr_t * make_exprd(enum expr_type type, double val)
static int is_integer_type(const type_t *type)
expr_t * make_expr2(enum expr_type type, expr_t *expr1, expr_t *expr2)
static type_t * find_identifier(const char *identifier, const type_t *cont_type, int *found_in_cont_type)
GLuint GLuint GLsizei GLenum type
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
GLfloat GLfloat GLfloat GLfloat h
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
static unsigned int type_memsize(ITypeInfo *typeinfo, TYPEDESC *desc, unsigned int *align_ret)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
type_t * type_new_basic(enum type_basic_type basic_type)
type_t * type_new_pointer(type_t *ref)
type_t * type_new_int(enum type_basic_type basic_type, int sign)
static int type_array_is_decl_as_ptr(const type_t *type)
static enum type_type type_get_type(const type_t *type)
static int type_basic_get_sign(const type_t *type)
static var_list_t * type_union_get_cases(const type_t *type)
static type_t * type_array_get_element_type(const type_t *type)
static enum type_basic_type type_basic_get_type(const type_t *type)
static var_list_t * type_struct_get_fields(const type_t *type)
static type_t * type_pointer_get_ref_type(const type_t *type)
static var_list_t * type_function_get_args(const type_t *type)
@ TYPE_PARAMETERIZED_TYPE
@ TYPE_ENCAPSULATED_UNION
var_t * find_const(const char *name, int f)
@ TYPE_BASIC_ERROR_STATUS_T