Ignore:
Timestamp:
06/20/15 00:05:17 (10 years ago)
Author:
epyon
Message:
  • code compiles cleanly on maximum warning level
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/gui_ascii_renderer.cc

    r395 r406  
    1818        bool   clear;
    1919        bool   border;
    20         char  border_chars[8];
     20        uchar8 border_chars[8];
    2121        uint32 border_color;
    2222        uint32 text_color;
     
    4242        }
    4343        else
    44                 er = (ascii_render_data*)( e->m_render_data );
     44                er = static_cast< ascii_render_data* >( e->m_render_data );
    4545
    4646        rectangle abs = e->m_absolute;
     
    6868                                er->border_color = uint32( border_color );
    6969                        for ( uint32 i = 0; i < 8 && i < path.length(); )
    70                                 er->border_chars[i] = path[i];
     70                                er->border_chars[i] = static_cast< uchar8 >( path[i] );
    7171                }
    7272        }
     
    7575void ascii_renderer::draw( element* e )
    7676{
    77         ascii_render_data* er = (ascii_render_data*)( e->m_render_data );
     77        ascii_render_data* er = static_cast< ascii_render_data* >( e->m_render_data );
    7878        rectangle abs = e->m_absolute;
    7979        if ( er->clear ) m_terminal->clear( abs );
     
    8282                for ( int x = 0; x < abs.get_width(); ++x )
    8383                {
    84                         m_terminal->print( position( abs.ul.y, abs.ul.x + x ), er->border_color, (unsigned char)er->border_chars[0] );
    85                         m_terminal->print( position( abs.lr.y, abs.ul.x + x ), er->border_color, (unsigned char)er->border_chars[1] );
     84                        m_terminal->print( position( abs.ul.y, abs.ul.x + x ), er->border_color, er->border_chars[0] );
     85                        m_terminal->print( position( abs.lr.y, abs.ul.x + x ), er->border_color, er->border_chars[1] );
    8686                }
    8787
    8888                for ( int y = 0; y < abs.get_height(); ++y )
    8989                {
    90                         m_terminal->print( position( abs.ul.y + y, abs.ul.x ), er->border_color, (unsigned char)er->border_chars[2] );
    91                         m_terminal->print( position( abs.ul.y + y, abs.lr.x ), er->border_color, (unsigned char)er->border_chars[3] );
     90                        m_terminal->print( position( abs.ul.y + y, abs.ul.x ), er->border_color, er->border_chars[2] );
     91                        m_terminal->print( position( abs.ul.y + y, abs.lr.x ), er->border_color, er->border_chars[3] );
    9292                }
    9393
    94                 m_terminal->print( abs.ul,   er->border_color, (unsigned char)er->border_chars[4] );
    95                 m_terminal->print( abs.ur(), er->border_color, (unsigned char)er->border_chars[5] );
    96                 m_terminal->print( abs.ll(), er->border_color, (unsigned char)er->border_chars[6] );
    97                 m_terminal->print( abs.lr,   er->border_color, (unsigned char)er->border_chars[7] );
     94                m_terminal->print( abs.ul,   er->border_color, er->border_chars[4] );
     95                m_terminal->print( abs.ur(), er->border_color, er->border_chars[5] );
     96                m_terminal->print( abs.ll(), er->border_color, er->border_chars[6] );
     97                m_terminal->print( abs.lr,   er->border_color, er->border_chars[7] );
    9898        }
    9999        if ( !e->m_text.empty() )
     
    102102                for ( char c : e->m_text )
    103103                {
    104                         m_terminal->print( p, er->text_color, (unsigned char)c );
     104                        m_terminal->print( p, er->text_color, static_cast< unsigned char >( c ) );
    105105                        ++p.x;
    106106                }
Note: See TracChangeset for help on using the changeset viewer.