From 044d84c8fd42c1cec89fb4660280b0080eec01b8 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 19 Aug 2018 16:53:03 +0200 Subject: [PATCH] mayaegg: fix various compilation warnings --- pandatool/src/mayaegg/mayaEggLoader.cxx | 18 +++++++++--------- pandatool/src/mayaegg/mayaToEggConverter.cxx | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pandatool/src/mayaegg/mayaEggLoader.cxx b/pandatool/src/mayaegg/mayaEggLoader.cxx index 4baf1dff86..68fcb8d0f7 100644 --- a/pandatool/src/mayaegg/mayaEggLoader.cxx +++ b/pandatool/src/mayaegg/mayaEggLoader.cxx @@ -837,12 +837,12 @@ int MayaEggGeom::GetVert(EggVertex *vert, EggGroup *context) void MayaEggGeom::AssignNames(void) { string name = _pool->get_name(); - int nsize = name.size(); - if ((nsize > 6) && (name.rfind(".verts")==(nsize-6))) { - name.resize(nsize-6); + size_t nsize = name.size(); + if (nsize > 6 && name.rfind(".verts") == (nsize - 6)) { + name.resize(nsize - 6); } - if ((nsize > 4) && (name.rfind(".cvs")==(nsize-4))) { - name.resize(nsize-4); + if (nsize > 4 && name.rfind(".cvs") == (nsize - 4)) { + name.resize(nsize - 4); } MFnDependencyNode dnshape(_shapeNode); @@ -913,7 +913,7 @@ void MayaEggGeom::AddEggFlag(MString fieldName) { typedef phash_map TVertTable; typedef phash_map CVertTable; -class MayaEggMesh : public MayaEggGeom +class MayaEggMesh final : public MayaEggGeom { public: MColorArray _faceColorArray; @@ -937,7 +937,7 @@ public: int GetCVert(const LColor &col); int AddFace(unsigned numVertices, MIntArray mvertIndices, MIntArray mtvertIndices, MayaEggTex *tex); - void ConnectTextures(void); + void ConnectTextures(void) override; }; int MayaEggMesh::GetTVert(const LTexCoordd &uv) @@ -2012,7 +2012,7 @@ void MayaEggLoader::PrintData(MayaEggMesh *mesh) void MayaEggLoader::ParseFrameInfo(string comment) { - int pos, ls, le; + size_t pos, ls, le; pos = comment.find("-fri"); 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 node = MObject::kNullObj; - int pos; + size_t pos; string name; pos = givenName.find(":"); diff --git a/pandatool/src/mayaegg/mayaToEggConverter.cxx b/pandatool/src/mayaegg/mayaToEggConverter.cxx index 747c8ac279..3f693dd004 100644 --- a/pandatool/src/mayaegg/mayaToEggConverter.cxx +++ b/pandatool/src/mayaegg/mayaToEggConverter.cxx @@ -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 // the alpha from the texture file. But the top textures may have // to strip the alpha - if (i!=shader._color.size()-1) { + if ((size_t)i != shader._color.size() - 1) { if (!i && is_interpolate) { // this is the grass path mode where alpha on this texture // 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); if (mesh) { - if (uvset_name.find("not found") == -1) { + if (uvset_name.find("not found") == string::npos) { primitive.add_texture(new_tex); color_def->_uvset_name.assign(uvset_name.c_str()); if (uvset_name != "map1") {