On 22 April 2015 at 19:30, Matteo Bruni mbruni@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.