Ignore:
Timestamp:
06/13/15 21:51:27 (10 years ago)
Author:
epyon
Message:
  • cleanups of clang warnings (gotta love them all)
  • only nv-core for now (this will take a while for the whole source)
  • mainly C++ casts instead of C-style casts, but also a few bugs fixed!
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/logger.cc

    r399 r402  
    8989        for ( auto& sink_info : m_log_sinks )
    9090        {
    91                 if ( sink_info.sink && (sink_info.level >= (uint32)level) )
     91                if ( sink_info.sink && (sink_info.level >= static_cast<uint32>( level ) ) )
    9292                {
    9393                        // log and iterate
     
    106106                {
    107107                        sink_info.sink  = sink;
    108                         sink_info.level = (uint32)level;
     108                        sink_info.level = static_cast<uint32>( level );
    109109                        return;
    110110                }
     
    194194        //if ( m_flush ) FlushFileBuffers( m_handle );
    195195#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 );
    203204#endif
    204205}
     
    226227        CloseHandle( m_handle );
    227228#else
    228         fclose( (FILE*) m_handle );
     229        fclose( static_cast<FILE*>( m_handle ) );
    229230#endif
    230231}
     
    244245{
    245246        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;
    250251        unsigned int s    = secs % 60;
    251252#if NV_COMPILER == NV_MSVC
Note: See TracChangeset for help on using the changeset viewer.