Changeset 402 for trunk/src/core/logger.cc
- Timestamp:
- 06/13/15 21:51:27 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/logger.cc
r399 r402 89 89 for ( auto& sink_info : m_log_sinks ) 90 90 { 91 if ( sink_info.sink && (sink_info.level >= (uint32)level) )91 if ( sink_info.sink && (sink_info.level >= static_cast<uint32>( level ) ) ) 92 92 { 93 93 // log and iterate … … 106 106 { 107 107 sink_info.sink = sink; 108 sink_info.level = (uint32)level;108 sink_info.level = static_cast<uint32>( level ); 109 109 return; 110 110 } … … 194 194 //if ( m_flush ) FlushFileBuffers( m_handle ); 195 195 #else 196 fwrite( stamp, ssize, 1, (FILE*)m_handle ); 197 fwrite( " [", 2, 1, (FILE*)m_handle ); 198 fwrite( NV_LOG_LEVEL_NAME_PAD( level ), 8, 1, (FILE*)m_handle ); 199 fwrite( "] ", 2, 1, (FILE*)m_handle ); 200 fwrite( message.data(), message.size(), 1, (FILE*)m_handle ); 201 fwrite( "\n", 1, 1, (FILE*)m_handle ); 202 if ( m_flush ) fflush( (FILE*)m_handle ); 196 FILE* file = static_cast<FILE*>( m_handle ); 197 fwrite( stamp, ssize, 1, file ); 198 fwrite( " [", 2, 1, file ); 199 fwrite( NV_LOG_LEVEL_NAME_PAD( level ), 8, 1, file ); 200 fwrite( "] ", 2, 1, file ); 201 fwrite( message.data(), message.size(), 1, file ); 202 fwrite( "\n", 1, 1, file ); 203 if ( m_flush ) fflush( file ); 203 204 #endif 204 205 } … … 226 227 CloseHandle( m_handle ); 227 228 #else 228 fclose( (FILE*) m_handle);229 fclose( static_cast<FILE*>( m_handle ) ); 229 230 #endif 230 231 } … … 244 245 { 245 246 uint32 ms = get_system_ms(); 246 unsigned int secs = (unsigned int)(ms / 1000);247 unsigned int mm = (unsigned int)( ms * 100 / 1000 ) % 100;248 unsigned int h = (unsigned int)(secs / (60*60));249 unsigned int m = (unsigned int)(secs / 60) % 60;247 unsigned int secs = static_cast<unsigned int>( ms / 1000 ); 248 unsigned int mm = static_cast<unsigned int>( ms * 100 / 1000 ) % 100; 249 unsigned int h = static_cast<unsigned int>( secs / (60*60) ); 250 unsigned int m = static_cast<unsigned int>( secs / 60 ) % 60; 250 251 unsigned int s = secs % 60; 251 252 #if NV_COMPILER == NV_MSVC
Note: See TracChangeset
for help on using the changeset viewer.