Changeset 406 for trunk/src/io/c_stream.cc
- Timestamp:
- 06/20/15 00:05:17 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/io/c_stream.cc
r395 r406 31 31 if ( m_file ) 32 32 { 33 ::fclose( (FILE*)m_file);33 ::fclose( reinterpret_cast<FILE*>( m_file ) ); 34 34 } 35 35 } … … 38 38 { 39 39 NV_ASSERT( buffer != nullptr && size != 0 && count != 0, "Bad parameter passed to read!" ); 40 return m_file ? ::fread( buffer, size, count, (FILE*)m_file) : 0;40 return m_file ? ::fread( buffer, size, count, reinterpret_cast<FILE*>( m_file ) ) : 0; 41 41 } 42 42 … … 44 44 { 45 45 NV_ASSERT( buffer != nullptr && size != 0 && count != 0, "Bad parameter passed to write!" ); 46 return m_file ? ::fwrite( buffer, size, count, (FILE*)m_file) : 0;46 return m_file ? ::fwrite( buffer, size, count, reinterpret_cast<FILE*>( m_file ) ) : 0; 47 47 } 48 48 49 49 bool c_stream::seek( long offset, origin orig ) 50 50 { 51 return m_file != nullptr && ( ::fseek( (FILE*)m_file, (long)offset, static_cast<int>(orig) ) == 0 );51 return m_file != nullptr && ( ::fseek( reinterpret_cast<FILE*>( m_file ), offset, static_cast<int>(orig) ) == 0 ); 52 52 } 53 53 54 54 nv::size_t c_stream::tell() 55 55 { 56 return m_file != nullptr ? static_cast< nv::size_t >( ::ftell( (FILE*)m_file) ) : 0;56 return m_file != nullptr ? static_cast< nv::size_t >( ::ftell( reinterpret_cast<FILE*>( m_file ) ) ) : 0; 57 57 } 58 58 … … 72 72 return 0; 73 73 } 74 m_file_size = (size_t)(fstat.st_size);74 m_file_size = static_cast<size_t>(fstat.st_size); 75 75 } 76 76 … … 82 82 if ( m_file != nullptr ) 83 83 { 84 ::fflush( (FILE*)m_file);84 ::fflush( reinterpret_cast<FILE*>( m_file ) ); 85 85 } 86 86 }
Note: See TracChangeset
for help on using the changeset viewer.