Fixed a gazillion of warnings occuring when compiling Wagic with Clang with Werror.

This commit is contained in:
Xawotihs@gmail.com
2013-06-09 21:16:39 +00:00
parent 7990540096
commit 26ab65860e
75 changed files with 303 additions and 242 deletions

View File

@@ -33,7 +33,7 @@ std::string ToHex(T* pointer)
{ \
std::ostringstream stream; \
stream << inString << std::endl; \
qDebug(stream.str().c_str()); \
qDebug("%s", stream.str().c_str()); \
}
#elif defined (ANDROID)
#include <android/log.h>

View File

@@ -61,7 +61,7 @@ public:
virtual bool ButtonPressed(); // action button pressed, return false to ignore
// Used for mouse support so that the GUI engine can found out which Object was selected
virtual bool getTopLeft(float& top, float& left)
virtual bool getTopLeft(float&, float&)
{
return false;
}

View File

@@ -73,7 +73,7 @@ public:
Q_INVOKABLE qint64 getTick() {
return g_startTimer.elapsed();
};
Q_INVOKABLE void doScroll(int x, int y, int magnitude) {
Q_INVOKABLE void doScroll(int x, int y, int) {
m_engine->Scroll(x, y);
};
int getNominalHeight(){ return SCREEN_HEIGHT;};

View File

@@ -591,6 +591,8 @@ void JGE::SendCommand(string command)
sendJNICommand(command);
#elif defined (IOS)
SendCommand(command, "");
#else
cerr << command;
#endif
}
@@ -602,6 +604,8 @@ void JGE::SendCommand(std::string command, std::string parameter)
[delegate handleWEngineCommand:[NSString stringWithCString: command.c_str() encoding: NSUTF8StringEncoding]
withParameter: [NSString stringWithCString: parameter.c_str() encoding:NSUTF8StringEncoding]];
#else
cerr << command << " " << parameter;
#endif
}
@@ -613,6 +617,8 @@ void JGE::SendCommand(std::string command, float& x, float& y, float& width, flo
#elif IOS
wagicAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
[delegate handleWEngineCommand: [NSString stringWithCString: command.c_str() encoding: NSUTF8StringEncoding] withUIParameters: x yCoordinate: y width: width height: height];
#else
cerr << command << " " << x << " " << y << " " << width << " " << height;
#endif
}
@@ -656,7 +662,6 @@ JNIEnv * JGE::getJNIEnv()
string JGE::getFileSystemLocation()
{
char result[512];
JNIEnv * env = getJNIEnv();
if (env == NULL)
{

View File

@@ -257,6 +257,8 @@ void JMD2Model::CalculateNormal(float *p1, float *p2, float *p3)
#else
// FIXME
#endif
#else
cerr << p1 << " " << p2 << " " << p3 << endl;
#endif
}

View File

@@ -62,6 +62,8 @@ void JNetwork::getServerIp(string& aString)
memcpy(&addr, phe->h_addr_list[i], sizeof(struct in_addr));
aString = inet_ntoa(addr);
}
#else
aString = "No clue";
#endif
}

View File

@@ -1,7 +1,7 @@
#define GL_GLEXT_PROTOTYPES
#include <QtOpenGL>
#include <QTime>
#include <QtGui/QApplication>
#include <QApplication>
#include <QScopedPointer>
#ifdef QT_WIDGET
#include <QWidget>

View File

@@ -1584,7 +1584,7 @@ void JRenderer::Plot(float x, float y, PIXEL_TYPE color)
glEnd();
glColor4ub(255, 255, 255, 255);
#else
// FIXME, not used
cerr << x << " " << y << " " << color << endl;
#endif //#if (!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
glEnable(GL_TEXTURE_2D);
checkGlError();
@@ -1606,6 +1606,7 @@ void JRenderer::PlotArray(float *x, float *y, int count, PIXEL_TYPE color)
glColor4ub(255, 255, 255, 255);
#else
// FIXME, not used
cerr << x << " " << y << " " << count << " " << " " << color << endl;
#endif //#if (!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
glEnable(GL_TEXTURE_2D);
checkGlError();
@@ -2242,7 +2243,7 @@ JTexture* JRenderer::LoadTexture(const char* filename, int mode, int TextureForm
return tex;
}
#elif (defined QT_CONFIG)
JTexture* JRenderer::LoadTexture(const char* filename, int mode, int TextureFormat __attribute__((unused)))
JTexture* JRenderer::LoadTexture(const char* filename, int, int)
{
JTexture *tex = NULL;
int rawsize = 0;
@@ -2518,7 +2519,7 @@ void JRenderer::Enable3D()
}
void JRenderer::SetClip(int x, int y, int width, int height)
void JRenderer::SetClip(int, int, int, int)
{// NOT USED
//glScissor(x, y, width, height);
}
@@ -2530,25 +2531,25 @@ void JRenderer::LoadIdentity()
}
void JRenderer::Translate(float x, float y, float z)
void JRenderer::Translate(float, float, float)
{// NOT USED
//glTranslatef(x, y, z);
}
void JRenderer::RotateX(float angle)
void JRenderer::RotateX(float)
{// NOT USED
//glRotatef(angle*RAD2DEG, 1.0f, 0.0f, 0.0f);
}
void JRenderer::RotateY(float angle)
void JRenderer::RotateY(float)
{// NOT USED
//glRotatef(angle*RAD2DEG, 0.0f, 1.0f, 0.0f);
}
void JRenderer::RotateZ(float angle)
void JRenderer::RotateZ(float)
{// NOT USED
//glRotatef(angle*RAD2DEG, 0.0f, 0.0f, 1.0f);
}

View File

@@ -174,6 +174,7 @@ JMusic *JSoundSystem::LoadMusic(const char *fileName)
}
return music;
#else
cerr << fileName << endl;
return NULL;
#endif
}
@@ -203,6 +204,9 @@ void JSoundSystem::PlayMusic(JMusic *music, bool looping)
else
FSOUND_SetLoopMode(mChannel, FSOUND_LOOP_OFF);
}
#else
music = 0;
looping = false;
#endif
}
@@ -216,6 +220,8 @@ void JSoundSystem::StopMusic(JMusic *music)
}
#elif (defined WITH_FMOD)
FSOUND_StopSound(mChannel);
#else
music = 0;
#endif
}
@@ -290,6 +296,7 @@ JSample *JSoundSystem::LoadSample(const char *fileName)
}
return sample;
#else
cerr << fileName << endl;
return NULL;
#endif
}
@@ -308,6 +315,8 @@ void JSoundSystem::PlaySample(JSample *sample)
int channel = FSOUND_PlaySound(FSOUND_FREE, sample->mSample);
FSOUND_SetVolumeAbsolute(channel, static_cast<int>(mSampleVolume * 2.55));
}
#else
sample = 0;
#endif
}

View File

@@ -467,12 +467,12 @@ void WagicCore::mouseMoveEvent(QMouseEvent *event)
}
}
void WagicCore::showEvent ( QShowEvent * event )
void WagicCore::showEvent ( QShowEvent * )
{
setActive(true);
}
void WagicCore::hideEvent ( QHideEvent * event )
void WagicCore::hideEvent ( QHideEvent * )
{
setActive(false);
}

View File

@@ -134,7 +134,7 @@ zbuffer_stored * zbuffer_stored::close()
int zbuffer_stored::overflow(int c)
int zbuffer_stored::overflow(int)
{
return EOF;
}
@@ -231,7 +231,7 @@ int zbuffer_stored::sync()
streambuf * zbuffer_stored::setbuf(char * pr, int nLength)
streambuf * zbuffer_stored::setbuf(char *, int)
{
return NULL;
}
@@ -298,7 +298,7 @@ zbuffer_deflated * zbuffer_deflated::close()
int zbuffer_deflated::overflow(int c)
int zbuffer_deflated::overflow(int)
{
return EOF;
}
@@ -442,7 +442,7 @@ int zbuffer_deflated::sync()
streambuf * zbuffer_deflated::setbuf(char * pr, int nLength)
streambuf * zbuffer_deflated::setbuf(char *, int)
{
return NULL;
}