Re: [PATCH] d3dx9/tests: Use a macro to initialize matrix rows in math tests
On 10 November 2017 at 08:06, Alex Henrie <alexhenrie24(a)gmail.com> wrote:
diff --git a/dlls/d3dx9_36/tests/math.c b/dlls/d3dx9_36/tests/math.c index ec07348685..409e3cb650 100644 --- a/dlls/d3dx9_36/tests/math.c +++ b/dlls/d3dx9_36/tests/math.c @@ -25,6 +25,8 @@
#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
+#define SET_ARRAY4(array, a, b, c, d) array[0] = a; array[1] = b; array[2] = c; array[3] = d You don't need a macro for that.
2017-11-10 1:57 GMT-07:00 Henri Verbeet <hverbeet(a)gmail.com>:
On 10 November 2017 at 08:06, Alex Henrie <alexhenrie24(a)gmail.com> wrote:
diff --git a/dlls/d3dx9_36/tests/math.c b/dlls/d3dx9_36/tests/math.c index ec07348685..409e3cb650 100644 --- a/dlls/d3dx9_36/tests/math.c +++ b/dlls/d3dx9_36/tests/math.c @@ -25,6 +25,8 @@
#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
+#define SET_ARRAY4(array, a, b, c, d) array[0] = a; array[1] = b; array[2] = c; array[3] = d You don't need a macro for that.
Are you saying that each expected matrix should be a static const variable? -Alex
On 10 November 2017 at 15:58, Alex Henrie <alexhenrie24(a)gmail.com> wrote:
2017-11-10 1:57 GMT-07:00 Henri Verbeet <hverbeet(a)gmail.com>:
On 10 November 2017 at 08:06, Alex Henrie <alexhenrie24(a)gmail.com> wrote:
+#define SET_ARRAY4(array, a, b, c, d) array[0] = a; array[1] = b; array[2] = c; array[3] = d You don't need a macro for that.
Are you saying that each expected matrix should be a static const variable?
Well, if you can make it work, a tests[] array would probably be preferable. But wrt. SET_ARRAY specifically, there's no reason that couldn't be a function.
participants (2)
-
Alex Henrie -
Henri Verbeet