Browse Source

Merge pull request #603 from ReliaSolve/fix_compiler_warnings

Fix compiler warnings
Alexander Gessler 10 năm trước cách đây
mục cha
commit
2fd0a84c01

+ 1 - 1
code/ACLoader.cpp

@@ -620,7 +620,7 @@ aiNode* AC3DImporter::ConvertObjectSection(Object& object,
                                     face.mIndices[i] = cur++;
 
                                     // copy vertex positions
-                                    if ((vertices - mesh->mVertices) >= mesh->mNumVertices) {
+                                    if (static_cast<unsigned>(vertices - mesh->mVertices) >= mesh->mNumVertices) {
                                         throw DeadlyImportError("AC3D: Invalid number of vertices");
                                     }
                                     *vertices = object.vertices[entry.first] + object.translation;

+ 8 - 8
contrib/openddlparser/code/OpenDDLParser.cpp

@@ -39,14 +39,14 @@ BEGIN_ODDLPARSER_NS
 static const char *Version = "0.1.0";
 
 namespace Grammar {
-    static const char *OpenBracketToken   = "{";
-    static const char *CloseBracketToken  = "}";
-    static const char *OpenPropertyToken  = "(";
-    static const char *ClosePropertyToken = ")";
-    static const char *BoolTrue           = "true";
-    static const char *BoolFalse          = "false";
-    static const char *RefToken           = "ref";
-    static const char *CommaSeparator     = ",";
+    static const char * const OpenBracketToken   = "{";
+    static const char * const CloseBracketToken  = "}";
+    static const char * const OpenPropertyToken  = "(";
+    static const char * const ClosePropertyToken = ")";
+    static const char * const BoolTrue           = "true";
+    static const char * const BoolFalse          = "false";
+    static const char * const RefToken           = "ref";
+    static const char * const CommaSeparator     = ",";
 
     static const char* PrimitiveTypeToken[ Value::ddl_types_max ] = {
         "bool",

+ 0 - 14
contrib/poly2tri/poly2tri/sweep/sweep.cc

@@ -652,13 +652,6 @@ void Sweep::FlipEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle* t,
   Triangle& ot = t->NeighborAcross(p);
   Point& op = *ot.OppositePoint(*t, p);
 
-  if (&ot == NULL) {
-    // If we want to integrate the fillEdgeEvent do it here
-    // With current implementation we should never get here
-    //throw new RuntimeException( "[BUG:FIXME] FLIP failed due to missing triangle");
-    assert(0);
-  }
-
   if (InScanArea(p, *t->PointCCW(p), *t->PointCW(p), op)) {
     // Lets rotate shared edge one vertex CW
     RotateTrianglePair(*t, p, ot, op);
@@ -728,13 +721,6 @@ void Sweep::FlipScanEdgeEvent(SweepContext& tcx, Point& ep, Point& eq, Triangle&
   Triangle& ot = t.NeighborAcross(p);
   Point& op = *ot.OppositePoint(t, p);
 
-  if (&t.NeighborAcross(p) == NULL) {
-    // If we want to integrate the fillEdgeEvent do it here
-    // With current implementation we should never get here
-    //throw new RuntimeException( "[BUG:FIXME] FLIP failed due to missing triangle");
-    assert(0);
-  }
-
   if (InScanArea(eq, *flip_triangle.PointCCW(eq), *flip_triangle.PointCW(eq), op)) {
     // flip with new edge op->eq
     FlipEdgeEvent(tcx, eq, op, &ot, op);

+ 1 - 1
contrib/poly2tri/poly2tri/sweep/sweep_context.cc

@@ -164,7 +164,7 @@ void SweepContext::RemoveFromMap(Triangle* triangle)
 
 void SweepContext::MeshClean(Triangle& triangle)
 {
-  if (&triangle != NULL && !triangle.IsInterior()) {
+  if (!triangle.IsInterior()) {
     triangle.IsInterior(true);
     triangles_.push_back(&triangle);
     for (int i = 0; i < 3; i++) {