[Mesa-dev] [PATCH mesa] swr: use ARRAY_SIZE macro

Eric Engestrom eric.engestrom at imgtec.com
Wed Sep 13 12:09:33 UTC 2017


On Wednesday, 2017-09-13 13:03:45 +0100, Emil Velikov wrote:
> On 13 September 2017 at 12:35, Alejandro PiƱeiro <apinheiro at igalia.com> wrote:
> > On 12/09/17 15:03, Eric Engestrom wrote:
> >> Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
> >> ---
> >>  src/gallium/drivers/swr/rasterizer/memory/StoreTile.h | 10 ++++++----
> >>  1 file changed, 6 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/src/gallium/drivers/swr/rasterizer/memory/StoreTile.h b/src/gallium/drivers/swr/rasterizer/memory/StoreTile.h
> >> index c3d14e9509..67bcf94f00 100644
> >> --- a/src/gallium/drivers/swr/rasterizer/memory/StoreTile.h
> >> +++ b/src/gallium/drivers/swr/rasterizer/memory/StoreTile.h
> >> @@ -40,6 +40,8 @@
> >>  #include <array>
> >>  #include <sstream>
> >>
> >> +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
> >
> > You are also defining the macro here.  Isn't possible to use the
> > definition at util/macros.h?
> >
> See https://lists.freedesktop.org/archives/mesa-dev/2017-September/169210.html

Precisely.

That said, I made a couple mistakes when sending this patch, namely
forgetting to make it a v2 and forgetting to make it a reply to the
other one, so one can be excused from not having read the previous
thread :)


More information about the mesa-dev mailing list