Module: wine Branch: master Commit: bf9d15e3b1a29f73fedda0c34547a9b29d5e2789 URL: https://gitlab.winehq.org/wine/wine/-/commit/bf9d15e3b1a29f73fedda0c34547a9b...
Author: Rémi Bernon rbernon@codeweavers.com Date: Tue Jan 24 22:19:45 2023 +0100
widl: Use warning_at when reporting duplicate attributes.
---
tools/widl/attribute.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/tools/widl/attribute.c b/tools/widl/attribute.c index bceca3da46a..92c6f1a44fa 100644 --- a/tools/widl/attribute.c +++ b/tools/widl/attribute.c @@ -260,16 +260,13 @@ attr_list_t *append_attr( attr_list_t *list, attr_t *attr ) if (!allowed_attr[attr->type].multiple) { LIST_FOR_EACH_ENTRY( attr_existing, list, attr_t, entry ) - if (attr_existing->type == attr->type) - { - char buffer[1024]; - snprintf( buffer, sizeof(buffer), "duplicate attribute %s\n", - get_attr_display_name( attr->type ) ); - parser_warning( NULL, buffer ); - /* use the last attribute, like MIDL does */ - list_remove( &attr_existing->entry ); - break; - } + { + if (attr_existing->type != attr->type) continue; + warning_at( &attr->where, "duplicate attribute %s\n", get_attr_display_name( attr->type ) ); + /* use the last attribute, like MIDL does */ + list_remove( &attr_existing->entry ); + break; + } } list_add_tail( list, &attr->entry ); return list;