case PSI_T_TO_ARRAY:
set->func->handler = psi_to_array;
break;
+ case PSI_T_TO_OBJECT:
+ set->func->handler = psi_to_object;
+ break;
+ case PSI_T_VOID:
+ set->func->handler = psi_to_void;
+ break;
EMPTY_SWITCH_DEFAULT_CASE();
}
if (set->count) {
int is_to_array = (set->func->type == PSI_T_TO_ARRAY);
int is_pointer_to_struct = (ref_type->type == PSI_T_STRUCT && ref->var->pointer_level);
- if (is_to_array && !is_pointer_to_struct) {
+
+ if (!is_to_array && !is_pointer_to_struct) {
data->error(E_WARNING, "Inner `set` statement casts only work with "
"to_array() casts on structs or pointers: %s(%s...", set->func->name, set->vars->vars[0]->name);
return 0;
continue;
}
- while (-1 != PSI_ParserScan(&P)) {
+ while (0 < PSI_ParserScan(&P)) {
PSI_ParserParse(&P, PSI_TokenAlloc(&P));
- };
+ if (P.num == PSI_T_EOF) {
+ break;
+ }
+ }
+
PSI_ParserParse(&P, NULL);
PSI_ContextValidate(C, &P);
PSI_ParserDtor(&P);
void PSI_ContextCall(PSI_Context *C, impl_val *ret_val, decl *decl)
{
+ errno = 0;
C->ops->call(C, ret_val, decl);
}