Revert 37416 because it does not build on all machines.

svn path=/trunk/; revision=37446
This commit is contained in:
Eric Kohl 2008-11-18 18:51:13 +00:00
parent 50732235bd
commit 29ddbaa8c9
9 changed files with 1525 additions and 1626 deletions

View file

@ -26,7 +26,7 @@ reactos/tools/wpp # Synced to Wine-20081105 (~Wine-1.1.7)
reactos/tools/winebuild # Synced to Wine-20081105 (~Wine-1.1.7)
reactos/tools/wmc # Synced to Wine-20081105 (~Wine-1.1.7)
reactos/tools/wrc # Synced to Wine-20081105 (~Wine-1.1.7)
reactos/tools/widl # Synced to Wine-1_1_1
reactos/tools/widl # Synced to Wine-1_1_0
The following libraries are shared with Wine.

View file

@ -19,7 +19,7 @@
*/
%option stack
%option noinput nounput noyy_top_state
%option nounput noyy_top_state
%option 8bit never-interactive prefix="parser_"
nl \r?\n

File diff suppressed because it is too large Load diff

View file

@ -335,7 +335,7 @@
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#line 179 "parser.y"
#line 177 "parser.y"
typedef union YYSTYPE {
attr_t *attr;
attr_list_t *attr_list;

View file

@ -128,8 +128,7 @@ static type_t *append_ptrchain_type(type_t *ptrchain, type_t *type);
static type_t *reg_type(type_t *type, const char *name, int t);
static type_t *reg_typedefs(decl_spec_t *decl_spec, var_list_t *names, attr_list_t *attrs);
static type_t *find_type_or_error(const char *name, int t);
static type_t *find_type_or_error2(char *name, int t);
static type_t *find_type2(char *name, int t);
static type_t *get_type(unsigned char type, char *name, int t);
static type_t *get_typev(unsigned char type, var_t *name, int t);
static int get_struct_type(var_list_t *fields);
@ -157,7 +156,6 @@ static attr_list_t *check_module_attrs(const char *name, attr_list_t *attrs);
static attr_list_t *check_coclass_attrs(const char *name, attr_list_t *attrs);
const char *get_attr_display_name(enum attr_type type);
static void add_explicit_handle_if_necessary(func_t *func);
static void check_def(const type_t *t);
static statement_t *make_statement(enum statement_type type);
static statement_t *make_statement_type_decl(type_t *type);
@ -311,7 +309,7 @@ static func_list_t *append_func_from_statement(func_list_t *list, statement_t *s
%type <type> dispinterface dispinterfacehdr dispinterfacedef
%type <type> module modulehdr moduledef
%type <type> base_type int_std
%type <type> enumdef structdef uniondef typedecl
%type <type> enumdef structdef uniondef
%type <type> type
%type <ifref> coclass_int
%type <ifref_list> coclass_ints
@ -401,7 +399,7 @@ semicolon_opt:
statement:
cppquote { $$ = make_statement_cppquote($1); }
| typedecl ';' { $$ = make_statement_type_decl($1);
| enumdef ';' { $$ = make_statement_type_decl($1);
if (!parse_only && do_header) {
write_type_def_or_decl(header, $1, FALSE, NULL);
fprintf(header, ";\n\n");
@ -411,13 +409,19 @@ statement:
if (!parse_only && do_header) write_declaration($1, is_in_interface);
}
| import { $$ = make_statement_import($1); }
| structdef ';' { $$ = make_statement_type_decl($1);
if (!parse_only && do_header) {
write_type_def_or_decl(header, $1, FALSE, NULL);
fprintf(header, ";\n\n");
}
}
| typedef ';' { $$ = $1; }
;
typedecl:
enumdef
| structdef
| uniondef
| uniondef ';' { $$ = make_statement_type_decl($1);
if (!parse_only && do_header) {
write_type_def_or_decl(header, $1, FALSE, NULL);
fprintf(header, ";\n\n");
}
}
;
cppquote: tCPPQUOTE '(' aSTRING ')' { $$ = $3; if (!parse_only && do_header) fprintf(header, "%s\n", $3); }
@ -819,7 +823,7 @@ base_type: tBYTE { $$ = make_builtin($<str>1); }
}
| tUNSIGNED { $$ = make_int(-1); }
| tFLOAT { $$ = make_builtin($<str>1); }
| tSINGLE { $$ = find_type("float", 0); }
| tSINGLE { $$ = duptype(find_type("float", 0), 1); }
| tDOUBLE { $$ = make_builtin($<str>1); }
| tBOOLEAN { $$ = make_builtin($<str>1); }
| tERRORSTATUST { $$ = make_builtin($<str>1); }
@ -841,15 +845,12 @@ int_std: tINT { $$ = make_builtin($<str>1); }
coclass: tCOCLASS aIDENTIFIER { $$ = make_class($2); }
| tCOCLASS aKNOWNTYPE { $$ = find_type($2, 0);
if ($$->kind != TKIND_COCLASS)
error_loc("%s was not declared a coclass at %s:%d\n",
$2, $$->loc_info.input_name,
$$->loc_info.line_number);
if ($$->defined) error_loc("multiple definition error\n");
if ($$->kind != TKIND_COCLASS) error_loc("%s was not declared a coclass\n", $2);
}
;
coclasshdr: attributes coclass { $$ = $2;
check_def($$);
$$->attrs = check_coclass_attrs($2->name, $1);
if (!parse_only && do_header)
write_coclass($$);
@ -881,7 +882,7 @@ dispinterfacehdr: attributes dispinterface { attr_t *attrs;
is_in_interface = TRUE;
is_object_interface = TRUE;
$$ = $2;
check_def($$);
if ($$->defined) error_loc("multiple definition error\n");
attrs = make_attr(ATTR_DISPINTERFACE);
$$->attrs = append_attr( check_dispiface_attrs($2->name, $1), attrs );
$$->ref = find_type("IDispatch", 0);
@ -920,7 +921,7 @@ dispinterfacedef: dispinterfacehdr '{'
;
inherit: { $$ = NULL; }
| ':' aKNOWNTYPE { $$ = find_type_or_error2($2, 0); }
| ':' aKNOWNTYPE { $$ = find_type2($2, 0); }
;
interface: tINTERFACE aIDENTIFIER { $$ = get_type(RPC_FC_IP, $2, 0); $$->kind = TKIND_INTERFACE; }
@ -933,7 +934,7 @@ interfacehdr: attributes interface { $$.interface = $2;
pointer_default = get_attrv($1, ATTR_POINTERDEFAULT);
is_object_interface = is_object($1);
is_in_interface = TRUE;
check_def($2);
if ($2->defined) error_loc("multiple definition error\n");
$2->attrs = check_iface_attrs($2->name, $1);
$2->defined = TRUE;
if (!parse_only && do_header) write_forward($2);
@ -957,7 +958,7 @@ interfacedef: interfacehdr inherit
| interfacehdr ':' aIDENTIFIER
'{' import int_statements '}'
semicolon_opt { $$ = $1.interface;
$$->ref = find_type_or_error2($3, 0);
$$->ref = find_type2($3, 0);
if (!$$->ref) error_loc("base class '%s' not found in import\n", $3);
$$->funcs = $6;
compute_method_indexes($$);
@ -1059,7 +1060,6 @@ pointer_type:
structdef: tSTRUCT t_ident '{' fields '}' { $$ = get_typev(RPC_FC_STRUCT, $2, tsSTRUCT);
/* overwrite RPC_FC_STRUCT with a more exact type */
check_def($$);
$$->type = get_struct_type( $4 );
$$->kind = TKIND_RECORD;
$$->fields_or_args = $4;
@ -1069,15 +1069,15 @@ structdef: tSTRUCT t_ident '{' fields '}' { $$ = get_typev(RPC_FC_STRUCT, $2, ts
}
;
type: tVOID { $$ = find_type_or_error("void", 0); }
| aKNOWNTYPE { $$ = find_type_or_error($1, 0); }
type: tVOID { $$ = duptype(find_type("void", 0), 1); }
| aKNOWNTYPE { $$ = find_type($1, 0); }
| base_type { $$ = $1; }
| enumdef { $$ = $1; }
| tENUM aIDENTIFIER { $$ = find_type_or_error2($2, tsENUM); }
| tENUM aIDENTIFIER { $$ = find_type2($2, tsENUM); }
| structdef { $$ = $1; }
| tSTRUCT aIDENTIFIER { $$ = get_type(RPC_FC_STRUCT, $2, tsSTRUCT); }
| uniondef { $$ = $1; }
| tUNION aIDENTIFIER { $$ = find_type_or_error2($2, tsUNION); }
| tUNION aIDENTIFIER { $$ = find_type2($2, tsUNION); }
| tSAFEARRAY '(' type ')' { $$ = make_safearray($3); }
;
@ -1089,7 +1089,6 @@ typedef: tTYPEDEF m_attributes decl_spec declarator_list
uniondef: tUNION t_ident '{' ne_union_fields '}'
{ $$ = get_typev(RPC_FC_NON_ENCAPSULATED_UNION, $2, tsUNION);
check_def($$);
$$->kind = TKIND_UNION;
$$->fields_or_args = $4;
$$->defined = TRUE;
@ -1098,7 +1097,6 @@ uniondef: tUNION t_ident '{' ne_union_fields '}'
tSWITCH '(' s_field ')'
m_ident '{' cases '}' { var_t *u = $7;
$$ = get_typev(RPC_FC_ENCAPSULATED_UNION, $2, tsUNION);
check_def($$);
$$->kind = TKIND_UNION;
if (!u) u = make_var( xstrdup("tagged_union") );
u->type = make_type(RPC_FC_NON_ENCAPSULATED_UNION, NULL);
@ -1128,14 +1126,14 @@ static void decl_builtin(const char *name, unsigned char type)
static type_t *make_builtin(char *name)
{
/* NAME is strdup'd in the lexer */
type_t *t = duptype(find_type_or_error(name, 0), 0);
type_t *t = duptype(find_type(name, 0), 0);
t->name = name;
return t;
}
static type_t *make_int(int sign)
{
type_t *t = duptype(find_type_or_error("int", 0), 1);
type_t *t = duptype(find_type("int", 0), 1);
t->sign = sign;
if (sign < 0)
@ -1392,7 +1390,6 @@ type_t *make_type(unsigned char type, type_t *ref)
t->tfswrite = FALSE;
t->checked = FALSE;
t->typelib_idx = -1;
init_loc_info(&t->loc_info);
return t;
}
@ -1704,7 +1701,9 @@ static var_t *make_var(char *name)
v->attrs = NULL;
v->eval = NULL;
v->stgclass = STG_NONE;
init_loc_info(&v->loc_info);
v->loc_info.input_name = input_name ? input_name : "stdin";
v->loc_info.line_number = line_number;
v->loc_info.near_text = parser_text;
return v;
}
@ -1761,7 +1760,7 @@ static type_t *make_class(char *name)
static type_t *make_safearray(type_t *type)
{
type_t *sa = find_type_or_error("SAFEARRAY", 0);
type_t *sa = duptype(find_type("SAFEARRAY", 0), 1);
sa->ref = type;
return make_type(pointer_default, sa);
}
@ -1895,12 +1894,6 @@ static type_t *reg_typedefs(decl_spec_t *decl_spec, declarator_list_t *decls, at
if (name->name) {
type_t *cur;
cur = find_type(name->name, 0);
if (cur)
error_loc("%s: redefinition error; original definition was at %s:%d\n",
cur->name, cur->loc_info.input_name,
cur->loc_info.line_number);
/* set the attributes to allow set_type to do some checks on them */
name->attrs = attrs;
set_type(name, decl_spec, decl, 0);
@ -1915,7 +1908,7 @@ 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)))
@ -1923,9 +1916,9 @@ type_t *find_type(const char *name, int t)
return cur ? cur->type : NULL;
}
static type_t *find_type_or_error(const char *name, int t)
type_t *find_type(const char *name, int t)
{
type_t *type = find_type(name, t);
type_t *type = find_type_helper(name, t);
if (!type) {
error_loc("type '%s' not found\n", name);
return NULL;
@ -1933,23 +1926,23 @@ static type_t *find_type_or_error(const char *name, int t)
return type;
}
static type_t *find_type_or_error2(char *name, int t)
static type_t *find_type2(char *name, int t)
{
type_t *tp = find_type_or_error(name, t);
type_t *tp = find_type(name, t);
free(name);
return tp;
}
int is_type(const char *name)
{
return find_type(name, 0) != NULL;
return find_type_helper(name, 0) != NULL;
}
static type_t *get_type(unsigned char type, char *name, int t)
{
type_t *tp;
if (name) {
tp = find_type(name, t);
tp = find_type_helper(name, t);
if (tp) {
free(name);
return tp;
@ -2618,12 +2611,7 @@ static void check_remoting_fields(const var_t *var, type_t *type)
type->checked = TRUE;
if (is_struct(type->type))
{
if (type->defined)
fields = type->fields_or_args;
else
error_loc_info(&var->loc_info, "undefined type declaration %s\n", type->name);
}
fields = type->fields_or_args;
else if (is_union(type->type))
{
if (type->type == RPC_FC_ENCAPSULATED_UNION)
@ -2705,7 +2693,7 @@ static void add_explicit_handle_if_necessary(func_t *func)
* function */
var_t *idl_handle = make_var(xstrdup("IDL_handle"));
idl_handle->attrs = append_attr(NULL, make_attr(ATTR_IN));
idl_handle->type = find_type_or_error("handle_t", 0);
idl_handle->type = find_type("handle_t", 0);
if (!func->def->type->fields_or_args)
{
func->def->type->fields_or_args = xmalloc( sizeof(*func->def->type->fields_or_args) );
@ -2860,7 +2848,7 @@ static statement_t *process_typedefs(declarator_list_t *decls)
LIST_FOR_EACH_ENTRY_SAFE( decl, next, decls, declarator_t, entry )
{
var_t *var = decl->var;
type_t *type = find_type_or_error(var->name, 0);
type_t *type = find_type(var->name, 0);
*type_list = xmalloc(sizeof(type_list_t));
(*type_list)->type = type;
(*type_list)->next = NULL;
@ -2903,17 +2891,3 @@ static func_list_t *append_func_from_statement(func_list_t *list, statement_t *s
}
return list;
}
void init_loc_info(loc_info_t *i)
{
i->input_name = input_name ? input_name : "stdin";
i->line_number = line_number;
i->near_text = parser_text;
}
static void check_def(const type_t *t)
{
if (t->defined)
error_loc("%s: redefinition error; original definition was at %s:%d\n",
t->name, t->loc_info.input_name, t->loc_info.line_number);
}

View file

@ -565,7 +565,6 @@ char *yytext;
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define YY_STACK_USED 1
#define YY_NO_INPUT 1
#define YY_NO_UNPUT 1
#define YY_NO_TOP_STATE 1
#define YY_NEVER_INTERACTIVE 1
@ -646,7 +645,7 @@ UUID *parse_uuid(const char *u)
* The flexer starts here
**************************************************************************
*/
#line 650 "parser.yy.c"
#line 649 "parser.yy.c"
/* Macros after this point can all be overridden by user definitions in
* section 1.
@ -802,7 +801,7 @@ YY_DECL
#line 112 "parser.l"
#line 806 "parser.yy.c"
#line 805 "parser.yy.c"
if ( yy_init )
{
@ -1096,7 +1095,7 @@ YY_RULE_SETUP
#line 187 "parser.l"
ECHO;
YY_BREAK
#line 1100 "parser.yy.c"
#line 1099 "parser.yy.c"
case YY_END_OF_BUFFER:
{

View file

@ -984,7 +984,7 @@ static void write_user_tfs(FILE *file, type_t *type, unsigned int *tfsoff)
{
unsigned int start, absoff, flags;
unsigned int align = 0, ualign = 0;
const char *name = NULL;
const char *name;
type_t *utype = get_user_type(type, &name);
size_t usize = user_type_has_variable_size(utype) ? 0 : type_memsize(utype, &ualign);
size_t size = type_memsize(type, &align);
@ -1437,14 +1437,6 @@ static int write_varying_array_pointer_descriptions(
if (offset_in_memory && offset_in_buffer)
{
size_t padding;
if (is_array(v->type) && v->type->length_is)
{
*offset_in_buffer = ROUND_SIZE(*offset_in_buffer, 4);
/* skip over variance and offset in buffer */
*offset_in_buffer += 8;
}
align = 0;
type_memsize(v->type, &align);
padding = ROUNDING(*offset_in_memory, align);
@ -1478,13 +1470,19 @@ static void write_pointer_description(FILE *file, type_t *type,
{
size_t offset_in_buffer;
size_t offset_in_memory;
size_t conformance = 0;
if (type->type == RPC_FC_CVSTRUCT)
conformance = 8;
else if (type->type == RPC_FC_CSTRUCT || type->type == RPC_FC_CPSTRUCT)
conformance = 4;
/* pass 1: search for single instance of a pointer (i.e. don't descend
* into arrays) */
if (!is_array(type))
{
offset_in_memory = 0;
offset_in_buffer = 0;
offset_in_buffer = conformance;
write_no_repeat_pointer_descriptions(
file, type,
&offset_in_memory, &offset_in_buffer, typestring_offset);
@ -1492,7 +1490,7 @@ static void write_pointer_description(FILE *file, type_t *type,
/* pass 2: search for pointers in fixed arrays */
offset_in_memory = 0;
offset_in_buffer = 0;
offset_in_buffer = conformance;
write_fixed_array_pointer_descriptions(
file, NULL, type,
&offset_in_memory, &offset_in_buffer, typestring_offset);
@ -1514,7 +1512,7 @@ static void write_pointer_description(FILE *file, type_t *type,
/* pass 4: search for pointers in varying arrays */
offset_in_memory = 0;
offset_in_buffer = 0;
offset_in_buffer = conformance;
write_varying_array_pointer_descriptions(
file, NULL, type,
&offset_in_memory, &offset_in_buffer, typestring_offset);
@ -2034,34 +2032,6 @@ static size_t write_union_tfs(FILE *file, type_t *type, unsigned int *tfsoff)
error("union switch type must be an integer, char, or enum\n");
}
}
else if (is_attr(type->attrs, ATTR_SWITCHTYPE))
{
static const expr_t dummy_expr; /* FIXME */
const type_t *st = get_attrp(type->attrs, ATTR_SWITCHTYPE);
switch (st->type)
{
case RPC_FC_CHAR:
case RPC_FC_SMALL:
case RPC_FC_USMALL:
case RPC_FC_SHORT:
case RPC_FC_USHORT:
case RPC_FC_LONG:
case RPC_FC_ULONG:
case RPC_FC_ENUM16:
case RPC_FC_ENUM32:
print_file(file, 2, "0x%x,\t/* %s */\n", type->type, string_of_type(type->type));
print_file(file, 2, "0x%x,\t/* Switch type= %s */\n",
st->type, string_of_type(st->type));
*tfsoff += 2;
break;
default:
error("union switch type must be an integer, char, or enum\n");
}
*tfsoff += write_conf_or_var_desc(file, NULL, *tfsoff, st, &dummy_expr );
}
print_file(file, 2, "NdrFcShort(0x%x),\t/* %d */\n", size, size);
print_file(file, 2, "NdrFcShort(0x%x),\t/* %d */\n", nbranch, nbranch);
*tfsoff += 4;
@ -2457,12 +2427,11 @@ void write_typeformatstring(FILE *file, const statement_list_t *stmts, type_pred
static unsigned int get_required_buffer_size_type(
const type_t *type, const char *name, unsigned int *alignment)
{
const char *uname;
const type_t *utype;
*alignment = 0;
if ((utype = get_user_type(type, &uname)))
if (is_user_type(type))
{
const char *uname;
const type_t *utype = get_user_type(type, &uname);
return get_required_buffer_size_type(utype, uname, alignment);
}
else
@ -2771,7 +2740,7 @@ void print_phase_basetype(FILE *file, int indent, enum remoting_phase phase,
/* returns whether the MaxCount, Offset or ActualCount members need to be
* filled in for the specified phase */
static inline int is_conformance_needed_for_phase(enum remoting_phase phase)
static inline int is_size_needed_for_phase(enum remoting_phase phase)
{
return (phase != PHASE_UNMARSHAL);
}
@ -2794,67 +2763,6 @@ expr_t *get_size_is_expr(const type_t *t, const char *name)
return x;
}
static void write_parameter_conf_or_var_exprs(FILE *file, int indent,
enum remoting_phase phase,
const var_t *var)
{
const type_t *type = var->type;
/* get fundamental type for the argument */
for (;;)
{
if (is_attr(type->attrs, ATTR_WIREMARSHAL))
break;
else if (is_attr(type->attrs, ATTR_CONTEXTHANDLE))
break;
else if (is_array(type) || is_string_type(var->attrs, type))
{
if (is_conformance_needed_for_phase(phase))
{
if (type->size_is)
{
print_file(file, indent, "_StubMsg.MaxCount = (unsigned long)");
write_expr(file, type->size_is, 1, 1, NULL, NULL);
fprintf(file, ";\n\n");
}
if (type->length_is)
{
print_file(file, indent, "_StubMsg.Offset = (unsigned long)0;\n"); /* FIXME */
print_file(file, indent, "_StubMsg.ActualCount = (unsigned long)");
write_expr(file, type->length_is, 1, 1, NULL, NULL);
fprintf(file, ";\n\n");
}
}
break;
}
else if (type->type == RPC_FC_NON_ENCAPSULATED_UNION)
{
if (is_conformance_needed_for_phase(phase))
{
print_file(file, indent, "_StubMsg.MaxCount = (unsigned long)");
write_expr(file, get_attrp(var->attrs, ATTR_SWITCHIS), 1, 1, NULL, NULL);
fprintf(file, ";\n\n");
}
break;
}
else if (type->type == RPC_FC_IP)
{
expr_t *iid;
if (is_conformance_needed_for_phase(phase) && (iid = get_attrp( var->attrs, ATTR_IIDIS )))
{
print_file( file, indent, "_StubMsg.MaxCount = (unsigned long) " );
write_expr( file, iid, 1, 1, NULL, NULL );
fprintf( file, ";\n\n" );
}
break;
}
else if (is_ptr(type))
type = type->ref;
else
break;
}
}
static void write_remoting_arg(FILE *file, int indent, const func_t *func,
enum pass pass, enum remoting_phase phase,
const var_t *var)
@ -2886,7 +2794,6 @@ static void write_remoting_arg(FILE *file, int indent, const func_t *func,
break;
}
write_parameter_conf_or_var_exprs(file, indent, phase, var);
rtype = type->type;
if (is_context_handle(type))
@ -2942,6 +2849,13 @@ static void write_remoting_arg(FILE *file, int indent, const func_t *func,
print_phase_function(file, indent, "NonConformantString", phase, var, start_offset);
else
{
if (type->size_is && is_size_needed_for_phase(phase))
{
print_file(file, indent, "_StubMsg.MaxCount = (unsigned long)");
write_expr(file, type->size_is, 1, 1, NULL, NULL);
fprintf(file, ";\n");
}
if (phase == PHASE_FREE || pass == PASS_RETURN || pointer_type == RPC_FC_UP)
print_phase_function(file, indent, "Pointer", phase, var,
start_offset - (type->size_is ? 4 : 2));
@ -2964,14 +2878,43 @@ static void write_remoting_arg(FILE *file, int indent, const func_t *func,
if (tc == RPC_FC_SMVARRAY || tc == RPC_FC_LGVARRAY)
{
if (is_size_needed_for_phase(phase))
{
print_file(file, indent, "_StubMsg.Offset = (unsigned long)0;\n"); /* FIXME */
print_file(file, indent, "_StubMsg.ActualCount = (unsigned long)");
write_expr(file, type->length_is, 1, 1, NULL, NULL);
fprintf(file, ";\n\n");
}
array_type = "VaryingArray";
}
else if (tc == RPC_FC_CARRAY)
{
if (is_size_needed_for_phase(phase))
{
print_file(file, indent, "_StubMsg.MaxCount = (unsigned long)");
write_expr(file, type->size_is, 1, 1, NULL, NULL);
fprintf(file, ";\n\n");
}
array_type = "ConformantArray";
}
else if (tc == RPC_FC_CVARRAY || tc == RPC_FC_BOGUS_ARRAY)
{
if (is_size_needed_for_phase(phase))
{
if (type->size_is)
{
print_file(file, indent, "_StubMsg.MaxCount = (unsigned long)");
write_expr(file, type->size_is, 1, 1, NULL, NULL);
fprintf(file, ";\n");
}
if (type->length_is)
{
print_file(file, indent, "_StubMsg.Offset = (unsigned long)0;\n"); /* FIXME */
print_file(file, indent, "_StubMsg.ActualCount = (unsigned long)");
write_expr(file, type->length_is, 1, 1, NULL, NULL);
fprintf(file, ";\n\n");
}
}
array_type = (tc == RPC_FC_BOGUS_ARRAY
? "ComplexArray"
: "ConformantVaryingArray");
@ -3056,6 +2999,21 @@ static void write_remoting_arg(FILE *file, int indent, const func_t *func,
}
else
{
expr_t *iid;
expr_t *sx = get_size_is_expr(type, var->name);
if ((iid = get_attrp( var->attrs, ATTR_IIDIS )))
{
print_file( file, indent, "_StubMsg.MaxCount = (unsigned long) " );
write_expr( file, iid, 1, 1, NULL, NULL );
fprintf( file, ";\n\n" );
}
else if (sx)
{
print_file(file, indent, "_StubMsg.MaxCount = (unsigned long) ");
write_expr(file, sx, 1, 1, NULL, NULL);
fprintf(file, ";\n\n");
}
if (var->type->ref->type == RPC_FC_IP)
print_phase_function(file, indent, "InterfacePointer", phase, var, start_offset);
else
@ -3133,7 +3091,7 @@ size_t get_size_procformatstring(const statement_list_t *stmts, type_pred_t pred
size += get_size_procformatstring(stmt->u.lib->stmts, pred) - 1;
continue;
}
else if (stmt->type != STMT_TYPE || stmt->u.type->type != RPC_FC_IP)
else if (stmt->type != STMT_TYPE && stmt->u.type->type != RPC_FC_IP)
continue;
iface = stmt->u.type;

View file

@ -69,7 +69,6 @@ type_t *alias(type_t *t, const char *name)
a->kind = TKIND_ALIAS;
a->attrs = NULL;
a->declarray = FALSE;
init_loc_info(&a->loc_info);
return a;
}

View file

@ -283,7 +283,6 @@ struct _type_t {
unsigned int typestring_offset;
unsigned int ptrdesc; /* used for complex structs */
int typelib_idx;
loc_info_t loc_info;
unsigned int declarray : 1; /* if declared as an array */
unsigned int ignore : 1;
unsigned int defined : 1;
@ -420,8 +419,6 @@ var_t *find_const(const char *name, int f);
type_t *find_type(const char *name, int t);
type_t *make_type(unsigned char type, type_t *ref);
void init_loc_info(loc_info_t *);
static inline type_t *get_func_return_type(const func_t *func)
{
return func->def->type->ref;