[PATCH 03/18] comctl32: Added basic implementation for task dialogs and add tests

Nikolay Sivov bunglehead at gmail.com
Sat Feb 25 11:27:59 CST 2017


On 25.02.2017 19:01, Fabian Maurer wrote:
> +
> +#define MEMCPY_MOVEPTR(target, source, size) memcpy(target, source, size); target += size;
> +#define STR_SIZE(str) ((lstrlenW(str) + 1) * sizeof(WCHAR))

If this will stay, please use functions, not macros. STR_SIZE does not
look useful.

> +static void controls_init(struct list **controls)
> +{
> +    *controls = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct list));
> +    list_init(*controls);
> +}

Usually there's no need to allocate 'struct list' itself.

> +
> +static void controls_destroy(struct list *controls)
> +{
> +    control_info *control;
> +    LIST_FOR_EACH_ENTRY(control, controls, control_info, entry)
> +    {
> +        HeapFree(GetProcessHeap(), 0, control);
> +    }
> +    HeapFree(GetProcessHeap(), 0, controls);
> +}

You can't free list node like that.

> +    static const WCHAR class_button[] = {'B','u','t','t','o','n',0};

This one is already defined in a header.

> +    static const WCHAR text_ok[] = {'O','K',0};

Static string for that doesn't look right.





More information about the wine-patches mailing list