[Mesa-dev] [PATCH 13/14] swr: fix clang 5 null cast warning

Cherniak, Bruce bruce.cherniak at intel.com
Thu Jan 18 19:01:13 UTC 2018


Apologies for not seeing this over the holidays.

Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com<mailto:bruce.cherniak at intel.com>>

On Jan 18, 2018, at 12:03 PM, Emil Velikov <emil.l.velikov at gmail.com<mailto:emil.l.velikov at gmail.com>> wrote:

On 31 December 2017 at 16:55, Greg V <greg at unrelenting.technology<mailto:greg at unrelenting.technology>> wrote:
---
src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h b/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h
index 6c801c7ff6..abb0c53ec4 100644
--- a/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h
+++ b/src/gallium/drivers/swr/rasterizer/memory/TilingFunctions.h
@@ -624,7 +624,7 @@ uint32_t TileSwizzle2D(uint32_t xOffsetBytes, uint32_t yOffsetRows, const SWR_SU
    case SWR_TILE_MODE_WMAJOR: return ComputeTileSwizzle2D<TilingTraits<SWR_TILE_MODE_WMAJOR, 8> >(xOffsetBytes, yOffsetRows, pState);
    default: SWR_INVALID("Unsupported tiling mode");
    }
-    return (uint32_t) NULL;
+    return 0;
}

//////////////////////////////////////////////////////////////////////////
@@ -644,7 +644,7 @@ uint32_t TileSwizzle3D(uint32_t xOffsetBytes, uint32_t yOffsetRows, uint32_t zOf
    case SWR_TILE_MODE_YMAJOR: return ComputeTileSwizzle3D<TilingTraits<SWR_TILE_MODE_YMAJOR, 32> >(xOffsetBytes, yOffsetRows, zOffsetSlices, pState);
    default: SWR_INVALID("Unsupported tiling mode");
    }
-    return (uint32_t) NULL;
+    return 0;
}

template<bool UseCachedOffsets>
@@ -677,7 +677,7 @@ uint32_t ComputeSurfaceOffset(uint32_t x, uint32_t y, uint32_t z, uint32_t array
    default: SWR_INVALID("Unsupported format");
    }

-    return (uint32_t) NULL;
+    return 0;
}

[Adding a couple of SWR devs]

Patch looks good, although there might be some subtle reason behind
the current approach.
Reviewed-by: Emil Velikov <emil.velikov at collabora.com<mailto:emil.velikov at collabora.com>>

-Emil

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180118/5608ba47/attachment-0001.html>


More information about the mesa-dev mailing list