Browse Source

Anonymized unused function parameters.

vectorfields
Vladimír Vondruš 14 years ago
parent
commit
45d1cb1225
  1. 11
      src/Contexts/GlutContext.h
  2. 2
      src/Contexts/Sdl2Context.cpp
  3. 17
      src/Contexts/Sdl2Context.h
  4. 2
      src/Math/Math.h
  5. 6
      src/Math/Matrix.h
  6. 4
      src/Math/Vector.h
  7. 2
      src/MeshTools/Interleave.h
  8. 4
      src/MeshTools/Test/CleanTest.h
  9. 4
      src/MeshTools/Test/SubdivideTest.h
  10. 11
      src/Object.h
  11. 2
      src/Scene.h
  12. 4
      src/Trade/AbstractImporter.cpp
  13. 62
      src/Trade/AbstractImporter.h

11
src/Contexts/GlutContext.h

@ -127,7 +127,7 @@ class GlutContext: public AbstractContext {
*
* Called when an key is pressed. Default implementation does nothing.
*/
virtual inline void keyEvent(Key key, const Math::Vector2<int>& position) {}
virtual void keyEvent(Key key, const Math::Vector2<int>& position);
/*@}*/
@ -182,7 +182,7 @@ class GlutContext: public AbstractContext {
* Called when mouse button is pressed or released. Default
* implementation does nothing.
*/
virtual inline void mouseEvent(MouseButton button, MouseState state, const Math::Vector2<int>& position) {}
virtual void mouseEvent(MouseButton button, MouseState state, const Math::Vector2<int>& position);
/**
* @brief Mouse motion event
@ -192,7 +192,7 @@ class GlutContext: public AbstractContext {
*
* @see setMouseTracking()
*/
virtual inline void mouseMotionEvent(const Math::Vector2<int>& position) {}
virtual void mouseMotionEvent(const Math::Vector2<int>& position);
/*@}*/
@ -223,6 +223,11 @@ class GlutContext: public AbstractContext {
char** argv;
};
/* Implementations for inline functions with unused parameters */
inline void GlutContext::keyEvent(GlutContext::Key, const Math::Vector2<int>&) {}
inline void GlutContext::mouseEvent(GlutContext::MouseButton, GlutContext::MouseState, const Math::Vector2<int>&) {}
inline void GlutContext::mouseMotionEvent(const Math::Vector2<int>&) {}
}}
#endif

2
src/Contexts/Sdl2Context.cpp

@ -17,7 +17,7 @@
namespace Magnum { namespace Contexts {
Sdl2Context::Sdl2Context(int argc, char** argv, const std::string& name, const Math::Vector2<GLsizei>& size): _redraw(true) {
Sdl2Context::Sdl2Context(int, char**, const std::string& name, const Math::Vector2<GLsizei>& size): _redraw(true) {
if(SDL_Init(SDL_INIT_VIDEO) < 0) {
Error() << "Cannot initialize SDL.";
exit(1);

17
src/Contexts/Sdl2Context.h

@ -96,13 +96,13 @@ class Sdl2Context: public AbstractContext {
* @param key Key pressed
* @param repeat Non-zero if this is a key repeat
*/
inline virtual void keyPressEvent(Key key, Uint8 repeat) {}
virtual void keyPressEvent(Key key, Uint8 repeat);
/**
* @brief Key release event
* @param key Key release
*/
inline virtual void keyReleaseEvent(Key key) {}
virtual void keyReleaseEvent(Key key);
/*@}*/
@ -138,7 +138,7 @@ class Sdl2Context: public AbstractContext {
* Called when mouse button is pressed or released. Default
* implementation does nothing.
*/
virtual inline void mouseEvent(MouseButton button, MouseState state, const Math::Vector2<int>& position) {}
virtual void mouseEvent(MouseButton button, MouseState state, const Math::Vector2<int>& position);
/**
* @brief Mouse wheel event
@ -148,7 +148,7 @@ class Sdl2Context: public AbstractContext {
* Called when mouse wheel is rotated. Default implementation does
* nothing.
*/
virtual inline void mouseWheelEvent(const Math::Vector2<int>& direction) {}
virtual void mouseWheelEvent(const Math::Vector2<int>& direction);
/**
* @brief Mouse motion event
@ -157,7 +157,7 @@ class Sdl2Context: public AbstractContext {
*
* Called when mouse is moved. Default implementation does nothing.
*/
virtual inline void mouseMotionEvent(const Math::Vector2<int>& position, const Math::Vector2<int>& delta) {}
virtual void mouseMotionEvent(const Math::Vector2<int>& position, const Math::Vector2<int>& delta);
/*@}*/
@ -168,6 +168,13 @@ class Sdl2Context: public AbstractContext {
bool _redraw;
};
/* Implementations for inline functions with unused parameters */
inline void Sdl2Context::keyPressEvent(Sdl2Context::Key, Uint8) {}
inline void Sdl2Context::keyReleaseEvent(Sdl2Context::Key) {}
inline void Sdl2Context::mouseEvent(Sdl2Context::MouseButton, Sdl2Context::MouseState, const Math::Vector2<int>&) {}
inline void Sdl2Context::mouseWheelEvent(const Math::Vector2<int>&) {}
inline void Sdl2Context::mouseMotionEvent(const Math::Vector2<int>&, const Math::Vector2<int>&) {}
}}
#endif

2
src/Math/Math.h

@ -64,7 +64,7 @@ namespace Implementation {
}
};
template<> struct Pow<0> {
template<class T> inline constexpr T operator()(T base) const { return 1; }
template<class T> inline constexpr T operator()(T) const { return 1; }
};
}
#endif

6
src/Math/Matrix.h

@ -117,10 +117,10 @@ template<size_t size, class T> class Matrix {
#endif
/** @brief Copy constructor */
inline constexpr Matrix(const Matrix<size, T>& other) = default;
inline constexpr Matrix(const Matrix<size, T>&) = default;
/** @brief Assignment operator */
inline Matrix<size, T>& operator=(const Matrix<size, T>& other) = default;
inline Matrix<size, T>& operator=(const Matrix<size, T>&) = default;
/**
* @brief Raw data
@ -244,7 +244,7 @@ template<size_t size, class T> class Matrix {
return from(s, next..., first[sequence]...);
}
template<size_t ...sequence, class ...U> inline constexpr static Matrix<size, T> from(Implementation::Sequence<sequence...> s, T first, U... next) {
template<size_t ...sequence, class ...U> inline constexpr static Matrix<size, T> from(Implementation::Sequence<sequence...>, T first, U... next) {
return Matrix<size, T>(first, next...);
}

4
src/Math/Vector.h

@ -109,10 +109,10 @@ template<size_t size, class T> class Vector {
}
/** @brief Copy constructor */
inline constexpr Vector(const Vector<size, T>& other) = default;
inline constexpr Vector(const Vector<size, T>&) = default;
/** @brief Assignment operator */
inline Vector<size, T>& operator=(const Vector<size, T>& other) = default;
inline Vector<size, T>& operator=(const Vector<size, T>&) = default;
/**
* @brief Raw data

2
src/MeshTools/Interleave.h

@ -69,7 +69,7 @@ class Interleave {
return first.size();
}
template<class T, class ...U> inline static size_t stride(const T& first, const U&... next) {
template<class T, class ...U> inline static size_t stride(const T&, const U&... next) {
return sizeof(typename T::value_type) + stride(next...);
}

4
src/MeshTools/Test/CleanTest.h

@ -33,8 +33,8 @@ class CleanTest: public QObject {
Vector1(): data(0) {}
Vector1(int i): data(i) {}
int operator[](size_t i) const { return data; }
int& operator[](size_t i) { return data; }
int operator[](size_t) const { return data; }
int& operator[](size_t) { return data; }
bool operator==(Vector1 i) const { return i.data == data; }
Vector1 operator-(Vector1 i) const { return data-i.data; }

4
src/MeshTools/Test/SubdivideTest.h

@ -34,8 +34,8 @@ class SubdivideTest: public QObject {
Vector1(): data(0) {}
Vector1(int i): data(i) {}
int operator[](size_t i) const { return data; }
int& operator[](size_t i) { return data; }
int operator[](size_t) const { return data; }
int& operator[](size_t) { return data; }
bool operator==(Vector1 i) const { return i.data == data; }
Vector1 operator-(Vector1 i) const { return data-i.data; }

11
src/Object.h

@ -178,7 +178,7 @@ class MAGNUM_EXPORT Object {
*
* Default implementation does nothing.
*/
virtual void draw(const Matrix4& transformationMatrix, Camera* camera) {}
virtual void draw(const Matrix4& transformationMatrix, Camera* camera);
/** @{ @name Caching helpers
*
@ -253,9 +253,7 @@ class MAGNUM_EXPORT Object {
* }
* @endcode
*/
virtual inline void clean(const Matrix4& absoluteTransformation) {
dirty = false;
}
virtual void clean(const Matrix4& absoluteTransformation);
/*@}*/
@ -266,6 +264,11 @@ class MAGNUM_EXPORT Object {
bool dirty;
};
/* Implementations for inline functions with unused parameters */
inline void Object::draw(const Matrix4&, Camera*) {}
inline void Object::clean(const Matrix4&) { dirty = false; }
}
#endif

2
src/Scene.h

@ -39,7 +39,7 @@ class MAGNUM_EXPORT Scene: public Object {
void rotate(GLfloat angle, Vector3 vec, Transformation type = Transformation::Global) = delete;
private:
inline virtual void draw(const Magnum::Matrix4& transformationMatrix, Camera* camera) {}
inline void draw(const Magnum::Matrix4&, Camera*) {}
};
}

4
src/Trade/AbstractImporter.cpp

@ -19,12 +19,12 @@ using namespace std;
namespace Magnum { namespace Trade {
bool AbstractImporter::open(const std::string& filename) {
bool AbstractImporter::open(const std::string&) {
Error() << plugin() << "doesn't support opening files";
return false;
}
bool AbstractImporter::open(std::istream& in) {
bool AbstractImporter::open(std::istream&) {
Error() << plugin() << "doesn't support opening input streams";
return false;
}

62
src/Trade/AbstractImporter.h

@ -121,7 +121,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* If no scene for given name exists, returns -1.
* @see SceneData::name()
*/
virtual inline int sceneForName(const std::string& name) { return -1; }
virtual int sceneForName(const std::string& name);
/**
* @brief %Scene
@ -129,7 +129,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
*
* Returns pointer to given scene or nullptr, if no such scene exists.
*/
virtual inline SceneData* scene(unsigned int id) { return nullptr; }
virtual SceneData* scene(unsigned int id);
/** @brief %Light count */
virtual inline unsigned int lightCount() const { return 0; }
@ -140,7 +140,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* If no light for given name exists, returns -1.
* @see LightData::name()
*/
virtual inline int lightForName(const std::string& name) { return -1; }
virtual int lightForName(const std::string& name);
/**
* @brief %Light
@ -148,7 +148,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
*
* Returns pointer to given light or nullptr, if no such light exists.
*/
virtual inline LightData* light(unsigned int id) { return nullptr; }
virtual LightData* light(unsigned int id);
/** @brief %Camera count */
virtual inline unsigned int cameraCount() const { return 0; }
@ -159,7 +159,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* If no camera for given name exists, returns -1.
* @see CameraData::name()
*/
virtual inline int cameraForName(const std::string& name) { return -1; }
virtual int cameraForName(const std::string& name);
/**
* @brief %Camera
@ -168,7 +168,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* Returns pointer to given camera or nullptr, if no such camera
* exists.
*/
virtual inline CameraData* camera(unsigned int id) { return nullptr; }
virtual CameraData* camera(unsigned int id);
/** @brief %Object count */
virtual inline unsigned int objectCount() const { return 0; }
@ -179,7 +179,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* If no scene for given name exists, returns -1.
* @see ObjectData::name()
*/
virtual inline int objectForName(const std::string& name) { return -1; }
virtual int objectForName(const std::string& name);
/**
* @brief %Object
@ -188,7 +188,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* Returns pointer to given object or nullptr, if no such object
* exists.
*/
virtual inline ObjectData* object(unsigned int id) { return nullptr; }
virtual ObjectData* object(unsigned int id);
/** @brief %Mesh count */
virtual inline unsigned int meshCount() const { return 0; }
@ -199,7 +199,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* If no mesh for given name exists, returns -1.
* @see MeshData::name()
*/
virtual inline int meshForName(const std::string& name) { return -1; }
virtual int meshForName(const std::string& name);
/**
* @brief %Mesh
@ -207,7 +207,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
*
* Returns pointer to given mesh or nullptr, if no such mesh exists.
*/
virtual inline MeshData* mesh(unsigned int id) { return nullptr; }
virtual MeshData* mesh(unsigned int id);
/** @brief Material count */
virtual inline unsigned int materialCount() const { return 0; }
@ -218,7 +218,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* If no material for given name exists, returns -1.
* @see AbstractMaterialData::name()
*/
virtual inline int materialForName(const std::string& name) { return -1; }
virtual int materialForName(const std::string& name);
/**
* @brief Material
@ -227,7 +227,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* Returns pointer to given material or nullptr, if no such material
* exists.
*/
virtual inline AbstractMaterialData* material(unsigned int id) { return nullptr; }
virtual AbstractMaterialData* material(unsigned int id);
/** @brief %Texture count */
virtual inline unsigned int textureCount() const { return 0; }
@ -238,7 +238,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* If no texture for given name exists, returns -1.
* @see TextureData::name()
*/
virtual inline int textureForName(const std::string& name) { return -1; }
virtual int textureForName(const std::string& name);
/**
* @brief %Texture
@ -247,7 +247,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* Returns pointer to given texture or nullptr, if no such texture
* exists.
*/
virtual inline TextureData* texture(unsigned int id) { return nullptr; }
virtual TextureData* texture(unsigned int id);
/** @brief One-dimensional image count */
virtual inline unsigned int image1DCount() const { return 0; }
@ -258,7 +258,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* If no image for given name exists, returns -1.
* @see ImageData1D::name()
*/
virtual inline int image1DForName(const std::string& name) { return -1; }
virtual int image1DForName(const std::string& name);
/**
* @brief One-dimensional image
@ -266,7 +266,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
*
* Returns pointer to given image or nullptr, if no such image exists.
*/
virtual inline ImageData1D* image1D(unsigned int id) { return nullptr; }
virtual ImageData1D* image1D(unsigned int id);
/** @brief Two-dimensional image count */
virtual inline unsigned int image2DCount() const { return 0; }
@ -277,7 +277,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* If no image for given name exists, returns -1.
* @see ImageData2D::name()
*/
virtual inline int image2DForName(const std::string& name) { return -1; }
virtual int image2DForName(const std::string& name);
/**
* @brief Two-dimensional image
@ -285,7 +285,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
*
* Returns pointer to given image or nullptr, if no such image exists.
*/
virtual inline ImageData2D* image2D(unsigned int id) { return nullptr; }
virtual ImageData2D* image2D(unsigned int id);
/** @brief Three-dimensional image count */
virtual inline unsigned int image3DCount() const { return 0; }
@ -296,7 +296,7 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
* If no image for given name exists, returns -1.
* @see ImageData3D::name()
*/
virtual inline int image3DForName(const std::string& name) { return -1; }
virtual int image3DForName(const std::string& name);
/**
* @brief Three-dimensional image
@ -304,13 +304,35 @@ class MAGNUM_EXPORT AbstractImporter: public Corrade::PluginManager::Plugin {
*
* Returns pointer to given image or nullptr, if no such image exists.
*/
virtual inline ImageData3D* image3D(unsigned int id) { return nullptr; }
virtual ImageData3D* image3D(unsigned int id);
/*@}*/
};
SET_OPERATORS(AbstractImporter::Features)
/* Implementations for inline functions with unused parameters */
inline int AbstractImporter::sceneForName(const std::string&) { return -1; }
inline SceneData* AbstractImporter::scene(unsigned int) { return nullptr; }
inline int AbstractImporter::lightForName(const std::string&) { return -1; }
inline LightData* AbstractImporter::light(unsigned int) { return nullptr; }
inline int AbstractImporter::cameraForName(const std::string&) { return -1; }
inline CameraData* AbstractImporter::camera(unsigned int) { return nullptr; }
inline int AbstractImporter::objectForName(const std::string&) { return -1; }
inline ObjectData* AbstractImporter::object(unsigned int) { return nullptr; }
inline int AbstractImporter::meshForName(const std::string&) { return -1; }
inline MeshData* AbstractImporter::mesh(unsigned int) { return nullptr; }
inline int AbstractImporter::materialForName(const std::string&) { return -1; }
inline AbstractMaterialData* AbstractImporter::material(unsigned int) { return nullptr; }
inline int AbstractImporter::textureForName(const std::string&) { return -1; }
inline TextureData* AbstractImporter::texture(unsigned int) { return nullptr; }
inline int AbstractImporter::image1DForName(const std::string&) { return -1; }
inline ImageData1D* AbstractImporter::image1D(unsigned int) { return nullptr; }
inline int AbstractImporter::image2DForName(const std::string&) { return -1; }
inline ImageData2D* AbstractImporter::image2D(unsigned int) { return nullptr; }
inline int AbstractImporter::image3DForName(const std::string&) { return -1; }
inline ImageData3D* AbstractImporter::image3D(unsigned int) { return nullptr; }
}}
#endif

Loading…
Cancel
Save