Add glu::BufferOffsetAsPointer utility
authorJesse Hall <jessehall@google.com>
Tue, 27 Mar 2018 23:49:03 +0000 (16:49 -0700)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Mon, 13 Apr 2020 13:12:41 +0000 (09:12 -0400)
commit5ee7892b8363816ff40bb76f27d7dde90072eeab
treeddac17f14bb50708c769682d54d5ddf17de6e50f
parent03c16305943cf98bbe1d55aaca7666d796c1398c
Add glu::BufferOffsetAsPointer utility

Clang 6.x adds a warning that doing arithmetic involving a NULL
pointer is a GNU extension. This affects the common GL pattern
    (deUint8*)DE_NULL + offset
used to pass an offset into a bound buffer object as a client pointer
parameter.

This change replaces that pattern with a call to a new utility
function glu::BufferOffsetAsPointer(), which will hopefully be
warning-free on all compilers.

Change-Id: I8be939297b02c44091441c71ae75e45ceab30639
Components: Framework, OpenGL, AOSP
(cherry picked from commit 05d98991304fce712732124e5e12fb670ee5a799)
13 files changed:
external/openglcts/modules/gl/gl4cDirectStateAccessTexturesTests.cpp
external/openglcts/modules/gl/gl4cDirectStateAccessVertexArraysTests.cpp
framework/opengl/gluDefs.hpp
framework/opengl/simplereference/sglrReferenceContext.cpp
modules/gles3/functional/es3fShaderStateQueryTests.cpp
modules/gles3/performance/es3pBufferDataUploadTests.cpp
modules/gles31/functional/es31fDrawTests.cpp
modules/gles31/functional/es31fGeometryShaderTests.cpp
modules/gles31/functional/es31fMultisampleShaderRenderCase.cpp
modules/gles31/functional/es31fPrimitiveBoundingBoxTests.cpp
modules/gles31/functional/es31fVertexAttributeBindingStateQueryTests.cpp
modules/gles31/functional/es31fVertexAttributeBindingTests.cpp
modules/glshared/glsDrawTest.cpp