Warnings on vc14 were eliminated
[occt.git] / src / BinTools / BinTools.cxx
index 8a6ed5a..11d4d46 100644 (file)
@@ -84,7 +84,7 @@ Standard_OStream& BinTools::PutExtChar(Standard_OStream& OS, const Standard_ExtC
 Standard_IStream& BinTools::GetReal(Standard_IStream& IS, Standard_Real& aValue)
 {
   if(!IS.read ((char*)&aValue, sizeof(Standard_Real)))
-    Storage_StreamTypeMismatchError::Raise();
+    throw Storage_StreamTypeMismatchError();
 #if DO_INVERSE
   aValue = InverseReal (aValue);
 #endif
@@ -99,7 +99,7 @@ Standard_IStream& BinTools::GetReal(Standard_IStream& IS, Standard_Real& aValue)
 Standard_IStream& BinTools::GetInteger(Standard_IStream& IS, Standard_Integer& aValue)
 {
   if(!IS.read ((char*)&aValue, sizeof(Standard_Integer)))
-    Storage_StreamTypeMismatchError::Raise();;
+    throw Storage_StreamTypeMismatchError();;
 #if DO_INVERSE
   aValue = InverseInt (aValue);
 #endif
@@ -114,7 +114,7 @@ Standard_IStream& BinTools::GetInteger(Standard_IStream& IS, Standard_Integer& a
 Standard_IStream& BinTools::GetExtChar(Standard_IStream& IS, Standard_ExtCharacter& theValue)
 {
   if(!IS.read ((char*)&theValue, sizeof(Standard_ExtCharacter)))
-    Storage_StreamTypeMismatchError::Raise();;
+    throw Storage_StreamTypeMismatchError();;
 #if DO_INVERSE
   theValue = InverseExtChar (theValue);
 #endif
@@ -184,7 +184,7 @@ Standard_Boolean BinTools::Write (const TopoDS_Shape& theShape, const Standard_C
 Standard_Boolean BinTools::Read (TopoDS_Shape& theShape, const Standard_CString theFile)
 {
   filebuf aBuf;
-  OSD_OpenFileBuf (aBuf, theFile, ios::in | ios::binary);
+  OSD_OpenStream (aBuf, theFile, ios::in | ios::binary);
   if (!aBuf.is_open())
     return Standard_False;