Fix some compiler warnings

This commit is contained in:
Flakebi 2015-01-18 23:28:53 +01:00
parent a3489fe834
commit 9c6dd1c1b5
14 changed files with 33 additions and 24 deletions

View File

@ -39,7 +39,7 @@ namespace GraphicsRestrictions
/** The list of names used in the XML file for the graphics
* restriction types. They must be in the same order as the types. */
char *m_names_of_restrictions[] = {
const char *m_names_of_restrictions[] = {
"UniformBufferObject",
"GeometryShader4",
"DrawIndirect",
@ -389,9 +389,9 @@ void unitTesting()
assert(Version("2.1 Mesa 10.5.0-devel (git-82e919d)",
"Gallium 0.4 on i915 (chipse)")
== Version("10.5.0") );
assert(Version("1.4 (3.0 Mesa 10.1.0)",
"Mesa DRI Intel(R) Ivybridge Mobile")
== Version("10.1.0"));
assert(Version("1.4 (3.0 Mesa 10.1.0)",
"Mesa DRI Intel(R) Ivybridge Mobile")
== Version("10.1.0"));
} // unitTesting

View File

@ -153,7 +153,7 @@ void LODNode::updateVisibility(bool* shown)
void LODNode::OnRegisterSceneNode()
{
bool shown;
bool shown = false;
updateVisibility(&shown);
const u32 now = irr_driver->getDevice()->getTimer()->getTime();

View File

@ -792,6 +792,8 @@ void Material::setMaterialProperties(video::SMaterial *m, scene::IMeshBuffer* m
m->MaterialType = irr_driver->getShader(ES_GRASS_REF);
m->setTexture(1, glossytex);
return;
default:
break;
}
if (!m->getTexture(0))

View File

@ -8,7 +8,7 @@
#define MAX2(a, b) ((a) > (b) ? (a) : (b))
#define MIN2(a, b) ((a) > (b) ? (b) : (a))
static float getTexelValue(unsigned i, unsigned j, size_t width, size_t height, float *Coeff, float *Y00, float *Y1minus1, float *Y10, float *Y11,
/*static float getTexelValue(unsigned i, unsigned j, size_t width, size_t height, float *Coeff, float *Y00, float *Y1minus1, float *Y10, float *Y11,
float *Y2minus2, float * Y2minus1, float * Y20, float *Y21, float *Y22)
{
float solidangle = 1.;
@ -18,9 +18,9 @@ static float getTexelValue(unsigned i, unsigned j, size_t width, size_t height,
reconstructedVal += Y2minus2[idx] * Coeff[4] + Y2minus1[idx] * Coeff[5] + Y20[idx] * Coeff[6] + Y21[idx] * Coeff[7] + Y22[idx] * Coeff[8];
reconstructedVal /= solidangle;
return MAX2(255.0f * reconstructedVal, 0.f);
}
}*/
static void unprojectSH(float *output[], size_t width, size_t height,
/*static void unprojectSH(float *output[], size_t width, size_t height,
float *Y00[],
float *Y1minus1[], float *Y10[], float *Y11[],
float *Y2minus2[], float *Y2minus1[], float * Y20[], float *Y21[], float *Y22[],
@ -48,15 +48,15 @@ static void unprojectSH(float *output[], size_t width, size_t height,
}
}
}
}
}*/
static void displayCoeff(float *SHCoeff)
/*static void displayCoeff(float *SHCoeff)
{
printf("L00:%f\n", SHCoeff[0]);
printf("L1-1:%f, L10:%f, L11:%f\n", SHCoeff[1], SHCoeff[2], SHCoeff[3]);
printf("L2-2:%f, L2-1:%f, L20:%f, L21:%f, L22:%f\n", SHCoeff[4], SHCoeff[5], SHCoeff[6], SHCoeff[7], SHCoeff[8]);
}
}*/
// Only for 9 coefficients
/*static void testSH(unsigned char *color[6], size_t width, size_t height,

View File

@ -109,10 +109,10 @@ void IrrDriver::UpdateSplitAndLightcoordRangeFromComputeShaders(size_t width, si
{
// Value that should be kept between multiple calls
static GLuint ssbo[2];
static Histogram *Hist[2];
//static Histogram *Hist[2];
static GLsync LightcoordBBFence = 0;
static size_t currentHist = 0;
static GLuint ssboSplit[2];
//static size_t currentHist = 0;
//static GLuint ssboSplit[2];
static float tmpshadowSplit[5] = { 1., 5., 20., 50., 150. };
if (!LightcoordBBFence)

View File

@ -1268,6 +1268,12 @@ void Skin::drawSpinnerBody(const core::recti &rect, Widget* widget,
params=&SkinConfig::m_render_params["spinner3::neutral"];
else if(player_id==3)
params=&SkinConfig::m_render_params["spinner4::neutral"];
else
{
Log::fatal("Skin::drawSpinnerBody", "Unknown playerID (more than 4 players?)");
// Silence compiler warning
params = NULL;
}
}
else if (widget->m_deactivated)
{

View File

@ -111,14 +111,14 @@ void LabelWidget::add()
if (m_scroll_speed > 0)
{
IGUIFont* font = m_title_font ? GUIEngine::getTitleFont()
/*IGUIFont* font = m_title_font ? GUIEngine::getTitleFont()
: GUIEngine::getFont();
core::dimension2du r = font->getDimension(getText().c_str());
//m_scroll_offset = (float)r.Width;
m_scroll_offset = (float)r.Width;
// start scrolled off
m_scroll_offset = -999;
m_scroll_offset = -999;*/
}
else
{

View File

@ -447,6 +447,8 @@ void Skidding::update(float dt, bool is_on_ground,
->setCreationRateAbsolute(KartGFX::KGFX_SKIDR, 0);
m_skid_state = SKID_NONE;
}
case SKID_OLD:
break;
} // switch
updateSteering(steering, dt);
} // update

View File

@ -1134,7 +1134,6 @@ void askForInternetPermission()
} // onCancel
}; // ConfirmServer
GUIEngine::ModalDialog *dialog =
new MessageDialog(_("SuperTuxKart may connect to a server "
"to download add-ons and notify you of updates. We also collect "
"anonymous hardware statistics to help with the development of STK. "

View File

@ -47,6 +47,7 @@ bool SynchronizationProtocol::notifyEventAsynchronous(Event* event)
uint32_t sequence = data.gui32(6);
std::vector<STKPeer*> peers = NetworkManager::getInstance()->getPeers();
assert(peers.size() > 0);
if (m_listener->isServer())
{
@ -57,7 +58,7 @@ bool SynchronizationProtocol::notifyEventAsynchronous(Event* event)
}
}
uint8_t peer_id;
uint8_t peer_id = 0;
for (unsigned int i = 0; i < peers.size(); i++)
{
if (peers[i]->isSamePeer(*event->peer))

View File

@ -12,7 +12,7 @@
template<typename S>
S getHighestInHistogram(std::map<S,int>* histogram)
{
S best_item;
S best_item = histogram->begin()->first;
uint8_t highest_count = histogram->begin()->second;
for (typename std::map<S, int>::iterator it = histogram->begin();
it != histogram->end(); it++)

View File

@ -53,7 +53,6 @@ namespace Scripting
kart->setXYZ(btVector3(x, y, z));
unsigned int index = World::getWorld()->getRescuePositionIndex(kart);
btTransform s = World::getWorld()->getRescueTransform(index);
const btVector3 &xyz = s.getOrigin();
s.setRotation(btQuaternion(btVector3(0.0f, 1.0f, 0.0f), 0.0f));
World::getWorld()->moveKartTo(kart, s);
}

View File

@ -414,9 +414,9 @@ void RaceGUIBase::preRenderCallback(const Camera *camera)
// ----------------------------------------------------------------------------
void RaceGUIBase::renderPlayerView(const Camera *camera, float dt)
{
#if 0
const core::recti &viewport = camera->getViewport();
#if 0
if (m_lightning > 0.0f)
{
GLint glviewport[4];

View File

@ -74,13 +74,13 @@ void TrackSector::update(const Vec3 &xyz)
}
else
{
bool has_prerequisite = false;
//bool has_prerequisite = false;
for (unsigned int i=0; i<checkline_requirements.size(); i++)
{
if (m_last_triggered_checkline == checkline_requirements[i])
{
has_prerequisite = true;
//has_prerequisite = true;
m_last_valid_graph_node = m_current_graph_node;
break;
}