diff --git a/src/examples/parse.cc b/src/examples/parse.cc index 42dfc45..93fabf4 100644 --- a/src/examples/parse.cc +++ b/src/examples/parse.cc @@ -206,7 +206,7 @@ static int vt_parser( int fd, Parser::UTF8Parser *parser ) if ( act->char_present ) { if ( iswprint( act->ch ) ) { - printf( "%s(0x%02x=%lc) ", act->name().c_str(), (unsigned int)act->ch, act->ch ); + printf( "%s(0x%02x=%lc) ", act->name().c_str(), (unsigned int)act->ch, (wint_t)act->ch ); } else { printf( "%s(0x%02x) ", act->name().c_str(), (unsigned int)act->ch ); } diff --git a/src/frontend/mosh-server.cc b/src/frontend/mosh-server.cc index 7c971bc..4c13ca2 100644 --- a/src/frontend/mosh-server.cc +++ b/src/frontend/mosh-server.cc @@ -585,8 +585,9 @@ static void serve( int host_fd, Terminal::Complete &terminal, ServerConnection & us.apply_string( network.get_remote_diff() ); /* apply userstream to terminal */ for ( size_t i = 0; i < us.size(); i++ ) { - terminal_to_host += terminal.act( us.get_action( i ) ); - if ( typeid( *us.get_action( i ) ) == typeid( Parser::Resize ) ) { + const Parser::Action *action = us.get_action( i ); + terminal_to_host += terminal.act( action ); + if ( typeid( action ) == typeid( Parser::Resize ) ) { /* tell child process of resize */ const Parser::Resize *res = static_cast( us.get_action( i ) ); struct winsize window_size; diff --git a/src/terminal/parseraction.cc b/src/terminal/parseraction.cc index 43a9c70..019d5e7 100644 --- a/src/terminal/parseraction.cc +++ b/src/terminal/parseraction.cc @@ -43,7 +43,7 @@ std::string Action::str( void ) char thechar[ 10 ] = { 0 }; if ( char_present ) { if ( iswprint( ch ) ) - snprintf( thechar, 10, "(%lc)", ch ); + snprintf( thechar, 10, "(%lc)", (wint_t)ch ); else snprintf( thechar, 10, "(0x%x)", (unsigned int)ch ); } diff --git a/src/terminal/terminaldisplay.cc b/src/terminal/terminaldisplay.cc index dfa153a..9bcb265 100644 --- a/src/terminal/terminaldisplay.cc +++ b/src/terminal/terminaldisplay.cc @@ -81,7 +81,7 @@ std::string Display::new_frame( bool initialized, const Framebuffer &last, const for ( std::deque::const_iterator i = window_title.begin(); i != window_title.end(); i++ ) { - snprintf( tmp, 64, "%lc", *i ); + snprintf( tmp, 64, "%lc", (wint_t)*i ); frame.append( tmp ); } frame.append( "\007" ); @@ -93,7 +93,7 @@ std::string Display::new_frame( bool initialized, const Framebuffer &last, const for ( std::deque::const_iterator i = icon_name.begin(); i != icon_name.end(); i++ ) { - snprintf( tmp, 64, "%lc", *i ); + snprintf( tmp, 64, "%lc", (wint_t)*i ); frame.append( tmp ); } frame.append( "\007" ); @@ -103,7 +103,7 @@ std::string Display::new_frame( bool initialized, const Framebuffer &last, const for ( std::deque::const_iterator i = window_title.begin(); i != window_title.end(); i++ ) { - snprintf( tmp, 64, "%lc", *i ); + snprintf( tmp, 64, "%lc", (wint_t)*i ); frame.append( tmp ); } frame.append( "\007" ); @@ -421,7 +421,7 @@ void Display::put_cell( bool initialized, FrameState &frame, const Framebuffer & for ( std::vector::const_iterator i = cell->contents.begin(); i != cell->contents.end(); i++ ) { - snprintf( tmp, 64, "%lc", *i ); + snprintf( tmp, 64, "%lc", (wint_t)*i ); frame.append( tmp ); } diff --git a/src/terminal/terminalframebuffer.cc b/src/terminal/terminalframebuffer.cc index 3ab753d..477d786 100644 --- a/src/terminal/terminalframebuffer.cc +++ b/src/terminal/terminalframebuffer.cc @@ -589,7 +589,7 @@ bool Cell::compare( const Cell &other ) const if ( !contents_match( other ) ) { ret = true; fprintf( stderr, "Contents: %lc vs. %lc\n", - debug_contents(), other.debug_contents() ); + (wint_t)debug_contents(), (wint_t)other.debug_contents() ); } if ( fallback != other.fallback ) { diff --git a/src/terminal/terminalfunctions.cc b/src/terminal/terminalfunctions.cc index 5cab15a..35c8055 100644 --- a/src/terminal/terminalfunctions.cc +++ b/src/terminal/terminalfunctions.cc @@ -279,7 +279,7 @@ static bool *get_DEC_mode( int param, Framebuffer *fb ) { } /* helper for CSI_DECSM and CSI_DECRM */ -void set_if_available( bool *mode, bool value ) +static void set_if_available( bool *mode, bool value ) { if ( mode ) { *mode = value; } }