winsys/sw/dri: don't use GNU void pointer arithmetic
authorEmil Velikov <emil.velikov@collabora.com>
Sun, 16 Apr 2017 13:39:03 +0000 (14:39 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 19 Apr 2017 11:19:38 +0000 (12:19 +0100)
Resolves build issues like the following:

src/gallium/winsys/sw/dri/dri_sw_winsys.c:203:31: error: pointer of type ‘void *’ used in arithmetic [-Werror=pointer-arith]
        data = dri_sw_dt->data + (dri_sw_dt->stride * box->y) + box->x * blsize;
                               ^
src/gallium/winsys/sw/dri/dri_sw_winsys.c:203:62: error: pointer of type ‘void *’ used in arithmetic [-Werror=pointer-arith]
        data = dri_sw_dt->data + (dri_sw_dt->stride * box->y) + box->x * blsize;
                                                              ^

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/winsys/sw/dri/dri_sw_winsys.c

index 94d5092405eb4fd1c003fe8f7f6defe07523b36a..00849985d6b99d47875556d75585255eb44a5bca 100644 (file)
@@ -200,7 +200,7 @@ dri_sw_displaytarget_display(struct sw_winsys *ws,
 
    if (box) {
        void *data;
-       data = dri_sw_dt->data + (dri_sw_dt->stride * box->y) + box->x * blsize;
+       data = (char *)dri_sw_dt->data + (dri_sw_dt->stride * box->y) + box->x * blsize;
        dri_sw_ws->lf->put_image2(dri_drawable, data,
                                  box->x, box->y, box->width, box->height, dri_sw_dt->stride);
    } else {