Fix various new compiler warnings.

terminalfunctions.cc: set_if_available() was undeclared.
Fix printf() wint_t/wchar_t warnings.
mosh-server.cc: Fix warning for side effects inside typeid().

Signed-off-by: John Hood <cgull@glup.org>
This commit is contained in:
John Hood
2015-06-05 23:35:18 -04:00
parent b604a7d7c2
commit 543f346ac7
6 changed files with 11 additions and 10 deletions
+1 -1
View File
@@ -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 );
}
+4 -4
View File
@@ -81,7 +81,7 @@ std::string Display::new_frame( bool initialized, const Framebuffer &last, const
for ( std::deque<wchar_t>::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<wchar_t>::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<wchar_t>::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<wchar_t>::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 );
}
+1 -1
View File
@@ -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 ) {
+1 -1
View File
@@ -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; }
}