Browse Source

CORRADE_ASSERT() now needs semicolon after.

vectorfields
Vladimír Vondruš 14 years ago
parent
commit
7f55f30ced
  1. 6
      src/AbstractShaderProgram.cpp
  2. 2
      src/Camera.cpp
  3. 2
      src/IndexedMesh.cpp
  4. 2
      src/Mesh.cpp
  5. 2
      src/MeshTools/CombineIndexedArrays.h
  6. 2
      src/MeshTools/FlipNormals.cpp
  7. 2
      src/MeshTools/GenerateFlatNormals.cpp
  8. 4
      src/MeshTools/Interleave.h
  9. 2
      src/MeshTools/Subdivide.h
  10. 4
      src/Object.cpp
  11. 2
      src/Primitives/Capsule.cpp
  12. 2
      src/Primitives/UVSphere.cpp

6
src/AbstractShaderProgram.cpp

@ -39,14 +39,14 @@ bool AbstractShaderProgram::attachShader(Shader& shader) {
}
void AbstractShaderProgram::bindAttributeLocation(GLuint location, const string& name) {
CORRADE_ASSERT(state == Initialized, "AbstractShaderProgram: attribute cannot be bound after linking.", )
CORRADE_ASSERT(state == Initialized, "AbstractShaderProgram: attribute cannot be bound after linking.", );
glBindAttribLocation(program, location, name.c_str());
}
#ifndef MAGNUM_TARGET_GLES
void AbstractShaderProgram::bindFragmentDataLocation(GLuint location, const std::string& name) {
CORRADE_ASSERT(state == Initialized, "AbstractShaderProgram: fragment data location cannot be bound after linking.", )
CORRADE_ASSERT(state == Initialized, "AbstractShaderProgram: fragment data location cannot be bound after linking.", );
glBindFragDataLocation(program, location, name.c_str());
}
@ -83,7 +83,7 @@ void AbstractShaderProgram::link() {
GLint AbstractShaderProgram::uniformLocation(const std::string& name) {
/** @todo What if linking just failed (not programmer error?) */
CORRADE_ASSERT(state == Linked, "AbstractShaderProgram: uniform location cannot be retrieved before linking.", -1)
CORRADE_ASSERT(state == Linked, "AbstractShaderProgram: uniform location cannot be retrieved before linking.", -1);
GLint location = glGetUniformLocation(program, name.c_str());
if(location == -1)

2
src/Camera.cpp

@ -103,7 +103,7 @@ void Camera::fixAspectRatio() {
void Camera::draw() {
Scene* s = scene();
CORRADE_ASSERT(s, "Camera: cannot draw without camera attached to scene", )
CORRADE_ASSERT(s, "Camera: cannot draw without camera attached to scene", );
Framebuffer::clear();

2
src/IndexedMesh.cpp

@ -41,7 +41,7 @@ void IndexedMesh::draw() {
void IndexedMesh::finalize() {
if(isFinalized()) return;
CORRADE_ASSERT(_indexCount, "IndexedMesh: the mesh has zero index count!", )
CORRADE_ASSERT(_indexCount, "IndexedMesh: the mesh has zero index count!", );
/* Finalize attribute positions */
Mesh::finalize();

2
src/Mesh.cpp

@ -78,7 +78,7 @@ void Mesh::finalize() {
/* Already finalized */
if(finalized) return;
CORRADE_ASSERT(_vertexCount, "Mesh: the mesh has zero vertex count!", )
CORRADE_ASSERT(_vertexCount, "Mesh: the mesh has zero vertex count!", );
/* Finalize attribute positions for every buffer */
for(auto& it: _buffers) {

2
src/MeshTools/CombineIndexedArrays.h

@ -57,7 +57,7 @@ class CombineIndexedArrays {
private:
template<class ...T> inline static size_t indexCount(const std::vector<unsigned int>& first, const std::vector<T>&... next) {
CORRADE_ASSERT(sizeof...(next) == 0 || indexCount(next...) == first.size(), "MeshTools::combineIndexedArrays(): index arrays don't have the same length, nothing done.", 0)
CORRADE_ASSERT(sizeof...(next) == 0 || indexCount(next...) == first.size(), "MeshTools::combineIndexedArrays(): index arrays don't have the same length, nothing done.", 0);
return first.size();
}

2
src/MeshTools/FlipNormals.cpp

@ -20,7 +20,7 @@ using namespace std;
namespace Magnum { namespace MeshTools {
void flipFaceWinding(vector<unsigned int>& indices) {
CORRADE_ASSERT(!(indices.size()%3), "MeshTools::flipNormals(): index count is not divisible by 3!", )
CORRADE_ASSERT(!(indices.size()%3), "MeshTools::flipNormals(): index count is not divisible by 3!", );
for(size_t i = 0; i != indices.size(); i += 3)
swap(indices[i+1], indices[i+2]);

2
src/MeshTools/GenerateFlatNormals.cpp

@ -22,7 +22,7 @@ using namespace std;
namespace Magnum { namespace MeshTools {
tuple<vector<unsigned int>, vector<Vector3>> generateFlatNormals(const std::vector< unsigned int >& indices, const vector< Vector4 >& vertices) {
CORRADE_ASSERT(!(indices.size()%3), "MeshTools::generateFlatNormals(): index count is not divisible by 3!", (tuple<vector<unsigned int>, vector<Vector3>>()))
CORRADE_ASSERT(!(indices.size()%3), "MeshTools::generateFlatNormals(): index count is not divisible by 3!", (tuple<vector<unsigned int>, vector<Vector3>>()));
/* Create normal for every triangle (assuming counterclockwise winding) */
vector<unsigned int> normalIndices;

4
src/MeshTools/Interleave.h

@ -53,7 +53,7 @@ class Interleave {
}
template<class ...T> void operator()(Mesh* mesh, Buffer* buffer, Buffer::Usage usage, const T&... attributes) {
CORRADE_ASSERT(mesh->isInterleaved(buffer), "MeshTools::interleave(): the buffer is not interleaved, nothing done", )
CORRADE_ASSERT(mesh->isInterleaved(buffer), "MeshTools::interleave(): the buffer is not interleaved, nothing done", );
operator()(attributes...);
@ -64,7 +64,7 @@ class Interleave {
}
template<class T, class ...U> inline static size_t attributeCount(const T& first, const U&... next) {
CORRADE_ASSERT(sizeof...(next) == 0 || attributeCount(next...) == first.size(), "MeshTools::interleave(): attribute arrays don't have the same length, nothing done.", 0)
CORRADE_ASSERT(sizeof...(next) == 0 || attributeCount(next...) == first.size(), "MeshTools::interleave(): attribute arrays don't have the same length, nothing done.", 0);
return first.size();
}

2
src/MeshTools/Subdivide.h

@ -32,7 +32,7 @@ template<class Vertex, class Interpolator> class Subdivide {
inline Subdivide(std::vector<unsigned int>& indices, std::vector<Vertex>& vertices): indices(indices), vertices(vertices) {}
void operator()(Interpolator interpolator) {
CORRADE_ASSERT(!(indices.size()%3), "MeshTools::subdivide(): index count is not divisible by 3!", )
CORRADE_ASSERT(!(indices.size()%3), "MeshTools::subdivide(): index count is not divisible by 3!", );
size_t indexCount = indices.size();
indices.reserve(indices.size()*4);

4
src/Object.cpp

@ -64,7 +64,7 @@ Matrix4 Object::absoluteTransformation(Camera* camera) {
/* We got to the scene, multiply with camera matrix */
if(p->parent() == p) {
if(camera) {
CORRADE_ASSERT(camera->scene() == scene(), "Object::absoluteTransformation(): the camera is not part of the same scene as object!", t)
CORRADE_ASSERT(camera->scene() == scene(), "Object::absoluteTransformation(): the camera is not part of the same scene as object!", t);
t = camera->cameraMatrix()*t;
}
@ -74,7 +74,7 @@ Matrix4 Object::absoluteTransformation(Camera* camera) {
p = p->parent();
}
CORRADE_ASSERT(p != nullptr || camera == nullptr, "Object::absoluteTransformation(): the object is not part of camera scene!", t)
CORRADE_ASSERT(p != nullptr || camera == nullptr, "Object::absoluteTransformation(): the object is not part of camera scene!", t);
return t;
}

2
src/Primitives/Capsule.cpp

@ -20,7 +20,7 @@ using namespace std;
namespace Magnum { namespace Primitives {
Capsule::Capsule(unsigned int rings, unsigned int segments, GLfloat length, TextureCoords textureCoords): MeshData("", Mesh::Primitive::Triangles, new vector<unsigned int>, {new vector<Vector4>()}, {new vector<Vector3>()}, textureCoords == TextureCoords::Generate ? vector<vector<Vector2>*>{new vector<Vector2>()} : vector<vector<Vector2>*>()), segments(segments), textureCoords(textureCoords) {
CORRADE_ASSERT(rings >= 1 && segments >= 3, "Capsule must have at least one ring and three segments", )
CORRADE_ASSERT(rings >= 1 && segments >= 3, "Capsule must have at least one ring and three segments", );
GLfloat height = 2.0f+length;
GLfloat textureCoordsVIncrement = 1.0f/(rings*height);

2
src/Primitives/UVSphere.cpp

@ -20,7 +20,7 @@ using namespace std;
namespace Magnum { namespace Primitives {
UVSphere::UVSphere(unsigned int rings, unsigned int segments, TextureCoords textureCoords): Capsule(segments, textureCoords) {
CORRADE_ASSERT(rings >= 2 && segments >= 3, "UVSphere must have at least two rings and three segments", )
CORRADE_ASSERT(rings >= 2 && segments >= 3, "UVSphere must have at least two rings and three segments", );
GLfloat textureCoordsVIncrement = 1.0f/rings;
GLfloat ringAngleIncrement = Math::Constants<GLfloat>::pi()/rings;

Loading…
Cancel
Save