Commit 7771a9ae authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

widl: Simplify attribute creation with either int or ptr value.

parent f36fbb37
......@@ -24,15 +24,7 @@
#include "parser.tab.h"
attr_t *make_attr( enum attr_type attr_type )
{
attr_t *a = xmalloc( sizeof(attr_t) );
a->type = attr_type;
a->u.ival = 0;
return a;
}
attr_t *make_attrv( enum attr_type attr_type, unsigned int val )
attr_t *attr_int( enum attr_type attr_type, unsigned int val )
{
attr_t *a = xmalloc( sizeof(attr_t) );
a->type = attr_type;
......@@ -40,7 +32,7 @@ attr_t *make_attrv( enum attr_type attr_type, unsigned int val )
return a;
}
attr_t *make_attrp( enum attr_type attr_type, void *val )
attr_t *attr_ptr( enum attr_type attr_type, void *val )
{
attr_t *a = xmalloc( sizeof(attr_t) );
a->type = attr_type;
......
......@@ -1268,7 +1268,7 @@ static void compute_interface_signature_uuid(type_t *iface)
if (!(uuid = get_attrp(iface->attrs, ATTR_UUID)))
{
uuid = xmalloc(sizeof(*uuid));
iface->attrs = append_attr(iface->attrs, make_attrp(ATTR_UUID, uuid));
iface->attrs = append_attr( iface->attrs, attr_ptr( ATTR_UUID, uuid ) );
}
sha1_init(&ctx);
......
......@@ -97,9 +97,8 @@ extern void end_cplusplus_guard(FILE *fp);
/* attribute.c */
extern attr_t *make_attr( enum attr_type attr_type );
extern attr_t *make_attrv( enum attr_type attr_type, unsigned int val );
extern attr_t *make_attrp( enum attr_type attr_type, void *val );
extern attr_t *attr_int( enum attr_type attr_type, unsigned int val );
extern attr_t *attr_ptr( enum attr_type attr_type, void *val );
extern attr_t *make_custom_attr( struct uuid *id, expr_t *pval );
extern int is_attr( const attr_list_t *list, enum attr_type attr_type );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment