Module: wine Branch: master Commit: a10740f3196c4d7546b999f13f446bddfee68c47 URL: https://gitlab.winehq.org/wine/wine/-/commit/a10740f3196c4d7546b999f13f446bd...
Author: Rémi Bernon rbernon@codeweavers.com Date: Fri Mar 24 14:56:58 2023 +0100
widl: Remove custom attribute creation helper.
---
tools/widl/attribute.c | 11 ----------- tools/widl/parser.y | 5 ++++- tools/widl/widl.h | 1 - 3 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/tools/widl/attribute.c b/tools/widl/attribute.c index 46fb05d09e0..1234f0a1e40 100644 --- a/tools/widl/attribute.c +++ b/tools/widl/attribute.c @@ -40,17 +40,6 @@ attr_t *attr_ptr( enum attr_type attr_type, void *val ) return a; }
-attr_t *make_custom_attr( struct uuid *id, expr_t *pval ) -{ - attr_t *a = xmalloc( sizeof(attr_t) ); - attr_custdata_t *cstdata = xmalloc( sizeof(attr_custdata_t) ); - a->type = ATTR_CUSTOM; - cstdata->id = *id; - cstdata->pval = pval; - a->u.pval = cstdata; - return a; -} - int is_attr( const attr_list_t *list, enum attr_type attr_type ) { const attr_t *attr; diff --git a/tools/widl/parser.y b/tools/widl/parser.y index 86a07b175f4..77e9fadff6f 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -625,7 +625,10 @@ attribute | tCONTRACT '(' contract_req ')' { $$ = attr_ptr( ATTR_CONTRACT, $3 ); } | tCONTRACTVERSION '(' contract_ver ')' { $$ = attr_int( ATTR_CONTRACTVERSION, $3 ); } | tCONTROL { $$ = attr_int( ATTR_CONTROL, 0 ); } - | tCUSTOM '(' aUUID ',' expr_const ')' { $$ = make_custom_attr( $3, $5 ); } + | tCUSTOM '(' aUUID ',' expr_const ')' { attr_custdata_t *data = xmalloc( sizeof(*data) ); + data->id = *$3; data->pval = $5; + $$ = attr_ptr( ATTR_CUSTOM, data ); + } | tDECODE { $$ = attr_int( ATTR_DECODE, 0 ); } | tDEFAULT { $$ = attr_int( ATTR_DEFAULT, 0 ); } | tDEFAULTBIND { $$ = attr_int( ATTR_DEFAULTBIND, 0 ); } diff --git a/tools/widl/widl.h b/tools/widl/widl.h index c22f619349e..b8f1eb8d4c0 100644 --- a/tools/widl/widl.h +++ b/tools/widl/widl.h @@ -99,7 +99,6 @@ extern void end_cplusplus_guard(FILE *fp);
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 ); extern int is_ptrchain_attr( const var_t *var, enum attr_type attr_type );