]> OCCT Git - occt-copy.git/commitdiff
# fixes for the compilation errors and warnings
authormpv <mpv@opencascade.com>
Sun, 10 Jan 2021 09:53:55 +0000 (12:53 +0300)
committeragv <agv@opencascade.com>
Sun, 24 Jan 2021 15:23:36 +0000 (18:23 +0300)
src/BinMNaming/BinMNaming_NamedShapeDriver.cxx
src/BinTools/BinTools_IStream.cxx
src/BinTools/BinTools_ShapeReader.hxx
src/BinTools/BinTools_ShapeWriter.cxx

index e2a89091532bf34bd261e2dd65533edf17f34591..4d705aaf31d51e6f556654807ea7f20c5d7b3dbb 100644 (file)
@@ -147,8 +147,8 @@ BinMNaming_NamedShapeDriver::BinMNaming_NamedShapeDriver
      : BinMDF_ADriver (theMsgDriver, STANDARD_TYPE(TNaming_NamedShape)->Name()),
        myShapeSet (NULL),
        myFormatNb (BinTools_FormatVersion_VERSION_1),
-       myIsQuickPart (Standard_False),
-       myWithTriangles (Standard_False)
+       myWithTriangles (Standard_False),
+       myIsQuickPart (Standard_False)
 {
 }
 
@@ -198,16 +198,20 @@ Standard_Boolean BinMNaming_NamedShapeDriver::Paste
     TopoDS_Shape anOldShape, aNewShape;
 
     if (anEvol != TNaming_PRIMITIVE)
+    {
       if (myIsQuickPart)
         aShapeSet->Read (*aDirectStream, anOldShape);
       else
         if (TranslateFrom (theSource, anOldShape, static_cast<BinTools_ShapeSet*>(aShapeSet))) return Standard_False;
+    }
 
     if (anEvol != TNaming_DELETE)
+    {
       if (myIsQuickPart)
         aShapeSet->Read (*aDirectStream, aNewShape);
       else
         if (TranslateFrom (theSource, aNewShape, static_cast<BinTools_ShapeSet*>(aShapeSet))) return Standard_False;
+    }
 
     // Here we add shapes in reverse order because TNaming_Builder also adds them in reverse order.
     anOldShapes.Prepend (anOldShape);
@@ -362,13 +366,17 @@ void BinMNaming_NamedShapeDriver::ReadShapeSection (Standard_IStream& theIS,
 BinTools_ShapeSetBase* BinMNaming_NamedShapeDriver::ShapeSet (const Standard_Boolean theReading)
 {
   if (!myShapeSet)
+  {
     if (myIsQuickPart)
+    {
       if (theReading)
         myShapeSet = new BinTools_ShapeReader();
       else
         myShapeSet = new BinTools_ShapeWriter (myWithTriangles);
+    }
     else
       myShapeSet = new BinTools_ShapeSet (myWithTriangles);
+  }
   return myShapeSet;
 }
 
index fe684037bace5f89531908a4347b57bb604512af..83402617d6ed76579178deff4c57841c5a77a3aa 100644 (file)
@@ -136,7 +136,7 @@ TopAbs_Orientation BinTools_IStream::ShapeOrientation()
 //=======================================================================
 BinTools_IStream::operator bool() const
 {
-  return myStream->operator bool();
+  return *myStream ? Standard_True : Standard_False;
 }
 
 //=======================================================================
index aab88614d96c06a83b3811024d71021ae6962a0e..1af5fcf45a71b5ff76d74a8b4f5e4cb3a662205c 100644 (file)
@@ -26,6 +26,11 @@ class Poly_Polygon3D;
 class Poly_PolygonOnTriangulation;
 class Poly_Triangulation;
 
+//! Computes a hash code for the given value of the uint64_t type, in range [1, theUpperBound]
+inline Standard_Integer HashCode (const uint64_t theValue, const Standard_Integer theUpperBound)
+{
+  return IntegerHashCode(theValue, 0xffffffffffffffff, theUpperBound);
+}
 
 //! Reads topology from IStream in binary format without grouping of objects by types
 //! and using relative positions in a file as references.
index 36222d9800d3ddf3a85ed260d38918fc83604c48..2d85d5804ecc88a0d7deb2a7463dee39119fc0c1 100644 (file)
@@ -248,6 +248,11 @@ void BinTools_ShapeWriter::WriteShape (Standard_OStream& theStream, const TopoDS
         theStream << (Standard_Byte)0;//without triangulation
     }
     break;
+    default:
+    {
+      Standard_SStream aMsg;
+      aMsg << "Unexpected topology type = " << aShape.ShapeType() << std::endl;
+    }
   }
   }
   catch (Standard_Failure const& anException)