mayaegg: fix various compilation warnings

This commit is contained in:
rdb 2018-08-19 16:53:03 +02:00
parent 91ae68f04b
commit 044d84c8fd
2 changed files with 11 additions and 11 deletions

View File

@ -837,12 +837,12 @@ int MayaEggGeom::GetVert(EggVertex *vert, EggGroup *context)
void MayaEggGeom::AssignNames(void) void MayaEggGeom::AssignNames(void)
{ {
string name = _pool->get_name(); string name = _pool->get_name();
int nsize = name.size(); size_t nsize = name.size();
if ((nsize > 6) && (name.rfind(".verts")==(nsize-6))) { if (nsize > 6 && name.rfind(".verts") == (nsize - 6)) {
name.resize(nsize-6); name.resize(nsize - 6);
} }
if ((nsize > 4) && (name.rfind(".cvs")==(nsize-4))) { if (nsize > 4 && name.rfind(".cvs") == (nsize - 4)) {
name.resize(nsize-4); name.resize(nsize - 4);
} }
MFnDependencyNode dnshape(_shapeNode); MFnDependencyNode dnshape(_shapeNode);
@ -913,7 +913,7 @@ void MayaEggGeom::AddEggFlag(MString fieldName) {
typedef phash_map<LTexCoordd, int> TVertTable; typedef phash_map<LTexCoordd, int> TVertTable;
typedef phash_map<LColor, int> CVertTable; typedef phash_map<LColor, int> CVertTable;
class MayaEggMesh : public MayaEggGeom class MayaEggMesh final : public MayaEggGeom
{ {
public: public:
MColorArray _faceColorArray; MColorArray _faceColorArray;
@ -937,7 +937,7 @@ public:
int GetCVert(const LColor &col); int GetCVert(const LColor &col);
int AddFace(unsigned numVertices, MIntArray mvertIndices, MIntArray mtvertIndices, MayaEggTex *tex); int AddFace(unsigned numVertices, MIntArray mvertIndices, MIntArray mtvertIndices, MayaEggTex *tex);
void ConnectTextures(void); void ConnectTextures(void) override;
}; };
int MayaEggMesh::GetTVert(const LTexCoordd &uv) int MayaEggMesh::GetTVert(const LTexCoordd &uv)
@ -2012,7 +2012,7 @@ void MayaEggLoader::PrintData(MayaEggMesh *mesh)
void MayaEggLoader::ParseFrameInfo(string comment) void MayaEggLoader::ParseFrameInfo(string comment)
{ {
int pos, ls, le; size_t pos, ls, le;
pos = comment.find("-fri"); pos = comment.find("-fri");
if (pos != string::npos) { if (pos != string::npos) {
@ -2143,7 +2143,7 @@ bool MayaEggLoader::ConvertEggFile(const char *name, bool merge, bool model, boo
MObject MayaEggLoader::GetDependencyNode(string givenName) MObject MayaEggLoader::GetDependencyNode(string givenName)
{ {
MObject node = MObject::kNullObj; MObject node = MObject::kNullObj;
int pos; size_t pos;
string name; string name;
pos = givenName.find(":"); pos = givenName.find(":");

View File

@ -2742,7 +2742,7 @@ set_shader_legacy(EggPrimitive &primitive, const MayaShader &shader,
// shader on the list is the base one, which should always pick up // shader on the list is the base one, which should always pick up
// the alpha from the texture file. But the top textures may have // the alpha from the texture file. But the top textures may have
// to strip the alpha // to strip the alpha
if (i!=shader._color.size()-1) { if ((size_t)i != shader._color.size() - 1) {
if (!i && is_interpolate) { if (!i && is_interpolate) {
// this is the grass path mode where alpha on this texture // this is the grass path mode where alpha on this texture
// determines whether to show layer1 or layer2. Since by now // determines whether to show layer1 or layer2. Since by now
@ -2846,7 +2846,7 @@ set_shader_legacy(EggPrimitive &primitive, const MayaShader &shader,
_textures.create_unique_texture(tex, ~0); _textures.create_unique_texture(tex, ~0);
if (mesh) { if (mesh) {
if (uvset_name.find("not found") == -1) { if (uvset_name.find("not found") == string::npos) {
primitive.add_texture(new_tex); primitive.add_texture(new_tex);
color_def->_uvset_name.assign(uvset_name.c_str()); color_def->_uvset_name.assign(uvset_name.c_str());
if (uvset_name != "map1") { if (uvset_name != "map1") {