[PATCH 3/6] wined3d: Introduce D3D7+ normal matrix computation.

Henri Verbeet hverbeet at gmail.com
Thu Apr 23 06:52:17 CDT 2015


On 22 April 2015 at 19:30, Matteo Bruni <mbruni at codeweavers.com> wrote:
> +#define SWAP_ROWS(a, b) { float *tmp = a; a = b; b = tmp; }
> +
I assume this is mostly borrowed from Mesa like invert_matrix_3d(),
but unfortunately Mesa isn't particularly good at writing macros, even
though they have more than enough of them. This one happens to more or
less work for the cases you have here, but consider the following in
particular:
    if (...)
        SWAP_ROWS(a, b);
    else
        SWAP_ROWS(c, d);
Please just use the standard "do { ... } while(0)" construction when
you need to define a macro like that. In this particular case there's
of course no reason you need a macro in the first place.



More information about the wine-devel mailing list