mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0024259: Clean up OSD_File implementation
Field myFileChannel removed from OSD_FileNode and introduced to OSD_File as Linux-only along with Windows-only myFileHandle. Implementation of OSD_File cleaned from redundant type casts; some missing type cases added. File mode passed to fdopen() corrected in read-write case ("rw" replaced by "w+"). Method OSD_File::Size() now returns Standard_Size to be able to return correct value for large files (on 64-bit platforms only).
This commit is contained in:
@@ -345,7 +345,7 @@ Handle_StlMesh_Mesh RWStl::ReadBinary (const OSD_Path& thePath,
|
||||
// must be a multiple of SIZEOF_STL_FACET
|
||||
|
||||
// compute file size
|
||||
Standard_Integer filesize = theFile.Size();
|
||||
Standard_Size filesize = theFile.Size();
|
||||
|
||||
if ( (filesize - HEADER_SIZE) % SIZEOF_STL_FACET !=0
|
||||
|| (filesize < STL_MIN_FILE_SIZE)) {
|
||||
@@ -354,7 +354,7 @@ Handle_StlMesh_Mesh RWStl::ReadBinary (const OSD_Path& thePath,
|
||||
|
||||
// don't trust the number of triangles which is coded in the file
|
||||
// sometimes it is wrong, and with this technique we don't need to swap endians for integer
|
||||
NBFACET = ((filesize - HEADER_SIZE) / SIZEOF_STL_FACET);
|
||||
NBFACET = (Standard_Integer)((filesize - HEADER_SIZE) / SIZEOF_STL_FACET);
|
||||
|
||||
// skip the header
|
||||
theFile.Seek(HEADER_SIZE,OSD_FromBeginning);
|
||||
|
Reference in New Issue
Block a user