171 e->cval =
c->eval->cval;
179 error_loc(
"multi-character constants are endian dependent\n");
198 error_loc(
"invalid storage class for type expression\n");
222 unsigned int cast_mask;
227 cast_mask = (1u << (cast_type_bits - 1)) - 1;
228 if (
expr->cval & (1u << (cast_type_bits - 1)))
229 e->cval = -((-
expr->cval) & cast_mask);
231 e->cval =
expr->cval & cast_mask;
236 cast_mask = ((1u << (cast_type_bits - 1)) - 1) |
237 1u << (cast_type_bits - 1);
238 e->cval =
expr->cval & cast_mask;
244 e->cval =
expr->cval;
266 e->cval = !
expr->cval;
269 e->cval = +
expr->cval;
272 e->cval = -
expr->cval;
306 if (expr2->
cval == 0)
308 error_loc(
"divide by zero in expression\n");
318 if (expr2->
cval == 0)
320 error_loc(
"divide by zero in expression\n");
440 *found_in_cont_type = 0;
478 *found_in_cont_type = 1;
485 if (const_var)
type = const_var->
type;
540 int found_in_cont_type;
692 int toplevel,
const char *toplevel_prefix,
693 const type_t *cont_type,
const char *local_var_prefix)
715 if (
toplevel && toplevel_prefix && cont_type)
717 int found_in_cont_type;
719 if (found_in_cont_type)
721 fprintf(
h,
"%s%s", toplevel_prefix,
e->u.sval);
725 fprintf(
h,
"%s%s", local_var_prefix,
e->u.sval);
828 write_expr(
h,
e->u.ext, 1, 0, toplevel_prefix, cont_type,
"");
844 write_expr(
h,
e->u.ext, 1, 1, toplevel_prefix, cont_type, local_var_prefix);
871 if (
a->type !=
b->type)
872 return a->type -
b->type;
879 return a->u.lval -
b->u.lval;
881 return a->u.dval -
b->u.dval;
886 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_exprl(enum expr_type type, int val)
expr_t * make_exprt(enum expr_type type, var_t *var, expr_t *expr)
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)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
struct _loc_info_t loc_info
type_t * type_new_basic(enum type_basic_type basic_type)
type_t * type_new_pointer(unsigned char pointer_default, type_t *ref, attr_list_t *attrs)
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 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_array_get_element(const type_t *type)
static var_list_t * type_function_get_args(const type_t *type)
static type_t * type_pointer_get_ref(const type_t *type)
@ TYPE_ENCAPSULATED_UNION
var_t * find_const(const char *name, int f)
@ TYPE_BASIC_ERROR_STATUS_T