[PATCH 1/4] wined3d: Rename state parameters to explicit names.
Rémi Bernon
rbernon at codeweavers.com
Thu Feb 18 08:12:25 CST 2021
On 2/18/21 3:06 PM, Henri Verbeet wrote:
> On Thu, 18 Feb 2021 at 13:31, Rémi Bernon <rbernon at codeweavers.com> wrote:
>> static void wined3d_device_get_transform(const struct wined3d_device *device,
>> - enum wined3d_transform_state state, struct wined3d_matrix *matrix)
>> + enum wined3d_transform_state transform_state, struct wined3d_matrix *matrix)
>> {
>> - TRACE("device %p, state %s, matrix %p.\n", device, debug_d3dtstype(state), matrix);
>> + TRACE("device %p, transform_state %s, matrix %p.\n", device, debug_d3dtstype(transform_state), matrix);
>>
>> - *matrix = device->state.transforms[state];
>> + *matrix = device->state.transforms[transform_state];
>> }
>>
> That seems a bit gratuitous. In most of the cases you're changing
> here, there are very few actual uses of "device->state". E.g., in the
> code above, you may just as well simply do
>
> - *matrix = device->state.transforms[state];
> + *matrix = device->state->transforms[state];
>
> in patch 3/4, and skip the changes in patches 1/2 and 2/2.
>
Sure, it just felt more natural to setup a common pattern for all the
functions, so that the changes in the later patches are obviously trivial.
--
Rémi Bernon <rbernon at codeweavers.com>
More information about the wine-devel
mailing list