}
else if (is_ptr(t) || is_conformant_array(t))
{
- size = sizeof(void *);
+#if defined(TARGET_i386)
+ size = 4;
+#elif defined(TARGET_amd64)
+ size = 8;
+#else
+#error Unsupported CPU
+#endif
if (size > *align) *align = size;
}
else switch (t->type)
{
unsigned int start, absoff, flags;
unsigned int align = 0, ualign = 0;
- const char *name;
+ const char *name = NULL;
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);
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 (is_user_type(type))
+ if ((utype = get_user_type(type, &uname)))
{
- const char *uname;
- const type_t *utype = get_user_type(type, &uname);
return get_required_buffer_size_type(utype, uname, alignment);
}
else
}
if (phase == PHASE_MARSHAL)
- print_file(file, indent, "MIDL_memset(_StubMsg.Buffer, 0, (0x%x - (long)_StubMsg.Buffer) & 0x%x);\n", alignment, alignment - 1);
- print_file(file, indent, "_StubMsg.Buffer = (unsigned char *)(((long)_StubMsg.Buffer + %u) & ~0x%x);\n",
+ print_file(file, indent, "MIDL_memset(_StubMsg.Buffer, 0, (0x%x - (size_t)_StubMsg.Buffer) & 0x%x);\n", alignment, alignment - 1);
+ print_file(file, indent, "_StubMsg.Buffer = (unsigned char *)(((size_t)_StubMsg.Buffer + %u) & ~0x%x);\n",
alignment - 1, alignment - 1);
if (phase == PHASE_MARSHAL)
write_type_decl_left(file, var->type);
fprintf(file, " ");
if (var->type->declarray) {
- fprintf(file, "( *");
- write_name(file, var);
- fprintf(file, " )");
+ fprintf(file, "(*%s)", get_name(var));
} else
- write_name(file, var);
+ fprintf(file, "%s", get_name(var));
write_type_right(file, var->type, FALSE);
fprintf(file, ";\n");
if (!in_attr)
{
- print_file(file, indent, "");
- write_name(file, var);
+ print_file(file, indent, "%s", get_name(var));
if (is_context_handle(var->type))
{