]> git.tdb.fi Git - libs/gl.git/commitdiff
Fix compiler warnings
authorMikko Rasa <tdb@tdb.fi>
Wed, 25 Jul 2012 19:48:44 +0000 (22:48 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 25 Jul 2012 19:50:49 +0000 (22:50 +0300)
source/pixelformat.h
source/program.cpp
source/shader.cpp
source/shadowmap.cpp

index dfe632b6c5f184870e9773dd5fad00b84af4ace1..145e2a3861d835517eb5493d755d1a8904cf2b1f 100644 (file)
@@ -35,7 +35,7 @@ enum PixelFormat
        LUMINANCE_ALPHA    = GL_LUMINANCE_ALPHA,
        LUMINANCE_ALPHA8   = GL_LUMINANCE8_ALPHA8,
        LUMINANCE_ALPHA16F = GL_LUMINANCE_ALPHA16F_ARB,
-       LUMINANCE_ALPHA32F = GL_LUMINANCE_ALPHA32F_ARB,
+       LUMINANCE_ALPHA32F = GL_LUMINANCE_ALPHA32F_ARB
 };
 
 void operator>>(const LexicalConverter &, PixelFormat &);
index 8511b8c15833c3f5f62e2e707e56279092952a97..f6eaed1ee4eeb8bdb0853af07423ecbdbae5ef4d 100644 (file)
@@ -240,9 +240,11 @@ string Program::get_info_log() const
 {
        GLsizei len = 0;
        glGetObjectParameterivARB(id, GL_OBJECT_INFO_LOG_LENGTH_ARB, &len);
-       char log[len+1];
-       glGetInfoLogARB(id, len+1, &len, log);
-       return string(log, len);
+       char *buf = new char[len+1];
+       glGetInfoLogARB(id, len+1, &len, buf);
+       string log(buf, len);
+       delete[] buf;
+       return log;
 }
 
 void Program::bind() const
index 0f60edcd6195324db4201dac50feda4fa98b6489..cdb50c969d59edaf2dfc7edc044579192632eed7 100644 (file)
@@ -66,9 +66,11 @@ string Shader::get_info_log() const
 {
        GLsizei len = 0;
        glGetObjectParameterivARB(id, GL_OBJECT_INFO_LOG_LENGTH_ARB, &len);
-       char log[len+1];
-       glGetInfoLogARB(id, len+1, &len, log);
-       return string(log, len);
+       char *buf = new char[len+1];
+       glGetInfoLogARB(id, len+1, &len, buf);
+       string log(buf, len);
+       delete[] buf;
+       return log;
 }
 
 } // namespace GL
index 42e636a3456865493218aeffbf673f26ba956452..11403c6dfb8cb1d48225cd619f01153eec263956 100644 (file)
@@ -102,9 +102,9 @@ void ShadowMap::prepare()
 
        depth_buf.bind_to(unit);
        float diam = radius*2;
-       float s_eq[4] = { matrix[0]/diam, matrix[4]/diam, matrix[8]/diam, matrix[12]/diam+0.5 };
-       float t_eq[4] = { matrix[1]/diam, matrix[5]/diam, matrix[9]/diam, matrix[13]/diam+0.5 };
-       float r_eq[4] = { -matrix[2]/diam, -matrix[6]/diam, -matrix[10]/diam, 0.5-matrix[14]/diam-4.0/size };
+       float s_eq[4] = { matrix[0]/diam, matrix[4]/diam, matrix[8]/diam, matrix[12]/diam+0.5f };
+       float t_eq[4] = { matrix[1]/diam, matrix[5]/diam, matrix[9]/diam, matrix[13]/diam+0.5f };
+       float r_eq[4] = { -matrix[2]/diam, -matrix[6]/diam, -matrix[10]/diam, 0.5f-matrix[14]/diam-4.0f/size };
        glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
        glTexGenfv(GL_S, GL_EYE_PLANE, s_eq);
        enable(GL_TEXTURE_GEN_S);