From 26792835b56261b0a0080ea010205a0b3134830c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Wed, 10 Jun 2009 16:34:49 +0200 Subject: Fixed a compile failure on Solaris, really :) You can't static_cast from a signed to an unsigned type and vice versa. Reviewed-by: Kim --- demos/boxes/glshaders.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/demos/boxes/glshaders.cpp b/demos/boxes/glshaders.cpp index 05bbf71bf3..094fd77c73 100644 --- a/demos/boxes/glshaders.cpp +++ b/demos/boxes/glshaders.cpp @@ -58,7 +58,7 @@ GLShader::GLShader(const char *data, int size, GLenum shaderType) m_shader = glCreateShaderObjectARB(shaderType); GLint glSize = size; - glShaderSourceARB(m_shader, 1, static_cast(&data), &glSize); + glShaderSourceARB(m_shader, 1, reinterpret_cast(&data), &glSize); glCompileShaderARB(m_shader); int status; glGetObjectParameterivARB(m_shader, GL_OBJECT_COMPILE_STATUS_ARB, &status); @@ -79,7 +79,7 @@ GLShader::GLShader(const QString& fileName, GLenum shaderType) GLint size = file.size(); const char *p = bytes.data(); file.close(); - glShaderSourceARB(m_shader, 1, static_cast(&p), &size); + glShaderSourceARB(m_shader, 1, reinterpret_cast(&p), &size); glCompileShaderARB(m_shader); int status; glGetObjectParameterivARB(m_shader, GL_OBJECT_COMPILE_STATUS_ARB, &status); @@ -105,7 +105,7 @@ QString GLShader::log() glGetObjectParameterivARB(m_shader, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length); char *log = new char[length + 1]; GLsizei glLength = length; - glGetInfoLogARB(m_shader, glLength, &glLength, static_cast(log)); + glGetInfoLogARB(m_shader, glLength, &glLength, reinterpret_cast(log)); log[glLength] = '\0'; QString result(log); delete log; @@ -184,7 +184,7 @@ QString GLProgram::log() glGetObjectParameterivARB(m_program, GL_OBJECT_INFO_LOG_LENGTH_ARB, &length); char *log = new char[length + 1]; GLsizei glLength = length; - glGetInfoLogARB(m_program, glLength, &glLength, static_cast(log)); + glGetInfoLogARB(m_program, glLength, &glLength, reinterpret_cast(log)); log[glLength] = '\0'; QString result(log); delete log; @@ -212,7 +212,7 @@ bool GLProgram::hasParameter(const QString& name) if (!failed()) { QByteArray asciiName = name.toAscii(); - return -1 != glGetUniformLocationARB(m_program, static_cast(asciiName.data())); + return -1 != glGetUniformLocationARB(m_program, reinterpret_cast(asciiName.data())); } return false; } @@ -223,7 +223,7 @@ void GLProgram::setInt(const QString& name, int value) if (!failed()) { QByteArray asciiName = name.toAscii(); - int loc = glGetUniformLocationARB(m_program, static_cast(asciiName.data())); + int loc = glGetUniformLocationARB(m_program, reinterpret_cast(asciiName.data())); glUniform1iARB(loc, value); } } @@ -234,7 +234,7 @@ void GLProgram::setFloat(const QString& name, float value) if (!failed()) { QByteArray asciiName = name.toAscii(); - int loc = glGetUniformLocationARB(m_program, static_cast(asciiName.data())); + int loc = glGetUniformLocationARB(m_program, reinterpret_cast(asciiName.data())); glUniform1fARB(loc, value); } } @@ -246,7 +246,7 @@ void GLProgram::setColor(const QString& name, QRgb value) //qDebug() << "Setting color" << name; if (!failed()) { QByteArray asciiName = name.toAscii(); - int loc = glGetUniformLocationARB(m_program, static_cast(asciiName.data())); + int loc = glGetUniformLocationARB(m_program, reinterpret_cast(asciiName.data())); //qDebug() << "Location of" << name << "is" << loc; QColor color(value); glUniform4fARB(loc, color.redF(), color.greenF(), color.blueF(), color.alphaF()); @@ -259,7 +259,7 @@ void GLProgram::setMatrix(const QString& name, const gfx::Matrix4x4f &mat) if (!failed()) { QByteArray asciiName = name.toAscii(); - int loc = glGetUniformLocationARB(m_program, static_cast(asciiName.data())); + int loc = glGetUniformLocationARB(m_program, reinterpret_cast(asciiName.data())); //qDebug() << "Location of" << name << "is" << loc; glUniformMatrix4fvARB(loc, 1, GL_FALSE, mat.bits()); } -- cgit v1.2.3