Changeset 406 for trunk/src/io
- Timestamp:
- 06/20/15 00:05:17 (10 years ago)
- Location:
- trunk/src/io
- Files:
-
- 2 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 } -
trunk/src/io/string_table.cc
r395 r406 22 22 uint32 cs_size = s.size() + 1; 23 23 NV_ASSERT( m_offsets.size() < index(-1), "Too many strings!" ); 24 index result = (index)m_offsets.size();24 index result = index( m_offsets.size() ); 25 25 size_t dsize = m_data.size(); 26 26 m_offsets.push_back( dsize ); … … 37 37 raw_copy( m_offsets.begin(), m_offsets.end(), offsets ); 38 38 raw_copy( m_data.begin(), m_data.end(), data ); 39 return new string_table( data, m_data.size(), offsets, (index)m_offsets.size() );39 return new string_table( data, m_data.size(), offsets, index( m_offsets.size() ) ); 40 40 } 41 41 42 42 void nv::string_table_creator::dump( nv::stream* out ) const 43 43 { 44 index count = (index)m_offsets.size();44 index count = index( m_offsets.size() ); 45 45 uint32 size = m_data.size(); 46 46 out->write( &count, sizeof( count ), 1 );
Note: See TracChangeset
for help on using the changeset viewer.