mirror of
https://github.com/love2d/love.git
synced 2026-08-21 13:09:56 +02:00
Add LOVE_UNUSED macro to stamp out all those "unused parameter" warnings
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
**/
|
||||
|
||||
#include "Exception.h"
|
||||
#include <common/config.h>
|
||||
|
||||
namespace love
|
||||
{
|
||||
@@ -32,6 +33,7 @@ namespace love
|
||||
|
||||
Exception::Exception(int unparsed, const char * str)
|
||||
{
|
||||
LOVE_UNUSED(unparsed);
|
||||
strncpy(buffer, str, BUFFER_SIZE);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,10 @@
|
||||
# define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
|
||||
#ifndef LOVE_UNUSED
|
||||
# define LOVE_UNUSED(x) (void)sizeof(x)
|
||||
#endif
|
||||
|
||||
#ifndef LOVE_BUILD
|
||||
# define LOVE_BUILD
|
||||
# define LOVE_BUILD_STANDALONE
|
||||
|
||||
@@ -734,6 +734,7 @@ namespace opengl
|
||||
// glEnable (GL_POLYGON_SMOOTH);
|
||||
// glHint (GL_POLYGON_SMOOTH_HINT, GL_NICEST);
|
||||
//}
|
||||
LOVE_UNUSED(style);
|
||||
}
|
||||
|
||||
void Graphics::setLine( float width, Graphics::LineStyle style )
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "VertexBuffer.h"
|
||||
|
||||
#include "common/Exception.h"
|
||||
#include <common/config.h>
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
@@ -88,6 +89,7 @@ namespace opengl
|
||||
|
||||
void *VertexArray::map(GLenum access)
|
||||
{
|
||||
LOVE_UNUSED(access);
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#define LOVE_THREAD_SDL_THREADS_H
|
||||
|
||||
#include "SDL.h"
|
||||
#include <common/config.h>
|
||||
|
||||
namespace love
|
||||
{
|
||||
@@ -31,7 +32,7 @@ namespace thread
|
||||
class Mutex {
|
||||
private:
|
||||
SDL_mutex* mutex;
|
||||
Mutex(const Mutex& mutex) {}
|
||||
Mutex(const Mutex& mutex) {LOVE_UNUSED(mutex);}
|
||||
|
||||
friend class Conditional;
|
||||
|
||||
@@ -48,7 +49,7 @@ namespace thread
|
||||
class ThreadBase {
|
||||
private:
|
||||
SDL_Thread* thread;
|
||||
ThreadBase(ThreadBase& thread) {}
|
||||
ThreadBase(ThreadBase& thread) {LOVE_UNUSED(thread);}
|
||||
bool running;
|
||||
|
||||
static int thread_runner(void* param);
|
||||
@@ -70,7 +71,7 @@ namespace thread
|
||||
|
||||
class Semaphore {
|
||||
private:
|
||||
Semaphore(const Semaphore& sem) {}
|
||||
Semaphore(const Semaphore& sem) {LOVE_UNUSED(sem);}
|
||||
SDL_sem* semaphore;
|
||||
|
||||
public:
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace thread
|
||||
private:
|
||||
Mutex* mutex;
|
||||
|
||||
Lock(Lock& lock) {}
|
||||
Lock(Lock& lock) {LOVE_UNUSED(lock);}
|
||||
|
||||
public:
|
||||
Lock(Mutex* m): mutex(m) {
|
||||
|
||||
Reference in New Issue
Block a user