From d1ab470542af07425d2b462e284cc616c33dbb17 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 20 Sep 2017 16:58:58 -0400 Subject: DRTVWR-418: Fix C++ errors detected by Xcode 9. You can't legitimately perform an ordered comparison between a pointer and an int, even 0. Fix a number of 'if (ptr > 0)' to plain 'if (ptr)'. Fix LLEditWearableDictionary::WearableEntry constructor to avoid varargs mechanism. It used to accept three different counts, followed by three different lists of enums, fetched in each case as 'int' -- dubious in itself. The constructor body performed three different loops to populate those enums into three different member vectors. Instead, make the constructor accept three vectors and initialize the member vectors from the passed vectors. Now that C++ has inline vector initialization, change existing constructor calls to pass temporary vectors initialized with what used to be the varargs enum values. --- indra/llrender/llglslshader.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 5d669fb955..970502f2d6 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -408,7 +408,7 @@ BOOL LLGLSLShader::createShader(std::vector * attributes, { GLhandleARB shaderhandle = LLShaderMgr::instance()->loadShaderFile((*fileIter).first, mShaderLevel, (*fileIter).second, &mDefines, mFeatures.mIndexedTextureChannels); LL_DEBUGS("ShaderLoading") << "SHADER FILE: " << (*fileIter).first << " mShaderLevel=" << mShaderLevel << LL_ENDL; - if (shaderhandle > 0) + if (shaderhandle) { attachObject(shaderhandle); } @@ -997,7 +997,7 @@ S32 LLGLSLShader::disableTexture(S32 uniform, LLTexUnit::eTextureType mode) void LLGLSLShader::uniform1i(U32 index, GLint x) { - if (mProgramObject > 0) + if (mProgramObject) { if (mUniform.size() <= index) { @@ -1019,7 +1019,7 @@ void LLGLSLShader::uniform1i(U32 index, GLint x) void LLGLSLShader::uniform1f(U32 index, GLfloat x) { - if (mProgramObject > 0) + if (mProgramObject) { if (mUniform.size() <= index) { @@ -1041,7 +1041,7 @@ void LLGLSLShader::uniform1f(U32 index, GLfloat x) void LLGLSLShader::uniform2f(U32 index, GLfloat x, GLfloat y) { - if (mProgramObject > 0) + if (mProgramObject) { if (mUniform.size() <= index) { @@ -1064,7 +1064,7 @@ void LLGLSLShader::uniform2f(U32 index, GLfloat x, GLfloat y) void LLGLSLShader::uniform3f(U32 index, GLfloat x, GLfloat y, GLfloat z) { - if (mProgramObject > 0) + if (mProgramObject) { if (mUniform.size() <= index) { @@ -1087,7 +1087,7 @@ void LLGLSLShader::uniform3f(U32 index, GLfloat x, GLfloat y, GLfloat z) void LLGLSLShader::uniform4f(U32 index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { - if (mProgramObject > 0) + if (mProgramObject) { if (mUniform.size() <= index) { @@ -1110,7 +1110,7 @@ void LLGLSLShader::uniform4f(U32 index, GLfloat x, GLfloat y, GLfloat z, GLfloat void LLGLSLShader::uniform1iv(U32 index, U32 count, const GLint* v) { - if (mProgramObject > 0) + if (mProgramObject) { if (mUniform.size() <= index) { @@ -1133,7 +1133,7 @@ void LLGLSLShader::uniform1iv(U32 index, U32 count, const GLint* v) void LLGLSLShader::uniform1fv(U32 index, U32 count, const GLfloat* v) { - if (mProgramObject > 0) + if (mProgramObject) { if (mUniform.size() <= index) { @@ -1156,7 +1156,7 @@ void LLGLSLShader::uniform1fv(U32 index, U32 count, const GLfloat* v) void LLGLSLShader::uniform2fv(U32 index, U32 count, const GLfloat* v) { - if (mProgramObject > 0) + if (mProgramObject) { if (mUniform.size() <= index) { @@ -1179,7 +1179,7 @@ void LLGLSLShader::uniform2fv(U32 index, U32 count, const GLfloat* v) void LLGLSLShader::uniform3fv(U32 index, U32 count, const GLfloat* v) { - if (mProgramObject > 0) + if (mProgramObject) { if (mUniform.size() <= index) { @@ -1202,7 +1202,7 @@ void LLGLSLShader::uniform3fv(U32 index, U32 count, const GLfloat* v) void LLGLSLShader::uniform4fv(U32 index, U32 count, const GLfloat* v) { - if (mProgramObject > 0) + if (mProgramObject) { if (mUniform.size() <= index) { @@ -1225,7 +1225,7 @@ void LLGLSLShader::uniform4fv(U32 index, U32 count, const GLfloat* v) void LLGLSLShader::uniformMatrix2fv(U32 index, U32 count, GLboolean transpose, const GLfloat *v) { - if (mProgramObject > 0) + if (mProgramObject) { if (mUniform.size() <= index) { @@ -1242,7 +1242,7 @@ void LLGLSLShader::uniformMatrix2fv(U32 index, U32 count, GLboolean transpose, c void LLGLSLShader::uniformMatrix3fv(U32 index, U32 count, GLboolean transpose, const GLfloat *v) { - if (mProgramObject > 0) + if (mProgramObject) { if (mUniform.size() <= index) { @@ -1259,7 +1259,7 @@ void LLGLSLShader::uniformMatrix3fv(U32 index, U32 count, GLboolean transpose, c void LLGLSLShader::uniformMatrix3x4fv(U32 index, U32 count, GLboolean transpose, const GLfloat *v) { - if (mProgramObject > 0) + if (mProgramObject) { if (mUniform.size() <= index) { @@ -1276,7 +1276,7 @@ void LLGLSLShader::uniformMatrix3x4fv(U32 index, U32 count, GLboolean transpose, void LLGLSLShader::uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, const GLfloat *v) { - if (mProgramObject > 0) + if (mProgramObject) { if (mUniform.size() <= index) { @@ -1294,7 +1294,7 @@ void LLGLSLShader::uniformMatrix4fv(U32 index, U32 count, GLboolean transpose, c GLint LLGLSLShader::getUniformLocation(const LLStaticHashedString& uniform) { GLint ret = -1; - if (mProgramObject > 0) + if (mProgramObject) { LLStaticStringTable::iterator iter = mUniformMap.find(uniform); if (iter != mUniformMap.end()) @@ -1318,7 +1318,7 @@ GLint LLGLSLShader::getUniformLocation(const LLStaticHashedString& uniform) GLint LLGLSLShader::getUniformLocation(U32 index) { GLint ret = -1; - if (mProgramObject > 0) + if (mProgramObject) { llassert(index < mUniform.size()); return mUniform[index]; -- cgit v1.2.3