Fix a lot of warnings

This commit is contained in:
Spp
2012-02-16 13:56:28 +01:00
parent e47ec04b4d
commit 03c34ee507
38 changed files with 88 additions and 98 deletions
@@ -34,7 +34,7 @@ class BIHWrap
const T* const* objects;
RayCallback& _callback;
MDLCallback(RayCallback& callback, const T* const* objects_array ) : _callback(callback), objects(objects_array){}
MDLCallback(RayCallback& callback, const T* const* objects_array ) : objects(objects_array), _callback(callback) {}
bool operator() (const Ray& ray, uint32 Idx, float& MaxDist, bool /*stopAtFirst*/)
{
@@ -106,4 +106,4 @@ public:
}
};
#endif // _BIH_WRAP
#endif // _BIH_WRAP
+3 -2
View File
@@ -43,10 +43,11 @@ template<> struct BoundsTrait< GameObjectModel> {
static void getBounds2(const GameObjectModel* g, G3D::AABox& out) { out = g->getBounds();}
};
/*
static bool operator == (const GameObjectModel& mdl, const GameObjectModel& mdl2){
return &mdl == &mdl2;
}
*/
int valuesPerNode = 5, numMeanSplits = 3;
@@ -251,4 +252,4 @@ float DynamicMapTree::getHeight(float x, float y, float z, float maxSearchDist,
return v.z - maxSearchDist;
else
return -G3D::inf();
}
}
+4 -5
View File
@@ -344,16 +344,15 @@ namespace VMAP
char buff[500];
while (!feof(model_list))
{
fread(&displayId,sizeof(uint32),1,model_list);
fread(&name_length,sizeof(uint32),1,model_list);
if (name_length >= sizeof(buff))
if (fread(&displayId, sizeof(uint32), 1, model_list) != 1
|| fread(&name_length, sizeof(uint32), 1, model_list) != 1
|| name_length >= sizeof(buff)
|| fread(&buff, sizeof(char), name_length, model_list) != name_length)
{
std::cout << "\nFile 'temp_gameobject_models' seems to be corrupted" << std::endl;
break;
}
fread(&buff,sizeof(char),name_length,model_list);
std::string model_name(buff, name_length);
WorldModel_Raw raw_model;
@@ -36,7 +36,7 @@ using G3D::AABox;
struct GameobjectModelData
{
GameobjectModelData(const std::string& name_, const AABox& box) :
name(name_), bound(box) {}
bound(box), name(name_) {}
AABox bound;
std::string name;
@@ -55,20 +55,18 @@ void LoadGameObjectModelList()
char buff[500];
while (!feof(model_list_file))
{
fread(&displayId,sizeof(uint32),1,model_list_file);
fread(&name_length,sizeof(uint32),1,model_list_file);
if (name_length >= sizeof(buff))
Vector3 v1, v2;
if (fread(&displayId, sizeof(uint32), 1, model_list_file) != 1
|| fread(&name_length, sizeof(uint32), 1, model_list_file) != 1
|| name_length >= sizeof(buff)
|| fread(&buff, sizeof(char), name_length, model_list_file) != name_length
|| fread(&v1, sizeof(Vector3), 1, model_list_file) != 1
|| fread(&v2, sizeof(Vector3), 1, model_list_file) != 1)
{
printf("\nFile '%s' seems to be corrupted", VMAP::GAMEOBJECT_MODELS);
break;
}
fread(&buff, sizeof(char), name_length,model_list_file);
Vector3 v1, v2;
fread(&v1, sizeof(Vector3), 1, model_list_file);
fread(&v2, sizeof(Vector3), 1, model_list_file);
model_list.insert
(
ModelList::value_type( displayId, GameobjectModelData(std::string(buff,name_length),AABox(v1,v2)) )
@@ -172,4 +170,4 @@ bool GameObjectModel::intersectRay(const G3D::Ray& ray, float& MaxDist, bool Sto
MaxDist = distance;
}
return hit;
}
}
+2 -2
View File
@@ -17,7 +17,7 @@ using G3D::Ray;
template<class Node>
struct NodeCreator{
static Node * makeNode(int x, int y) { return new Node();}
static Node * makeNode(int /*x*/, int /*y*/) { return new Node();}
};
template<class T,
@@ -215,4 +215,4 @@ public:
#undef CELL_SIZE
#undef HGRID_MAP_SIZE
#endif
#endif