Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
July 2019
- 65 participants
- 633 messages
[PATCH 03/15] widl: refactor to have pointer type's ref use decl_spec_t rather than type_t
by Richard Pospesel
Signed-off-by: Richard Pospesel <richard(a)torproject.org>
---
tools/widl/expr.c | 2 +-
tools/widl/header.c | 20 +++++++--------
tools/widl/header.h | 4 +--
tools/widl/parser.y | 28 ++++++++++-----------
tools/widl/proxy.c | 4 +--
tools/widl/typegen.c | 54 ++++++++++++++++++++---------------------
tools/widl/typelib.c | 2 +-
tools/widl/typetree.c | 2 +-
tools/widl/typetree.h | 9 +++++--
tools/widl/widltypes.h | 3 +--
tools/widl/write_msft.c | 10 ++++----
11 files changed, 71 insertions(+), 67 deletions(-)
diff --git a/tools/widl/expr.c b/tools/widl/expr.c
index 55efc694dd..85ba4639e1 100644
--- a/tools/widl/expr.c
+++ b/tools/widl/expr.c
@@ -580,7 +580,7 @@ static struct expression_type resolve_expression(const struct expr_loc *expr_loc
case EXPR_PPTR:
result = resolve_expression(expr_loc, cont_type, e->ref);
if (result.type && is_ptr(result.type))
- result.type = type_pointer_get_ref(result.type);
+ result.type = type_pointer_get_ref_type(result.type);
else if(result.type && is_array(result.type)
&& type_array_is_decl_as_ptr(result.type))
result.type = type_array_get_element_type(result.type);
diff --git a/tools/widl/header.c b/tools/widl/header.c
index c10b149d89..8c07564751 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -77,7 +77,7 @@ int is_ptrchain_attr(const var_t *var, enum attr_type t)
else if (type_is_alias(type))
type = type_alias_get_aliasee(type);
else if (is_ptr(type))
- type = type_pointer_get_ref(type);
+ type = type_pointer_get_ref_type(type);
else return 0;
}
}
@@ -351,8 +351,8 @@ void write_type_left(FILE *h, type_t *t, enum name_type name_type, int declonly)
break;
case TYPE_POINTER:
{
- write_type_left(h, type_pointer_get_ref(t), name_type, declonly);
- write_pointer_left(h, type_pointer_get_ref(t));
+ write_type_left(h, type_pointer_get_ref_type(t), name_type, declonly);
+ write_pointer_left(h, type_pointer_get_ref_type(t));
if (is_attr(t->attrs, ATTR_CONST)) fprintf(h, "const ");
break;
}
@@ -461,7 +461,7 @@ void write_type_right(FILE *h, type_t *t, int is_field)
}
case TYPE_POINTER:
{
- type_t *ref = type_pointer_get_ref(t);
+ type_t *ref = type_pointer_get_ref_type(t);
if (!type_is_alias(ref) && is_array(ref) && !type_array_is_decl_as_ptr(ref))
fprintf(h, ")");
write_type_right(h, ref, FALSE);
@@ -493,7 +493,7 @@ static void write_type_v(FILE *h, type_t *t, int is_field, int declonly, const c
if (!h) return;
if (t) {
- for (pt = t; is_ptr(pt); pt = type_pointer_get_ref(pt), ptr_level++)
+ for (pt = t; is_ptr(pt); pt = type_pointer_get_ref_type(pt), ptr_level++)
;
if (type_get_type_detect_alias(pt) == TYPE_FUNCTION) {
@@ -603,7 +603,7 @@ unsigned int get_context_handle_offset( const type_t *type )
while (!is_attr( type->attrs, ATTR_CONTEXTHANDLE ))
{
if (type_is_alias( type )) type = type_alias_get_aliasee( type );
- else if (is_ptr( type )) type = type_pointer_get_ref( type );
+ else if (is_ptr( type )) type = type_pointer_get_ref_type( type );
else error( "internal error: %s is not a context handle\n", type->name );
}
LIST_FOR_EACH_ENTRY( ch, &context_handle_list, context_handle_t, entry )
@@ -623,7 +623,7 @@ unsigned int get_generic_handle_offset( const type_t *type )
while (!is_attr( type->attrs, ATTR_HANDLE ))
{
if (type_is_alias( type )) type = type_alias_get_aliasee( type );
- else if (is_ptr( type )) type = type_pointer_get_ref( type );
+ else if (is_ptr( type )) type = type_pointer_get_ref_type( type );
else error( "internal error: %s is not a generic handle\n", type->name );
}
LIST_FOR_EACH_ENTRY( gh, &generic_handle_list, generic_handle_t, entry )
@@ -703,7 +703,7 @@ void check_for_additional_prototype_types(type_t *type)
if (type_is_alias(type))
type = type_alias_get_aliasee(type);
else if (is_ptr(type))
- type = type_pointer_get_ref(type);
+ type = type_pointer_get_ref_type(type);
else if (is_array(type))
type = type_array_get_element_type(type);
else
@@ -805,7 +805,7 @@ int is_const_decl(const var_t *var)
if (is_attr(t->attrs, ATTR_CONST))
return TRUE;
else if (is_ptr(t))
- t = type_pointer_get_ref(t);
+ t = type_pointer_get_ref_type(t);
else break;
}
return FALSE;
@@ -852,7 +852,7 @@ const type_t* get_explicit_generic_handle_type(const var_t* var)
const type_t *t;
for (t = var->declspec.type;
is_ptr(t) || type_is_alias(t);
- t = type_is_alias(t) ? type_alias_get_aliasee(t) : type_pointer_get_ref(t))
+ t = type_is_alias(t) ? type_alias_get_aliasee(t) : type_pointer_get_ref_type(t))
if ((type_get_type_detect_alias(t) != TYPE_BASIC || type_basic_get_type(t) != TYPE_BASIC_HANDLE) &&
is_attr(t->attrs, ATTR_HANDLE))
return t;
diff --git a/tools/widl/header.h b/tools/widl/header.h
index e4aa0f0088..eb98125b25 100644
--- a/tools/widl/header.h
+++ b/tools/widl/header.h
@@ -83,7 +83,7 @@ static inline int is_conformant_array(const type_t *t)
static inline int last_ptr(const type_t *type)
{
- return is_ptr(type) && !is_declptr(type_pointer_get_ref(type));
+ return is_ptr(type) && !is_declptr(type_pointer_get_ref_type(type));
}
static inline int last_array(const type_t *type)
@@ -102,7 +102,7 @@ static inline int is_context_handle(const type_t *type)
const type_t *t;
for (t = type;
is_ptr(t) || type_is_alias(t);
- t = type_is_alias(t) ? type_alias_get_aliasee(t) : type_pointer_get_ref(t))
+ t = type_is_alias(t) ? type_alias_get_aliasee(t) : type_pointer_get_ref_type(t))
if (is_attr(t->attrs, ATTR_CONTEXTHANDLE))
return 1;
return 0;
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 6075d231f6..ff867655fa 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -1467,7 +1467,7 @@ static int is_allowed_range_type(const type_t *type)
static type_t *get_array_or_ptr_ref(type_t *type)
{
if (is_ptr(type))
- return type_pointer_get_ref(type);
+ return type_pointer_get_ref_type(type);
else if (is_array(type))
return type_array_get_element_type(type);
return NULL;
@@ -1483,7 +1483,7 @@ static type_t *append_chain_type(type_t *chain, type_t *type)
;
if (is_ptr(chain_type))
- chain_type->details.pointer.ref = type;
+ chain_type->details.pointer.ref.type = type;
else if (is_array(chain_type))
chain_type->details.array.elem.type = type;
else
@@ -1526,7 +1526,7 @@ static var_t *declare_var(attr_list_t *attrs, decl_spec_t *decl_spec, const decl
{
type_t *t;
/* move inline attribute from return type node to function node */
- for (t = func_type; is_ptr(t); t = type_pointer_get_ref(t))
+ for (t = func_type; is_ptr(t); t = type_pointer_get_ref_type(t))
;
t->attrs = move_attr(t->attrs, type->attrs, ATTR_INLINE);
}
@@ -1557,7 +1557,7 @@ static var_t *declare_var(attr_list_t *attrs, decl_spec_t *decl_spec, const decl
if (is_ptr(ptr))
{
if (ptr_attr && ptr_attr != FC_UP &&
- type_get_type(type_pointer_get_ref(ptr)) == TYPE_INTERFACE)
+ type_get_type(type_pointer_get_ref_type(ptr)) == TYPE_INTERFACE)
warning_loc_info(&v->loc_info,
"%s: pointer attribute applied to interface "
"pointer type has no effect\n", v->name);
@@ -1585,7 +1585,7 @@ static var_t *declare_var(attr_list_t *attrs, decl_spec_t *decl_spec, const decl
for (;;)
{
if (is_ptr(t))
- t = type_pointer_get_ref(t);
+ t = type_pointer_get_ref_type(t);
else if (is_array(t))
t = type_array_get_element_type(t);
else
@@ -1628,14 +1628,14 @@ static var_t *declare_var(attr_list_t *attrs, decl_spec_t *decl_spec, const decl
0, dim, NULL, FC_RP);
}
else if (is_ptr(*ptype))
- *ptype = type_new_array((*ptype)->name, type_pointer_get_ref(*ptype), TRUE,
+ *ptype = type_new_array((*ptype)->name, type_pointer_get_ref_type(*ptype), TRUE,
0, dim, NULL, pointer_default);
else
error_loc("%s: size_is attribute applied to illegal type\n", v->name);
}
if (is_ptr(*ptype))
- ptype = &(*ptype)->details.pointer.ref;
+ ptype = &(*ptype)->details.pointer.ref.type;
else if (is_array(*ptype))
ptype = &(*ptype)->details.array.elem.type;
else
@@ -1661,7 +1661,7 @@ static var_t *declare_var(attr_list_t *attrs, decl_spec_t *decl_spec, const decl
}
if (is_ptr(*ptype))
- ptype = &(*ptype)->details.pointer.ref;
+ ptype = &(*ptype)->details.pointer.ref.type;
else if (is_array(*ptype))
ptype = &(*ptype)->details.array.elem.type;
else
@@ -1676,20 +1676,20 @@ static var_t *declare_var(attr_list_t *attrs, decl_spec_t *decl_spec, const decl
type_t *ft, *t;
type_t *return_type = v->declspec.type;
v->declspec.type = func_type;
- for (ft = v->declspec.type; is_ptr(ft); ft = type_pointer_get_ref(ft))
+ for (ft = v->declspec.type; is_ptr(ft); ft = type_pointer_get_ref_type(ft))
;
assert(type_get_type_detect_alias(ft) == TYPE_FUNCTION);
ft->details.function->retval = make_var(xstrdup("_RetVal"));
ft->details.function->retval->declspec.type = return_type;
/* move calling convention attribute, if present, from pointer nodes to
* function node */
- for (t = v->declspec.type; is_ptr(t); t = type_pointer_get_ref(t))
+ for (t = v->declspec.type; is_ptr(t); t = type_pointer_get_ref_type(t))
ft->attrs = move_attr(ft->attrs, t->attrs, ATTR_CALLCONV);
}
else
{
type_t *t;
- for (t = v->declspec.type; is_ptr(t); t = type_pointer_get_ref(t))
+ for (t = v->declspec.type; is_ptr(t); t = type_pointer_get_ref_type(t))
if (is_attr(t->attrs, ATTR_CALLCONV))
error_loc("calling convention applied to non-function-pointer type\n");
}
@@ -2484,7 +2484,7 @@ static int is_ptr_guid_type(const type_t *type)
/* second, make sure it is a pointer to something of size sizeof(GUID),
* i.e. 16 bytes */
- return (type_memsize(type_pointer_get_ref(type)) == 16);
+ return (type_memsize(type_pointer_get_ref_type(type)) == 16);
}
static void check_conformance_expr_list(const char *attr_name, const var_t *arg, const type_t *container_type, expr_list_t *expr_list)
@@ -2638,13 +2638,13 @@ static void check_field_common(const type_t *container_type,
{
const type_t *t = type;
while (is_ptr(t))
- t = type_pointer_get_ref(t);
+ t = type_pointer_get_ref_type(t);
if (is_aliaschain_attr(t, ATTR_RANGE))
warning_loc_info(&arg->loc_info, "%s: range not verified for a string of ranged types\n", arg->name);
break;
}
case TGT_POINTER:
- type = type_pointer_get_ref(type);
+ type = type_pointer_get_ref_type(type);
more_to_do = TRUE;
break;
case TGT_ARRAY:
diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c
index 0b37cc9758..8f65e8aa7b 100644
--- a/tools/widl/proxy.c
+++ b/tools/widl/proxy.c
@@ -107,8 +107,8 @@ static void clear_output_vars( const var_list_t *args )
if (!is_attr(arg->attrs, ATTR_OUT)) continue;
if (is_ptr(arg->declspec.type))
{
- if (type_get_type(type_pointer_get_ref(arg->declspec.type)) == TYPE_BASIC) continue;
- if (type_get_type(type_pointer_get_ref(arg->declspec.type)) == TYPE_ENUM) continue;
+ if (type_get_type(type_pointer_get_ref_type(arg->declspec.type)) == TYPE_BASIC) continue;
+ if (type_get_type(type_pointer_get_ref_type(arg->declspec.type)) == TYPE_ENUM) continue;
}
print_proxy( "if (%s) MIDL_memset( %s, 0, ", arg->name, arg->name );
if (is_array(arg->declspec.type) && type_array_has_conformance(arg->declspec.type))
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index 19255ec850..f901f83d1e 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -351,10 +351,10 @@ enum typegen_type typegen_detect_type(const type_t *type, const attr_list_t *att
return TGT_RANGE;
return TGT_ENUM;
case TYPE_POINTER:
- if (type_get_type(type_pointer_get_ref(type)) == TYPE_INTERFACE ||
- (type_get_type(type_pointer_get_ref(type)) == TYPE_VOID && is_attr(attrs, ATTR_IIDIS)))
+ if (type_get_type(type_pointer_get_ref_type(type)) == TYPE_INTERFACE ||
+ (type_get_type(type_pointer_get_ref_type(type)) == TYPE_VOID && is_attr(attrs, ATTR_IIDIS)))
return TGT_IFACE_POINTER;
- else if (is_aliaschain_attr(type_pointer_get_ref(type), ATTR_CONTEXTHANDLE))
+ else if (is_aliaschain_attr(type_pointer_get_ref_type(type), ATTR_CONTEXTHANDLE))
return TGT_CTXT_HANDLE_POINTER;
else
return TGT_POINTER;
@@ -857,7 +857,7 @@ static const char *get_context_handle_type_name(const type_t *type)
const type_t *t;
for (t = type;
is_ptr(t) || type_is_alias(t);
- t = type_is_alias(t) ? type_alias_get_aliasee(t) : type_pointer_get_ref(t))
+ t = type_is_alias(t) ? type_alias_get_aliasee(t) : type_pointer_get_ref_type(t))
if (is_attr(t->attrs, ATTR_CONTEXTHANDLE))
return t->name;
assert(0);
@@ -1038,7 +1038,7 @@ static unsigned char get_parameter_fc( const var_t *var, int is_return, unsigned
case TGT_POINTER:
if (get_pointer_fc( var->declspec.type, var->attrs, !is_return ) == FC_RP)
{
- const type_t *ref = type_pointer_get_ref( var->declspec.type );
+ const type_t *ref = type_pointer_get_ref_type( var->declspec.type );
if (!is_string_type( var->attrs, ref ))
buffer_size = get_required_buffer_size_type( ref, NULL, NULL, TRUE, &alignment );
@@ -2127,7 +2127,7 @@ static unsigned int write_nonsimple_pointer(FILE *file, const attr_list_t *attrs
{
if (context == TYPE_CONTEXT_TOPLEVELPARAM && is_ptr(type) && pointer_type == FC_RP)
{
- switch (typegen_detect_type(type_pointer_get_ref(type), NULL, TDT_ALL_TYPES))
+ switch (typegen_detect_type(type_pointer_get_ref_type(type), NULL, TDT_ALL_TYPES))
{
case TGT_STRING:
case TGT_POINTER:
@@ -2148,7 +2148,7 @@ static unsigned int write_nonsimple_pointer(FILE *file, const attr_list_t *attrs
if (is_ptr(type))
{
- type_t *ref = type_pointer_get_ref(type);
+ type_t *ref = type_pointer_get_ref_type(type);
if(is_declptr(ref) && !is_user_type(ref))
flags |= FC_POINTER_DEREF;
}
@@ -2189,7 +2189,7 @@ static unsigned int write_simple_pointer(FILE *file, const attr_list_t *attrs,
pointer_fc = get_pointer_fc_context(type, attrs, context);
- ref = type_pointer_get_ref(type);
+ ref = type_pointer_get_ref_type(type);
if (type_get_type(ref) == TYPE_ENUM)
fc = get_enum_fc(ref);
else
@@ -2227,7 +2227,7 @@ static unsigned int write_pointer_tfs(FILE *file, const attr_list_t *attrs,
unsigned int *typestring_offset)
{
unsigned int offset = *typestring_offset;
- type_t *ref = type_pointer_get_ref(type);
+ type_t *ref = type_pointer_get_ref_type(type);
print_start_tfs_comment(file, type, offset);
update_tfsoff(type, offset, file);
@@ -2382,7 +2382,7 @@ static void write_array_element_type(FILE *file, const attr_list_t *attrs, const
if (!is_embedded_complex(elem) && is_ptr(elem))
{
- type_t *ref = type_pointer_get_ref(elem);
+ type_t *ref = type_pointer_get_ref_type(elem);
if (processed(ref))
{
@@ -2453,7 +2453,7 @@ static int write_pointer_description_offsets(
{
int written = 0;
- if ((is_ptr(type) && type_get_type(type_pointer_get_ref(type)) != TYPE_INTERFACE) ||
+ if ((is_ptr(type) && type_get_type(type_pointer_get_ref_type(type)) != TYPE_INTERFACE) ||
(is_array(type) && type_array_is_decl_as_ptr(type)))
{
if (offset_in_memory && offset_in_buffer)
@@ -2478,7 +2478,7 @@ static int write_pointer_description_offsets(
if (is_ptr(type))
{
- type_t *ref = type_pointer_get_ref(type);
+ type_t *ref = type_pointer_get_ref_type(type);
if (is_string_type(attrs, type))
write_string_tfs(file, attrs, type, TYPE_CONTEXT_CONTAINER, NULL, typestring_offset);
@@ -2866,7 +2866,7 @@ static unsigned int write_string_tfs(FILE *file, const attr_list_t *attrs,
if (is_array(type))
elem_type = type_array_get_element_type(type);
else
- elem_type = type_pointer_get_ref(type);
+ elem_type = type_pointer_get_ref_type(type);
if (type_get_type(elem_type) == TYPE_POINTER && is_array(type))
return write_array_tfs(file, attrs, type, name, typestring_offset);
@@ -3231,7 +3231,7 @@ static unsigned int write_struct_tfs(FILE *file, type_t *type,
write_string_tfs(file, f->attrs, ft, TYPE_CONTEXT_CONTAINER, f->name, tfsoff);
else
write_pointer_tfs(file, f->attrs, ft,
- type_pointer_get_ref(ft)->typestring_offset,
+ type_pointer_get_ref_type(ft)->typestring_offset,
TYPE_CONTEXT_CONTAINER, tfsoff);
break;
case TGT_ARRAY:
@@ -3479,7 +3479,7 @@ static unsigned int write_ip_tfs(FILE *file, const attr_list_t *attrs, type_t *t
}
else
{
- const type_t *base = is_ptr(type) ? type_pointer_get_ref(type) : type;
+ const type_t *base = is_ptr(type) ? type_pointer_get_ref_type(type) : type;
const UUID *uuid = get_attrp(base->attrs, ATTR_UUID);
if (! uuid)
@@ -3645,7 +3645,7 @@ static unsigned int write_type_tfs(FILE *file, const attr_list_t *attrs,
case TGT_POINTER:
{
enum type_context ref_context;
- type_t *ref = type_pointer_get_ref(type);
+ type_t *ref = type_pointer_get_ref_type(type);
if (context == TYPE_CONTEXT_TOPLEVELPARAM)
ref_context = TYPE_CONTEXT_PARAM;
@@ -3665,7 +3665,7 @@ static unsigned int write_type_tfs(FILE *file, const attr_list_t *attrs,
return offset;
}
- offset = write_type_tfs( file, attrs, type_pointer_get_ref(type), name,
+ offset = write_type_tfs( file, attrs, type_pointer_get_ref_type(type), name,
ref_context, typeformat_offset);
if (context == TYPE_CONTEXT_CONTAINER_NO_POINTERS)
return 0;
@@ -3848,7 +3848,7 @@ static unsigned int get_required_buffer_size_type(
case TGT_POINTER:
{
unsigned int size, align;
- const type_t *ref = type_pointer_get_ref(type);
+ const type_t *ref = type_pointer_get_ref_type(type);
if (is_string_type( attrs, ref )) break;
if (!(size = get_required_buffer_size_type( ref, name, NULL, FALSE, &align ))) break;
if (get_pointer_fc(type, attrs, toplevel_param) != FC_RP)
@@ -4005,7 +4005,7 @@ void print_phase_basetype(FILE *file, int indent, const char *local_var_prefix,
}
else
{
- const type_t *ref = is_ptr(type) ? type_pointer_get_ref(type) : type;
+ const type_t *ref = is_ptr(type) ? type_pointer_get_ref_type(type) : type;
switch (get_basic_fc(ref))
{
case FC_BYTE:
@@ -4054,7 +4054,7 @@ void print_phase_basetype(FILE *file, int indent, const char *local_var_prefix,
if (phase == PHASE_MARSHAL)
{
print_file(file, indent, "*(");
- write_type_decl(file, is_ptr(type) ? type_pointer_get_ref(type) : type, NULL);
+ write_type_decl(file, is_ptr(type) ? type_pointer_get_ref_type(type) : type, NULL);
if (is_ptr(type))
fprintf(file, " *)__frame->_StubMsg.Buffer = *");
else
@@ -4065,7 +4065,7 @@ void print_phase_basetype(FILE *file, int indent, const char *local_var_prefix,
else if (phase == PHASE_UNMARSHAL)
{
print_file(file, indent, "if (__frame->_StubMsg.Buffer + sizeof(");
- write_type_decl(file, is_ptr(type) ? type_pointer_get_ref(type) : type, NULL);
+ write_type_decl(file, is_ptr(type) ? type_pointer_get_ref_type(type) : type, NULL);
fprintf(file, ") > __frame->_StubMsg.BufferEnd)\n");
print_file(file, indent, "{\n");
print_file(file, indent + 1, "RpcRaiseException(RPC_X_BAD_STUB_DATA);\n");
@@ -4077,12 +4077,12 @@ void print_phase_basetype(FILE *file, int indent, const char *local_var_prefix,
fprintf(file, " = (");
else
fprintf(file, " = *(");
- write_type_decl(file, is_ptr(type) ? type_pointer_get_ref(type) : type, NULL);
+ write_type_decl(file, is_ptr(type) ? type_pointer_get_ref_type(type) : type, NULL);
fprintf(file, " *)__frame->_StubMsg.Buffer;\n");
}
print_file(file, indent, "__frame->_StubMsg.Buffer += sizeof(");
- write_type_decl(file, is_ptr(type) ? type_pointer_get_ref(type) : type, NULL);
+ write_type_decl(file, is_ptr(type) ? type_pointer_get_ref_type(type) : type, NULL);
fprintf(file, ");\n");
}
}
@@ -4168,7 +4168,7 @@ void write_parameter_conf_or_var_exprs(FILE *file, int indent, const char *local
break;
}
case TGT_POINTER:
- type = type_pointer_get_ref(type);
+ type = type_pointer_get_ref_type(type);
continue;
case TGT_INVALID:
case TGT_USER_TYPE:
@@ -4435,7 +4435,7 @@ static void write_remoting_arg(FILE *file, int indent, const var_t *func, const
}
case TGT_POINTER:
{
- const type_t *ref = type_pointer_get_ref(type);
+ const type_t *ref = type_pointer_get_ref_type(type);
if (pointer_type == FC_RP) switch (typegen_detect_type(ref, NULL, TDT_ALL_TYPES))
{
case TGT_BASIC:
@@ -4642,7 +4642,7 @@ void declare_stub_args( FILE *file, int indent, const var_t *func )
!type_array_is_decl_as_ptr(var->declspec.type))
type_to_print = var->declspec.type;
else
- type_to_print = type_pointer_get_ref(var->declspec.type);
+ type_to_print = type_pointer_get_ref_type(var->declspec.type);
sprintf(name, "_W%u", i++);
write_type_decl(file, type_to_print, name);
fprintf(file, ";\n");
@@ -4730,7 +4730,7 @@ void assign_stub_out_args( FILE *file, int indent, const var_t *func, const char
break;
case TGT_POINTER:
fprintf(file, " = &%s_W%u;\n", local_var_prefix, i);
- ref = type_pointer_get_ref(var->declspec.type);
+ ref = type_pointer_get_ref_type(var->declspec.type);
switch (typegen_detect_type(ref, var->attrs, TDT_IGNORE_STRINGS))
{
case TGT_BASIC:
diff --git a/tools/widl/typelib.c b/tools/widl/typelib.c
index bf667a9a23..4f6b4fc38a 100644
--- a/tools/widl/typelib.c
+++ b/tools/widl/typelib.c
@@ -99,7 +99,7 @@ static unsigned short builtin_vt(const type_t *t)
if (is_array(t))
elem_type = type_array_get_element_type(t);
else
- elem_type = type_pointer_get_ref(t);
+ elem_type = type_pointer_get_ref_type(t);
if (type_get_type(elem_type) == TYPE_BASIC)
{
switch (type_basic_get_type(elem_type))
diff --git a/tools/widl/typetree.c b/tools/widl/typetree.c
index 51e54d2a9f..0a8ae0f3b2 100644
--- a/tools/widl/typetree.c
+++ b/tools/widl/typetree.c
@@ -182,7 +182,7 @@ type_t *type_new_pointer(unsigned char pointer_default, type_t *ref, attr_list_t
{
type_t *t = make_type(TYPE_POINTER);
t->details.pointer.def_fc = pointer_default;
- t->details.pointer.ref = ref;
+ t->details.pointer.ref.type = ref;
t->attrs = attrs;
return t;
}
diff --git a/tools/widl/typetree.h b/tools/widl/typetree.h
index 3205d58450..22232fc0a7 100644
--- a/tools/widl/typetree.h
+++ b/tools/widl/typetree.h
@@ -294,11 +294,16 @@ static inline ifref_list_t *type_coclass_get_ifaces(const type_t *type)
return type->details.coclass.ifaces;
}
-static inline type_t *type_pointer_get_ref(const type_t *type)
+static inline const decl_spec_t *type_pointer_get_ref(const type_t *type)
{
type = type_get_real_type(type);
assert(type_get_type(type) == TYPE_POINTER);
- return type->details.pointer.ref;
+ return &type->details.pointer.ref;
+}
+
+static inline type_t *type_pointer_get_ref_type(const type_t *type)
+{
+ return type_pointer_get_ref(type)->type;
}
static inline unsigned char type_pointer_get_default_fc(const type_t *type)
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 6ab419b30e..bd727f70b6 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -384,7 +384,7 @@ struct basic_details
struct pointer_details
{
- struct _type_t *ref;
+ struct _decl_spec_t ref;
unsigned char def_fc;
};
@@ -458,7 +458,6 @@ struct _type_t {
struct _var_t {
char *name;
decl_spec_t declspec;
-
attr_list_t *attrs;
expr_t *eval;
unsigned int procstring_offset;
diff --git a/tools/widl/write_msft.c b/tools/widl/write_msft.c
index ff3a63bf46..9a3edf7291 100644
--- a/tools/widl/write_msft.c
+++ b/tools/widl/write_msft.c
@@ -862,8 +862,8 @@ static int encode_type(
case VT_PTR:
{
int next_vt;
- for(next_vt = 0; is_ptr(type); type = type_pointer_get_ref(type)) {
- next_vt = get_type_vt(type_pointer_get_ref(type));
+ for(next_vt = 0; is_ptr(type); type = type_pointer_get_ref_type(type)) {
+ next_vt = get_type_vt(type_pointer_get_ref_type(type));
if (next_vt != 0)
break;
}
@@ -871,7 +871,7 @@ static int encode_type(
if (next_vt == 0)
next_vt = VT_VOID;
- encode_type(typelib, next_vt, type_pointer_get_ref(type),
+ encode_type(typelib, next_vt, type_pointer_get_ref_type(type),
&target_type, &child_size);
/* these types already have an implicit pointer, so we don't need to
* add another */
@@ -1093,7 +1093,7 @@ static int encode_var(
vt = get_type_vt(type);
if (vt == VT_PTR) {
type_t *ref = is_ptr(type) ?
- type_pointer_get_ref(type) : type_array_get_element_type(type);
+ type_pointer_get_ref_type(type) : type_array_get_element_type(type);
int skip_ptr = encode_var(typelib, ref, var, &target_type, &child_size);
if(skip_ptr == 2) {
@@ -1204,7 +1204,7 @@ static void write_default_value(msft_typelib_t *typelib, type_t *type, expr_t *e
if (type_get_type(type) == TYPE_ENUM) {
vt = VT_I4;
} else if (is_ptr(type)) {
- vt = get_type_vt(type_pointer_get_ref(type));
+ vt = get_type_vt(type_pointer_get_ref_type(type));
if (vt == VT_USERDEFINED)
vt = VT_I4;
if (expr->cval)
--
2.17.1
July 6, 2019
Re: Wine staging 4.12 release
by Sveinar Søpler
----- On Jul 6, 2019, at 5:41 PM, Tim Schumacher timschumi(a)gmx.de wrote:
> On 06.07.19 09:59, Alistair Leslie-Hughes wrote> Binary packages for various
> distributions will be available from:
>> https://www.winehq.org/download
>>
>> Summary since last release
>> * Rebased to current wine 4.12 (822 patches are applied to wine vanilla)
>
>
> The commit "setupapi: Add support for IDF_CHECKFIRST flag in
> SetupPromptForDiskW."
> (from the setupapi-SetupPromptForDisk set of patches) appears to break building
> wine-staging, since the linker isn't able to find the snwprintf function.
>
> Reverting the commit makes things buildable again. I have tried replacing
> snwprintf
> with _snwprintf, which successfully builds as well, but I couldn't do any
> testing yet.
Was this with the configure option "--without-mingw" (or not having mingw installed)?
Cos it seemed to build ok with mingw (default), but when building without it fails
as you describe for me too.
And does reverting this + building --without-mingw fix things? Or does wine still
crash?
>
> Tim
July 6, 2019
Re: Wine staging 4.12 release
by Tim Schumacher
On 06.07.19 09:59, Alistair Leslie-Hughes wrote> Binary packages for various distributions will be available from:
> https://www.winehq.org/download
>
> Summary since last release
> * Rebased to current wine 4.12 (822 patches are applied to wine vanilla)
The commit "setupapi: Add support for IDF_CHECKFIRST flag in SetupPromptForDiskW."
(from the setupapi-SetupPromptForDisk set of patches) appears to break building
wine-staging, since the linker isn't able to find the snwprintf function.
Reverting the commit makes things buildable again. I have tried replacing snwprintf
with _snwprintf, which successfully builds as well, but I couldn't do any testing yet.
Tim
July 6, 2019
[PATCH 08/15] widl: type_new_alias function now takes decl_spec_t for aliasee rather than type_t
by Richard Pospesel
Signed-off-by: Richard Pospesel <richard(a)torproject.org>
---
tools/widl/parser.y | 12 +++++++++---
tools/widl/typetree.c | 9 +++------
tools/widl/typetree.h | 2 +-
3 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index f3414e1f70..07261b99dc 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -1190,7 +1190,8 @@ static void decl_builtin_basic(const char *name, enum type_basic_type type)
static void decl_builtin_alias(const char *name, type_t *t)
{
- reg_type(type_new_alias(t, name), name, NULL, 0);
+ decl_spec_t ds;
+ reg_type(type_new_alias(init_declspec(&ds, t), name), name, &global_namespace, 0);
}
void init_types(void)
@@ -1808,8 +1809,13 @@ static declarator_t *make_declarator(var_t *var)
static type_t *make_safearray(type_t *type)
{
+ decl_spec_t aliasee_ds;
decl_spec_t element_ds;
- init_declspec(&element_ds, type_new_alias(type, "SAFEARRAY"));
+
+ init_declspec(&element_ds,
+ type_new_alias(
+ init_declspec(&aliasee_ds, type),
+ "SAFEARRAY"));
return type_new_array(NULL, &element_ds, TRUE, 0,
NULL, NULL, FC_RP);
@@ -2006,7 +2012,7 @@ static type_t *reg_typedefs(decl_spec_t *decl_spec, declarator_list_t *decls, at
cur->loc_info.line_number);
name = declare_var(attrs, decl_spec, decl, 0);
- cur = type_new_alias(name->declspec.type, name->name);
+ cur = type_new_alias(&name->declspec, name->name);
cur->attrs = attrs;
if (is_incomplete(cur))
diff --git a/tools/widl/typetree.c b/tools/widl/typetree.c
index 6b50271377..282f0dbbab 100644
--- a/tools/widl/typetree.c
+++ b/tools/widl/typetree.c
@@ -186,16 +186,13 @@ type_t *type_new_pointer(unsigned char pointer_default, type_t *ref, attr_list_t
return t;
}
-type_t *type_new_alias(type_t *t, const char *name)
+type_t *type_new_alias(const decl_spec_t *ds, const char *name)
{
- type_t *a = make_type(t->type_type);
-
+ type_t *a = make_type(ds->type->type_type);
a->name = xstrdup(name);
a->attrs = NULL;
- a->details.alias.aliasee.type = t;
+ a->details.alias.aliasee = *ds;
a->is_alias = TRUE;
- init_loc_info(&a->loc_info);
-
return a;
}
diff --git a/tools/widl/typetree.h b/tools/widl/typetree.h
index 59bfb29fa4..9434075108 100644
--- a/tools/widl/typetree.h
+++ b/tools/widl/typetree.h
@@ -31,7 +31,7 @@ enum name_type {
type_t *type_new_function(var_list_t *args);
type_t *type_new_pointer(unsigned char pointer_default, type_t *ref, attr_list_t *attrs);
-type_t *type_new_alias(type_t *t, const char *name);
+type_t *type_new_alias(const decl_spec_t *aliasee, const char *name);
type_t *type_new_module(char *name);
type_t *type_new_array(const char* name, const decl_spec_t *element, int declptr,
unsigned int dim, expr_t *size_is, expr_t *length_is,
--
2.17.1
July 6, 2019
[PATCH] wined3d: Handle context acquisition failure in wined3d_device_create_primary_opengl_context_cs().
by Henri Verbeet
Now that we no longer always call context_acquire() from
swapchain_init(), context acquisition can fail here instead.
This fixes a regression introduced by commit
64d41b3dec0635c56268be64d407ed9bfd8c0695.
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/wined3d/device.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index d35a0648c9c..2c768514c46 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1108,10 +1108,19 @@ void wined3d_device_create_primary_opengl_context_cs(void *object)
struct wined3d_texture *target;
HRESULT hr;
+ swapchain = device->swapchains[0];
+ target = swapchain->back_buffers ? swapchain->back_buffers[0] : swapchain->front_buffer;
+ if (!(context = context_acquire(device, target, 0)))
+ {
+ WARN("Failed to acquire context.\n");
+ return;
+ }
+
if (FAILED(hr = device->shader_backend->shader_alloc_private(device,
device->adapter->vertex_pipe, device->adapter->fragment_pipe)))
{
ERR("Failed to allocate shader private data, hr %#x.\n", hr);
+ context_release(context);
return;
}
@@ -1119,6 +1128,7 @@ void wined3d_device_create_primary_opengl_context_cs(void *object)
{
ERR("Failed to create CPU blitter.\n");
device->shader_backend->shader_free_private(device, NULL);
+ context_release(context);
return;
}
wined3d_ffp_blitter_create(&device->blitter, &device->adapter->gl_info);
@@ -1127,9 +1137,6 @@ void wined3d_device_create_primary_opengl_context_cs(void *object)
wined3d_fbo_blitter_create(&device->blitter, &device->adapter->gl_info);
wined3d_raw_blitter_create(&device->blitter, &device->adapter->gl_info);
- swapchain = device->swapchains[0];
- target = swapchain->back_buffers ? swapchain->back_buffers[0] : swapchain->front_buffer;
- context = context_acquire(device, target, 0);
context_gl = wined3d_context_gl(context);
wined3d_device_gl_create_dummy_textures(wined3d_device_gl(device), context_gl);
create_default_samplers(device, context);
--
2.11.0
July 6, 2019
Release 4.12 breakage
by Alexandre Julliard
Folks,
There seems to be some serious breakage with 4.12 on 64-bit, sorry about
that. This is what happens when you try to push everything out before
leaving on vacation...
So I'm going to make a bug fix release soon, and *then* I'll go on
vacation for 3 weeks ;-)
--
Alexandre Julliard
julliard(a)winehq.org
July 6, 2019
[PATCH] wineboot: Fix cpuid asm wrapper to use ms_abi convention.
by Hans Leidekker
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47464
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
---
programs/wineboot/wineboot.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c
index 834bf92730..f7908561a9 100644
--- a/programs/wineboot/wineboot.c
+++ b/programs/wineboot/wineboot.c
@@ -207,14 +207,17 @@ __ASM_GLOBAL_FUNC( do_cpuid,
"ret" )
#elif defined(__x86_64__)
__ASM_GLOBAL_FUNC( do_cpuid,
+ "pushq %rsi\n\t"
"pushq %rbx\n\t"
- "movl %edi,%eax\n\t"
+ "movq %rcx,%rax\n\t"
+ "movq %rdx,%rsi\n\t"
"cpuid\n\t"
"movl %eax,(%rsi)\n\t"
"movl %ebx,4(%rsi)\n\t"
"movl %ecx,8(%rsi)\n\t"
"movl %edx,12(%rsi)\n\t"
"popq %rbx\n\t"
+ "popq %rsi\n\t"
"ret" )
#else
void do_cpuid( unsigned int ax, unsigned int *p )
--
2.11.0
July 6, 2019
Wine staging 4.12 release
by Alistair Leslie-Hughes
Binary packages for various distributions will be available from:
https://www.winehq.org/download
Summary since last release
* Rebased to current wine 4.12 (822 patches are applied to wine vanilla)
NOTE:
FAudio will not be supported until distro's have FAudio library as part
of their
standard repositories. This will be the last release that FAudio isn't
supported.
Upstreamed (Either directly from staging or fixed with a similar patch).
* winex11.drv: Allow changing the opengl pixel format on the desktop window.
* gdi32: Also accept "\\.\DISPLAY<n>" devices names with <n> other than
1 as display devices.
* wininet: Allow to set INTERNET_OPTION_HTTP_DECODING on sessions and
connections.
Added:
* [23166] shlwapi: Support ./ in UrlCanonicalize.
* [47419] wined3d: Dont set DDSCAPS_FLIP for gdi renderer.
* [24125] kernel32: Implement SetProcessDEPPolicy.
* [28170] user32: Added LoadKeyboardLayoutEx stub.
* [47439] loader: Add Keyboard Layouts registry enteries.
Updated:
* none
Where can you help
* Run Steam/Battle.net/UPlay.
* Try you favorite game.
* Test your favorite applications.
* Improve staging patches and get them accepted upstream.
As always, if you find a bug, please report it via
https://bugs.winehq.org
Best Regards
Alistair.
July 6, 2019
Re: [PATCH vkd3d 5/5] configure: Check if SPIR-V headers are recent enough.
by Marvin
Hi,
While running your changed tests, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=54539
Your paranoid android.
=== debian9 (build log) ===
error: patch failed: configure.ac:69
Task: Patch failed to apply
=== debian9 (build log) ===
error: patch failed: configure.ac:69
Task: Patch failed to apply
July 6, 2019
[PATCH vkd3d 5/5] configure: Check if SPIR-V headers are recent enough.
by Józef Kucia
From: Józef Kucia <jkucia(a)codeweavers.com>
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
configure.ac | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/configure.ac b/configure.ac
index e2d61316ce6d..abd94b514d63 100644
--- a/configure.ac
+++ b/configure.ac
@@ -69,6 +69,13 @@ AS_IF([test "x$ac_cv_header_spirv_unified1_GLSL_std_450_h" != "xyes" \
VKD3D_CHECK_VULKAN_HEADER_VERSION([113], [AC_MSG_ERROR([Vulkan headers are too old, 1.1.113 is required.])])
+AC_CHECK_DECL([SpvCapabilityDemoteToHelperInvocationEXT],, [AC_MSG_ERROR([SPIR-V headers are too old.])], [
+#ifdef HAVE_SPIRV_UNIFIED1_SPIRV_H
+# include "spirv/unified1/spirv.h"
+#else
+# include "vulkan/spirv.h"
+#endif])
+
dnl Check for libraries
m4_ifdef([PKG_PROG_PKG_CONFIG], [PKG_PROG_PKG_CONFIG], [m4_fatal([pkg-config autoconf macros not found.])])
--
2.21.0
July 6, 2019