fix some warnings

Fri, 07 Feb 2020 02:02:16 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Fri, 07 Feb 2020 02:02:16 +0200
changeset 50
0f80a2e5e42b
parent 49
d56cc7387dad
child 51
1a9eac27698d

fix some warnings

src/gl/compiler.cpp file | annotate | diff | comparison | revisions
src/gl/compiler.h file | annotate | diff | comparison | revisions
--- a/src/gl/compiler.cpp	Fri Feb 07 02:01:21 2020 +0200
+++ b/src/gl/compiler.cpp	Fri Feb 07 02:02:16 2020 +0200
@@ -166,7 +166,7 @@
 			object.program->setAttributeBuffer(0, GL_FLOAT, offsetof(gl::Vertex, position), 3, stride);
 			object.program->setAttributeBuffer(1, GL_FLOAT, offsetof(gl::Vertex, color), 4, stride);
 			object.program->setAttributeBuffer(2, GL_FLOAT, offsetof(gl::Vertex, normal), 3, stride);
-			glVertexAttribIPointer(3, 1, GL_INT, stride, (void*)offsetof(gl::Vertex, id));
+			glVertexAttribIPointer(3, 1, GL_INT, stride, reinterpret_cast<void*>(offsetof(gl::Vertex, id)));
 			object.vertexArray.release();
 			object.buffer.release();
 			object.program->release();
@@ -266,7 +266,7 @@
 	return boxCenter(this->boundingBox);
 }
 
-double gl::Compiler::modelDistance() const
+float gl::Compiler::modelDistance() const
 {
 	return longestMeasure(this->boundingBox);
 }
--- a/src/gl/compiler.h	Fri Feb 07 02:01:21 2020 +0200
+++ b/src/gl/compiler.h	Fri Feb 07 02:02:16 2020 +0200
@@ -55,7 +55,7 @@
 	std::size_t vertexCount(gl::ArrayClass arrayClass) const;
 	QColor getColorForPolygon(const gl::Polygon& polygon, const RenderPreferences& preferences);
 	glm::vec3 modelCenter() const;
-	double modelDistance() const;
+	float modelDistance() const;
 	void initialize();
 	void bindVertexArray(gl::ArrayClass arrayClass);
 	void releaseVertexArray(gl::ArrayClass arrayClass);

mercurial