1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Add -Wsign-compare for Clang builds and fix some signed/unsigned compiler warnings

This commit is contained in:
kwolekr 2015-05-16 19:59:53 -04:00
parent fb36c471d7
commit 11a96e4901
4 changed files with 31 additions and 30 deletions

View file

@ -142,12 +142,12 @@ class TestCAO : public ClientActiveObject
public:
TestCAO(IGameDef *gamedef, ClientEnvironment *env);
virtual ~TestCAO();
ActiveObjectType getType() const
{
return ACTIVEOBJECT_TYPE_TEST;
}
static ClientActiveObject* create(IGameDef *gamedef, ClientEnvironment *env);
void addToScene(scene::ISceneManager *smgr, ITextureSource *tsrc,
@ -192,9 +192,9 @@ void TestCAO::addToScene(scene::ISceneManager *smgr, ITextureSource *tsrc,
{
if(m_node != NULL)
return;
//video::IVideoDriver* driver = smgr->getVideoDriver();
scene::SMesh *mesh = new scene::SMesh();
scene::IMeshBuffer *buf = new scene::SMeshBuffer();
video::SColor c(255,255,255,255);
@ -286,12 +286,12 @@ class ItemCAO : public ClientActiveObject
public:
ItemCAO(IGameDef *gamedef, ClientEnvironment *env);
virtual ~ItemCAO();
ActiveObjectType getType() const
{
return ACTIVEOBJECT_TYPE_ITEM;
}
static ClientActiveObject* create(IGameDef *gamedef, ClientEnvironment *env);
void addToScene(scene::ISceneManager *smgr, ITextureSource *tsrc,
@ -308,12 +308,12 @@ public:
void processMessage(const std::string &data);
void initialize(const std::string &data);
core::aabbox3d<f32>* getSelectionBox()
{return &m_selection_box;}
v3f getPosition()
{return m_position;}
std::string infoText()
{return m_infotext;}
@ -357,9 +357,9 @@ void ItemCAO::addToScene(scene::ISceneManager *smgr, ITextureSource *tsrc,
{
if(m_node != NULL)
return;
//video::IVideoDriver* driver = smgr->getVideoDriver();
scene::SMesh *mesh = new scene::SMesh();
scene::IMeshBuffer *buf = new scene::SMeshBuffer();
video::SColor c(255,255,255,255);
@ -469,7 +469,7 @@ void ItemCAO::updateTexture()
<<": error deSerializing itemstring \""
<<m_itemstring<<std::endl;
}
// Set meshbuffer texture
m_node->getMaterial(0).setTexture(0, texture);
}
@ -514,7 +514,7 @@ void ItemCAO::processMessage(const std::string &data)
void ItemCAO::initialize(const std::string &data)
{
infostream<<"ItemCAO: Got init data"<<std::endl;
{
std::istringstream is(data, std::ios::binary);
// version
@ -527,7 +527,7 @@ void ItemCAO::initialize(const std::string &data)
// itemstring
m_itemstring = deSerializeString(is);
}
updateNodePos();
updateInfoText();
}
@ -748,7 +748,7 @@ ClientActiveObject* GenericCAO::getParent()
void GenericCAO::removeFromScene(bool permanent)
{
// Should be true when removing the object permanently and false when refreshing (eg: updating visuals)
if((m_env != NULL) && (permanent))
if((m_env != NULL) && (permanent))
{
for(std::vector<u16>::iterator ci = m_children.begin();
ci != m_children.end(); ci++)
@ -759,7 +759,7 @@ void GenericCAO::removeFromScene(bool permanent)
}
m_env->m_attachements[getId()] = 0;
LocalPlayer* player = m_env->getLocalPlayer();
if (this == player->parent) {
player->parent = NULL;
@ -898,7 +898,7 @@ void GenericCAO::addToScene(scene::ISceneManager *smgr, ITextureSource *tsrc,
m_meshnode = smgr->addMeshSceneNode(mesh, NULL);
m_meshnode->grab();
mesh->drop();
m_meshnode->setScale(v3f(m_prop.visual_size.X,
m_prop.visual_size.Y,
m_prop.visual_size.X));
@ -1014,7 +1014,7 @@ void GenericCAO::updateNodePos()
}
}
}
void GenericCAO::step(float dtime, ClientEnvironment *env)
{
// Handel model of local player instantly to prevent lags
@ -1485,7 +1485,7 @@ void GenericCAO::updateBonePosition()
}
}
}
void GenericCAO::updateAttachments()
{
@ -1716,14 +1716,14 @@ void GenericCAO::processMessage(const std::string &data)
m_armor_groups[name] = rating;
}
} else if (cmd == GENERIC_CMD_UPDATE_NAMETAG_ATTRIBUTES) {
u8 version = readU8(is); // forward compatibility
//u8 version = readU8(is); // forward compatibility
m_nametag_color = readARGB8(is);
if (m_textnode != NULL) {
m_textnode->setTextColor(m_nametag_color);
}
}
}
/* \pre punchitem != NULL
*/
bool GenericCAO::directReportPunch(v3f dir, const ItemStack *punchitem,