From c463526feb299eb16c53d4d1f212bd927d592f5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 8 Jan 2016 22:56:29 +0100 Subject: [PATCH] Don't yell at people. Also minor cleanup and string copy optimization. --- src/Magnum/AbstractShaderProgram.cpp | 4 ++-- src/Magnum/Test/AbstractShaderProgramGLTest.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Magnum/AbstractShaderProgram.cpp b/src/Magnum/AbstractShaderProgram.cpp index ccd222392..709dc3263 100644 --- a/src/Magnum/AbstractShaderProgram.cpp +++ b/src/Magnum/AbstractShaderProgram.cpp @@ -395,9 +395,9 @@ bool AbstractShaderProgram::link(std::initializer_list name) { - GLint location = glGetUniformLocation(_id, name); + const GLint location = glGetUniformLocation(_id, name); if(location == -1) - Warning() << "AbstractShaderProgram: location of uniform \'" + std::string{name, name.size()} + "\' cannot be retrieved!"; + Warning() << "AbstractShaderProgram: location of uniform \'" << Debug::nospace << std::string{name, name.size()} << Debug::nospace << "\' cannot be retrieved"; return location; } diff --git a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp index 259ad94d2..72791d79c 100644 --- a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp +++ b/src/Magnum/Test/AbstractShaderProgramGLTest.cpp @@ -51,7 +51,7 @@ struct AbstractShaderProgramGLTest: AbstractOpenGLTester { void createMultipleOutputsIndexed(); #endif - void uniformLocationOptimizedOut(); + void uniformNotFound(); void uniform(); void uniformVector(); void uniformMatrix(); @@ -71,7 +71,7 @@ AbstractShaderProgramGLTest::AbstractShaderProgramGLTest() { &AbstractShaderProgramGLTest::createMultipleOutputsIndexed, #endif - &AbstractShaderProgramGLTest::uniformLocationOptimizedOut, + &AbstractShaderProgramGLTest::uniformNotFound, &AbstractShaderProgramGLTest::uniform, &AbstractShaderProgramGLTest::uniformVector, &AbstractShaderProgramGLTest::uniformMatrix, @@ -320,7 +320,7 @@ void AbstractShaderProgramGLTest::createMultipleOutputsIndexed() { } #endif -void AbstractShaderProgramGLTest::uniformLocationOptimizedOut() { +void AbstractShaderProgramGLTest::uniformNotFound() { MyPublicShader program; #ifndef MAGNUM_TARGET_GLES @@ -361,8 +361,8 @@ void AbstractShaderProgramGLTest::uniformLocationOptimizedOut() { program.uniformLocation("nonexistent"); program.uniformLocation(std::string{"another"}); CORRADE_COMPARE(out.str(), - "AbstractShaderProgram: location of uniform 'nonexistent' cannot be retrieved!\n" - "AbstractShaderProgram: location of uniform 'another' cannot be retrieved!\n"); + "AbstractShaderProgram: location of uniform 'nonexistent' cannot be retrieved\n" + "AbstractShaderProgram: location of uniform 'another' cannot be retrieved\n"); } namespace {