diff --git a/src/network/transportfragment.cc b/src/network/transportfragment.cc index 6e6fb73..d3cb81f 100644 --- a/src/network/transportfragment.cc +++ b/src/network/transportfragment.cc @@ -148,7 +148,7 @@ Instruction FragmentAssembly::get_assembly( void ) return ret; } -bool Fragment::operator==( const Fragment &x ) +bool Fragment::operator==( const Fragment &x ) const { return ( id == x.id ) && ( fragment_num == x.fragment_num ) && ( final == x.final ) && ( initialized == x.initialized ) && ( contents == x.contents ); diff --git a/src/network/transportfragment.h b/src/network/transportfragment.h index 7c80eb5..5e99ed1 100644 --- a/src/network/transportfragment.h +++ b/src/network/transportfragment.h @@ -73,7 +73,7 @@ namespace Network { string tostring( void ); - bool operator==( const Fragment &x ); + bool operator==( const Fragment &x ) const; }; class FragmentAssembly diff --git a/src/statesync/completeterminal.h b/src/statesync/completeterminal.h index 662853e..f06f621 100644 --- a/src/statesync/completeterminal.h +++ b/src/statesync/completeterminal.h @@ -70,7 +70,7 @@ namespace Terminal { int wait_time( uint64_t now ) const; /* interface for Network::Transport */ - void subtract( const Complete * ) {} + void subtract( const Complete * ) const {} std::string diff_from( const Complete &existing ) const; void apply_string( std::string diff ); bool operator==( const Complete &x ) const; diff --git a/src/statesync/user.cc b/src/statesync/user.cc index 67cac17..763e860 100644 --- a/src/statesync/user.cc +++ b/src/statesync/user.cc @@ -123,7 +123,7 @@ void UserStream::apply_string( string diff ) } } -const Parser::Action *UserStream::get_action( unsigned int i ) +const Parser::Action *UserStream::get_action( unsigned int i ) const { switch( actions[ i ].type ) { case UserByteType: diff --git a/src/statesync/user.h b/src/statesync/user.h index eacccf7..dbbaf8f 100644 --- a/src/statesync/user.h +++ b/src/statesync/user.h @@ -84,7 +84,7 @@ namespace Network { bool empty( void ) const { return actions.empty(); } size_t size( void ) const { return actions.size(); } - const Parser::Action *get_action( unsigned int i ); + const Parser::Action *get_action( unsigned int i ) const; /* interface for Network::Transport */ void subtract( const UserStream *prefix ); @@ -92,7 +92,7 @@ namespace Network { void apply_string( string diff ); bool operator==( const UserStream &x ) const { return actions == x.actions; } - bool compare( const UserStream & ) const { return false; } + bool compare( const UserStream & ) { return false; } }; } diff --git a/src/terminal/parser.cc b/src/terminal/parser.cc index 1a9acc5..d765e04 100644 --- a/src/terminal/parser.cc +++ b/src/terminal/parser.cc @@ -76,6 +76,7 @@ Parser::UTF8Parser::UTF8Parser() : parser(), buf_len( 0 ) { assert( BUF_SIZE >= (size_t)MB_CUR_MAX ); + buf[0] = '\0'; } std::list Parser::UTF8Parser::input( char c ) diff --git a/src/terminal/terminaldisplay.h b/src/terminal/terminaldisplay.h index 028f62e..cd96971 100644 --- a/src/terminal/terminaldisplay.h +++ b/src/terminal/terminaldisplay.h @@ -65,9 +65,9 @@ namespace Terminal { class Display { private: - bool ti_flag( const char *capname ) const; - int ti_num( const char *capname ) const; - const char *ti_str( const char *capname ) const; + static bool ti_flag( const char *capname ); + static int ti_num( const char *capname ); + static const char *ti_str( const char *capname ); bool has_ech; /* erase character is part of vt200 but not supported by tmux (or by "screen" terminfo entry, which is what tmux advertises) */ diff --git a/src/terminal/terminaldisplayinit.cc b/src/terminal/terminaldisplayinit.cc index 6a0886e..bcab7b8 100644 --- a/src/terminal/terminaldisplayinit.cc +++ b/src/terminal/terminaldisplayinit.cc @@ -62,7 +62,7 @@ using namespace Terminal; -bool Display::ti_flag( const char *capname ) const +bool Display::ti_flag( const char *capname ) { int val = tigetflag( const_cast( capname ) ); if ( val == -1 ) { @@ -71,7 +71,7 @@ bool Display::ti_flag( const char *capname ) const return val; } -int Display::ti_num( const char *capname ) const +int Display::ti_num( const char *capname ) { int val = tigetnum( const_cast( capname ) ); if ( val == -2 ) { @@ -80,7 +80,7 @@ int Display::ti_num( const char *capname ) const return val; } -const char *Display::ti_str( const char *capname ) const +const char *Display::ti_str( const char *capname ) { const char *val = tigetstr( const_cast( capname ) ); if ( val == (const char *)-1 ) { diff --git a/src/terminal/terminalframebuffer.cc b/src/terminal/terminalframebuffer.cc index 477d786..69cba24 100644 --- a/src/terminal/terminalframebuffer.cc +++ b/src/terminal/terminalframebuffer.cc @@ -183,7 +183,7 @@ void DrawState::clear_tab( int col ) tabs[ col ] = false; } -int DrawState::get_next_tab( void ) +int DrawState::get_next_tab( void ) const { for ( int i = cursor_col + 1; i < width; i++ ) { if ( tabs[ i ] ) { @@ -215,12 +215,12 @@ void DrawState::set_scrolling_region( int top, int bottom ) } } -int DrawState::limit_top( void ) +int DrawState::limit_top( void ) const { return origin_mode ? scrolling_region_top_row : 0; } -int DrawState::limit_bottom( void ) +int DrawState::limit_bottom( void ) const { return origin_mode ? scrolling_region_bottom_row : height - 1; } @@ -573,7 +573,7 @@ void Framebuffer::prefix_window_title( const std::deque &s ) } } -wchar_t Cell::debug_contents( void ) const +wint_t Cell::debug_contents( void ) const { if ( contents.empty() ) { return '_'; @@ -589,7 +589,7 @@ bool Cell::compare( const Cell &other ) const if ( !contents_match( other ) ) { ret = true; fprintf( stderr, "Contents: %lc vs. %lc\n", - (wint_t)debug_contents(), (wint_t)other.debug_contents() ); + debug_contents(), other.debug_contents() ); } if ( fallback != other.fallback ) { diff --git a/src/terminal/terminalframebuffer.h b/src/terminal/terminalframebuffer.h index 497a49e..720482d 100644 --- a/src/terminal/terminalframebuffer.h +++ b/src/terminal/terminalframebuffer.h @@ -102,7 +102,7 @@ namespace Terminal { && (wrap == x.wrap) ); } - wchar_t debug_contents( void ) const; + wint_t debug_contents( void ) const; bool is_blank( void ) const { @@ -228,15 +228,15 @@ namespace Terminal { void clear_tab( int col ); void clear_default_tabs( void ) { default_tabs = false; } /* Default tabs can't be restored without resetting the draw state. */ - int get_next_tab( void ); + int get_next_tab( void ) const; void set_scrolling_region( int top, int bottom ); int get_scrolling_region_top_row( void ) const { return scrolling_region_top_row; } int get_scrolling_region_bottom_row( void ) const { return scrolling_region_bottom_row; } - int limit_top( void ); - int limit_bottom( void ); + int limit_top( void ) const; + int limit_bottom( void ) const; void set_foreground_color( int x ) { renditions.set_foreground_color( x ); } void set_background_color( int x ) { renditions.set_background_color( x ); } diff --git a/src/util/select.h b/src/util/select.h index 6d9922f..a9394aa 100644 --- a/src/util/select.h +++ b/src/util/select.h @@ -98,7 +98,7 @@ public: FD_ZERO( &all_fds ); } - void add_signal( int signum ) + static void add_signal( int signum ) { fatal_assert( signum >= 0 ); fatal_assert( signum <= MAX_SIGNAL_NUMBER );