X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Ftools%2Fwidl%2Fparser.tab.c;h=99423d7e571d3127ed22a0a88061a2c928b005ce;hp=c350d553c5465186d61bbe7d09780408e3d896d1;hb=e2eef76cbfbacd8b894858581cc3bc57aec16083;hpb=c43e05155c3c8fc70d7cfcd50d8b508f45990239 diff --git a/reactos/tools/widl/parser.tab.c b/reactos/tools/widl/parser.tab.c index c350d553c54..99423d7e571 100644 --- a/reactos/tools/widl/parser.tab.c +++ b/reactos/tools/widl/parser.tab.c @@ -3744,12 +3744,12 @@ yyreduce: case 242: #line 877 "parser.y" - { (yyval.type) = get_type(0, (yyvsp[0].str), 0); (yyval.type)->kind = TKIND_DISPATCH; ;} + { (yyval.type) = get_type(RPC_FC_IP, (yyvsp[0].str), 0); (yyval.type)->kind = TKIND_DISPATCH; ;} break; case 243: #line 878 "parser.y" - { (yyval.type) = get_type(0, (yyvsp[0].str), 0); (yyval.type)->kind = TKIND_DISPATCH; ;} + { (yyval.type) = get_type(RPC_FC_IP, (yyvsp[0].str), 0); (yyval.type)->kind = TKIND_DISPATCH; ;} break; case 244: @@ -4792,6 +4792,14 @@ static void set_type(var_t *v, decl_spec_t *decl_spec, const declarator_t *decl, error_loc("'%s': [string] attribute applied to non-pointer, non-array type\n", v->name); + if (is_attr(v->attrs, ATTR_V1ENUM)) + { + if (v->type->type == RPC_FC_ENUM16) + v->type->type = RPC_FC_ENUM32; + else + error_loc("'%s': [v1_enum] attribute applied to non-enum type\n", v->name); + } + sizeless = FALSE; if (arr) LIST_FOR_EACH_ENTRY_REV(dim, arr, expr_t, entry) { @@ -5213,16 +5221,22 @@ static type_t *reg_typedefs(decl_spec_t *decl_spec, declarator_list_t *decls, at return type; } -type_t *find_type(const char *name, int t) +static type_t *find_type_helper(const char *name, int t) { struct rtype *cur = type_hash[hash_ident(name)]; while (cur && (cur->t != t || strcmp(cur->name, name))) cur = cur->next; - if (!cur) { + return cur ? cur->type : NULL; +} + +type_t *find_type(const char *name, int t) +{ + type_t *type = find_type_helper(name, t); + if (!type) { error_loc("type '%s' not found\n", name); return NULL; } - return cur->type; + return type; } static type_t *find_type2(char *name, int t) @@ -5234,25 +5248,18 @@ static type_t *find_type2(char *name, int t) int is_type(const char *name) { - struct rtype *cur = type_hash[hash_ident(name)]; - while (cur && (cur->t || strcmp(cur->name, name))) - cur = cur->next; - if (cur) return TRUE; - return FALSE; + return find_type_helper(name, 0) != NULL; } static type_t *get_type(unsigned char type, char *name, int t) { - struct rtype *cur = NULL; type_t *tp; if (name) { - cur = type_hash[hash_ident(name)]; - while (cur && (cur->t != t || strcmp(cur->name, name))) - cur = cur->next; - } - if (cur) { - free(name); - return cur->type; + tp = find_type_helper(name, t); + if (tp) { + free(name); + return tp; + } } tp = make_type(type, NULL); tp->name = name; @@ -5929,7 +5936,7 @@ static void check_remoting_fields(const var_t *var, type_t *type) fields = type->fields_or_args; } - if (fields) LIST_FOR_EACH_ENTRY( field, type->fields_or_args, const var_t, entry ) + if (fields) LIST_FOR_EACH_ENTRY( field, fields, const var_t, entry ) if (field->type) check_field_common(type, type->name, field); }