Fix GCC 6.3 warnings in master
authorPyry Haulos <phaulos@google.com>
Thu, 30 Mar 2017 23:42:23 +0000 (16:42 -0700)
committerPyry Haulos <phaulos@google.com>
Mon, 3 Apr 2017 18:10:16 +0000 (11:10 -0700)
Change-Id: I8cf513413c078f1abdb53c93129456039be1e2a9

external/openglcts/CMakeLists.txt
external/openglcts/modules/gl/gl4cGPUShaderFP64Tests.cpp
framework/egl/wrapper/eglwImplExt.inl
modules/gles31/functional/es31fNegativeSSBOBlockTests.cpp
modules/gles31/functional/es31fSRGBDecodeTests.cpp
scripts/egl/gtf_wrapper.py

index 2a1a441..8cd93a1 100644 (file)
@@ -6,6 +6,9 @@ set(GTF_HOME     "${KC_CTS_HOME}/src/GTF_ES"            CACHE STRING "Home direc
 if (DE_COMPILER_IS_GCC OR DE_COMPILER_IS_CLANG)
        # -Wconversion generates a LOT of warnings in this code base
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-conversion")
+
+       # Same for -Wunused-function
+       set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-function")
 endif ()
 
 if (EXISTS "${GTF_HOME}/CMakeLists.txt")
index fad10b9..dfc5673 100644 (file)
 
 #include <iomanip>
 
-#include <deMath.h>
-#include <tcuMatrixUtil.hpp>
-#include <tcuVectorUtil.hpp>
+#include "deMath.h"
+#include "deUniquePtr.hpp"
+#include "tcuMatrixUtil.hpp"
+#include "tcuVectorUtil.hpp"
 
 #include <cstdlib>
 #include <cstring>
@@ -15107,7 +15108,7 @@ bool GPUShaderFP64Test10::test(functionEnum function, const typeDetails& type)
        }
 
        Utils::programInfo                        program(m_context);
-       std::auto_ptr<functionObject> function_object(getFunctionObject(function, type));
+       de::UniquePtr<functionObject> function_object(getFunctionObject(function, type));
 
        prepareProgram(*function_object, program);
        prepareTestData(*function_object);
index 43fcad1..9002700 100644 (file)
@@ -6,10 +6,10 @@
 
 EGLint eglwClientWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout)
 {
-                                                                       const eglw::Library* egl = eglw::getCurrentThreadLibrary();
+       const eglw::Library* egl = eglw::getCurrentThreadLibrary();
        if (!egl)
                return (EGLint)0;
-               return egl->clientWaitSyncKHR(dpy, sync, flags, timeout);
+       return egl->clientWaitSyncKHR(dpy, sync, flags, timeout);
 }
 
 EGLImageKHR eglwCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list)
@@ -38,7 +38,7 @@ EGLSurface eglwCreatePlatformWindowSurfaceEXT (EGLDisplay dpy, EGLConfig config,
 
 EGLSyncKHR eglwCreateSyncKHR (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list)
 {
-                                                                                               const eglw::Library* egl = eglw::getCurrentThreadLibrary();
+       const eglw::Library* egl = eglw::getCurrentThreadLibrary();
        if (!egl)
                return (EGLSyncKHR)0;
        return egl->createSyncKHR(dpy, type, attrib_list);
@@ -46,7 +46,7 @@ EGLSyncKHR eglwCreateSyncKHR (EGLDisplay dpy, EGLenum type, const EGLint *attrib
 
 EGLBoolean eglwDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image)
 {
-                                                                                                                                       const eglw::Library* egl = eglw::getCurrentThreadLibrary();
+       const eglw::Library* egl = eglw::getCurrentThreadLibrary();
        if (!egl)
                return (EGLBoolean)0;
        return egl->destroyImageKHR(dpy, image);
@@ -54,7 +54,7 @@ EGLBoolean eglwDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image)
 
 EGLBoolean eglwDestroySyncKHR (EGLDisplay dpy, EGLSyncKHR sync)
 {
-                                                                                                                                               const eglw::Library* egl = eglw::getCurrentThreadLibrary();
+       const eglw::Library* egl = eglw::getCurrentThreadLibrary();
        if (!egl)
                return (EGLBoolean)0;
        return egl->destroySyncKHR(dpy, sync);
@@ -62,7 +62,7 @@ EGLBoolean eglwDestroySyncKHR (EGLDisplay dpy, EGLSyncKHR sync)
 
 EGLDisplay eglwGetPlatformDisplayEXT (EGLenum platform, void *native_display, const EGLint *attrib_list)
 {
-                                                       const eglw::Library* egl = eglw::getCurrentThreadLibrary();
+       const eglw::Library* egl = eglw::getCurrentThreadLibrary();
        if (!egl)
                return (EGLDisplay)0;
        return egl->getPlatformDisplayEXT(platform, native_display, attrib_list);
@@ -70,7 +70,7 @@ EGLDisplay eglwGetPlatformDisplayEXT (EGLenum platform, void *native_display, co
 
 EGLBoolean eglwGetSyncAttribKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value)
 {
-                                                                       const eglw::Library* egl = eglw::getCurrentThreadLibrary();
+       const eglw::Library* egl = eglw::getCurrentThreadLibrary();
        if (!egl)
                return (EGLBoolean)0;
        return egl->getSyncAttribKHR(dpy, sync, attribute, value);
@@ -78,7 +78,7 @@ EGLBoolean eglwGetSyncAttribKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribu
 
 EGLBoolean eglwLockSurfaceKHR (EGLDisplay dpy, EGLSurface surface, const EGLint *attrib_list)
 {
-                                                                               const eglw::Library* egl = eglw::getCurrentThreadLibrary();
+       const eglw::Library* egl = eglw::getCurrentThreadLibrary();
        if (!egl)
                return (EGLBoolean)0;
        return egl->lockSurfaceKHR(dpy, surface, attrib_list);
@@ -86,7 +86,7 @@ EGLBoolean eglwLockSurfaceKHR (EGLDisplay dpy, EGLSurface surface, const EGLint
 
 EGLBoolean eglwSetDamageRegionKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects)
 {
-                                                               const eglw::Library* egl = eglw::getCurrentThreadLibrary();
+       const eglw::Library* egl = eglw::getCurrentThreadLibrary();
        if (!egl)
                return (EGLBoolean)0;
        return egl->setDamageRegionKHR(dpy, surface, rects, n_rects);
@@ -94,7 +94,7 @@ EGLBoolean eglwSetDamageRegionKHR (EGLDisplay dpy, EGLSurface surface, EGLint *r
 
 EGLBoolean eglwSignalSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode)
 {
-                                                                                                               const eglw::Library* egl = eglw::getCurrentThreadLibrary();
+       const eglw::Library* egl = eglw::getCurrentThreadLibrary();
        if (!egl)
                return (EGLBoolean)0;
        return egl->signalSyncKHR(dpy, sync, mode);
@@ -102,7 +102,7 @@ EGLBoolean eglwSignalSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode)
 
 EGLBoolean eglwSwapBuffersWithDamageKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects)
 {
-                                                       const eglw::Library* egl = eglw::getCurrentThreadLibrary();
+       const eglw::Library* egl = eglw::getCurrentThreadLibrary();
        if (!egl)
                return (EGLBoolean)0;
        return egl->swapBuffersWithDamageKHR(dpy, surface, rects, n_rects);
@@ -110,7 +110,7 @@ EGLBoolean eglwSwapBuffersWithDamageKHR (EGLDisplay dpy, EGLSurface surface, EGL
 
 EGLBoolean eglwUnlockSurfaceKHR (EGLDisplay dpy, EGLSurface surface)
 {
-                                                                                                                               const eglw::Library* egl = eglw::getCurrentThreadLibrary();
+       const eglw::Library* egl = eglw::getCurrentThreadLibrary();
        if (!egl)
                return (EGLBoolean)0;
        return egl->unlockSurfaceKHR(dpy, surface);
@@ -118,8 +118,8 @@ EGLBoolean eglwUnlockSurfaceKHR (EGLDisplay dpy, EGLSurface surface)
 
 EGLint eglwWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags)
 {
-                                                                                                                               const eglw::Library* egl = eglw::getCurrentThreadLibrary();
+       const eglw::Library* egl = eglw::getCurrentThreadLibrary();
        if (!egl)
                return (EGLint)0;
-               return egl->waitSyncKHR(dpy, sync, flags);
+       return egl->waitSyncKHR(dpy, sync, flags);
 }
index bddd035..358b7a2 100644 (file)
@@ -76,16 +76,7 @@ public:
        void                    setSingleValue                                          (const SsboArgData argData);
        bool                    setAllValues                                            (const std::vector<SsboArgData> argDataList);
 
-       const std::string&      getContextVersion                               (void) const;
-       const std::string&      getStdFormat                                    (void) const;
-       const std::string&      getBindingPoint                                 (void) const;
-       const std::string&      getMatrixOrder                                  (void) const;
-       const std::string&      getMemberType                                   (void) const;
-       const std::string&      getMemberName                                   (void) const;
-       const std::string&      getMemberFixedArrayName                 (void) const;
-       const std::string&      getMemberVariableArray                  (void) const;
        bool                            getMemberReorder                                (void) const;
-       int                                     getNumberMembers                                (void) const;
 
        void                            resetValues                                             (void);
 
@@ -177,56 +168,11 @@ bool SsboArgs::setAllValues (const std::vector<SsboArgData> argDataList)
        return true;
 }
 
-const std::string& SsboArgs::getContextVersion (void) const
-{
-       return m_negativeContextVersion;
-}
-
-const std::string& SsboArgs::getStdFormat (void) const
-{
-       return m_stdFormat;
-}
-
-const std::string& SsboArgs::getBindingPoint (void) const
-{
-       return m_bindingPoint;
-}
-
-const std::string& SsboArgs::getMatrixOrder (void) const
-{
-       return m_matrixOrder;
-}
-
-const std::string& SsboArgs::getMemberType (void) const
-{
-       return m_memberType;
-}
-
-const std::string& SsboArgs::getMemberName (void) const
-{
-       return m_memberName;
-}
-
-const std::string& SsboArgs::getMemberFixedArrayName (void) const
-{
-       return m_memberFixedArrayerName;
-}
-
-const std::string& SsboArgs::getMemberVariableArray (void) const
-{
-       return m_memberVariableArray;
-}
-
 bool SsboArgs::getMemberReorder (void) const
 {
        return m_memberReorder;
 }
 
-int SsboArgs::getNumberMembers (void) const
-{
-       return m_numberMembers;
-}
-
 void SsboArgs::resetValues (void)
 {
        setDefaultValues();
index d3f947f..114a624 100644 (file)
@@ -311,11 +311,9 @@ public:
        void            setTextureUnit          (const deUint32 textureUnit);
        void            setIsActive                     (const bool isActive);
 
-       deUint32        getHandle                       (void) const;
        bool            getIsActive                     (void) const;
 
        void            bindToTexture           (void);
-       void            unbindFromTexture       (void);
 
 private:
        const glw::Functions*           m_gl;
@@ -387,11 +385,6 @@ void SRGBTestSampler::setIsActive (const bool isActive)
        m_isActive = isActive;
 }
 
-deUint32 SRGBTestSampler::getHandle (void) const
-{
-       return m_samplerHandle;
-}
-
 bool SRGBTestSampler::getIsActive (void) const
 {
        return m_isActive;
@@ -402,11 +395,6 @@ void SRGBTestSampler::bindToTexture (void)
        m_gl->bindSampler(m_textureUnit, m_samplerHandle);
 }
 
-void SRGBTestSampler::unbindFromTexture (void)
-{
-       m_gl->bindSampler(m_textureUnit, 0);
-}
-
 class SRGBTestTexture
 {
 public:
@@ -430,7 +418,6 @@ public:
        deUint32        getHandle                       (void) const;
        deUint32        getGLTargetType         (void) const;
        SRGBDecode      getDecode                       (void) const;
-       bool            getHasSampler           (void) const;
 
        void            upload                          (void);
 
@@ -565,11 +552,6 @@ SRGBDecode SRGBTestTexture::getDecode (void) const
        return m_decoding;
 }
 
-bool SRGBTestTexture::getHasSampler (void) const
-{
-       return m_hasSampler;
-}
-
 void SRGBTestTexture::upload (void)
 {
        m_source.upload();
@@ -604,14 +586,11 @@ public:
        void                                                    setToggleRequired               (bool toggleRequired);
        void                                                    setUniformToggle                (int location, bool toggleDecodeValue);
 
-       int                                                             getUniformTotal                 (void) const;
        const std::vector<UniformData>& getUniformDataList              (void) const;
        const UniformData&                              getUniformAtLocation    (int location) const;
        int                                                             getUniformLocation              (const std::string& name);
        deUint32                                                getHandle                               (void) const;
        bool                                                    getBlendRequired                (void) const;
-       bool                                                    getToggleRequired               (void) const;
-       const std::string&                              getFragmentShader               (void) const;
 
 private:
        std::string                                             genFunctionCall                 (ShaderSamplingType samplingType, const int uniformIdx);
@@ -713,11 +692,6 @@ void SRGBTestProgram::setUniformToggle (int location, bool toggleDecodeValue)
        }
 }
 
-int SRGBTestProgram::getUniformTotal (void) const
-{
-       return (int)m_uniformDataList.size();
-}
-
 const std::vector<UniformData>& SRGBTestProgram::getUniformDataList (void) const
 {
        return m_uniformDataList;
@@ -752,16 +726,6 @@ bool SRGBTestProgram::getBlendRequired (void) const
        return m_blendRequired;
 }
 
-bool SRGBTestProgram::getToggleRequired (void) const
-{
-       return m_toggleRequired;
-}
-
-const std::string& SRGBTestProgram::getFragmentShader (void) const
-{
-       return m_shaderFragment;
-}
-
 std::string SRGBTestProgram::genFunctionCall (ShaderSamplingType samplingType, const int uniformIdx)
 {
        std::ostringstream functionCall;
@@ -904,13 +868,8 @@ public:
 
        void                                    setSamplingGroup                                (const ShaderSamplingGroup samplingGroup);
        void                                    setSamplingLocations                    (const int px, const int py);
-       void                                    setShaderProgramBlendRequired   (const int programIdx, const bool blend);
-       void                                    setShaderProgramToggleRequired  (const int programIdx, const bool toggle);
        void                                    setUniformToggle                                (const int programIdx, const std::string& uniformName, bool toggleDecode);
 
-       deUint32                                getShaderProgramHandle                  (const int programIdx) const;
-       deUint32                                getTextureHandle                                (const int textureIdx) const;
-
        void                                    addTexture                                              (const glu::TextureTestUtil::TextureType        targetType,
                                                                                                                         const int                                                                      width,
                                                                                                                         const int                                                                      height,
@@ -1104,32 +1063,6 @@ void SRGBTestCase::setSamplingLocations (const int px, const int py)
        m_py = py;
 }
 
-void SRGBTestCase::setShaderProgramBlendRequired (const int programIdx, const bool blend)
-{
-       m_shaderProgramList[programIdx]->setBlendRequired(blend);
-}
-
-void SRGBTestCase::setShaderProgramToggleRequired (const int programIdx, const bool toggle)
-{
-       m_shaderProgramList[programIdx]->setToggleRequired(toggle);
-}
-
-void SRGBTestCase::setUniformToggle (const int programIdx, const std::string& uniformName, bool toggleDecodeValue)
-{
-       int uniformLocation = m_shaderProgramList[programIdx]->getUniformLocation(uniformName);
-       m_shaderProgramList[programIdx]->setUniformToggle(uniformLocation, toggleDecodeValue);
-}
-
-deUint32 SRGBTestCase::getShaderProgramHandle (const int programIdx) const
-{
-       return m_shaderProgramList[programIdx]->getHandle();
-}
-
-deUint32 SRGBTestCase::getTextureHandle (const int textureIdx) const
-{
-       return m_textureSourceList[textureIdx]->getHandle();
-}
-
 void SRGBTestCase::addTexture (        const glu::TextureTestUtil::TextureType targetType,
                                                                const int                                                               width,
                                                                const int                                                               height,
index 182c878..379762b 100644 (file)
@@ -96,5 +96,5 @@ def gen (registry):
        writeInlFile(os.path.join(EGL_WRAPPER_DIR, "eglwApi.inl"), src)
        writeInlFile(os.path.join(EGL_WRAPPER_DIR, "eglwEnumsC.inl"), indentLines(map(enumDefinitionC, defaultIface.enums)))
        genCommandList(noExtIface, commandWrapperDefinition, EGL_WRAPPER_DIR, "eglwImpl.inl")
-       genCommandList(extOnlyIface, commandWrapperDefinition, EGL_WRAPPER_DIR, "eglwImplExt.inl", True)
+       genCommandList(extOnlyIface, commandWrapperDefinition, EGL_WRAPPER_DIR, "eglwImplExt.inl")