Various switch statement fixes.

This commit is contained in:
John Hood
2016-11-07 01:00:03 -05:00
parent 3346419724
commit 4835dcf5ee
3 changed files with 20 additions and 8 deletions
+3 -2
View File
@@ -250,8 +250,9 @@ int main( int argc, char *argv[] )
locale_vars.push_back( string( optarg ) ); locale_vars.push_back( string( optarg ) );
break; break;
default: default:
print_usage( stderr, argv[ 0 ] );
/* don't die on unknown options */ /* don't die on unknown options */
print_usage( stderr, argv[ 0 ] );
break;
} }
} }
} else if ( argc == 1 ) { } else if ( argc == 1 ) {
@@ -658,7 +659,7 @@ static void serve( int host_fd, Terminal::Complete &terminal, ServerConnection &
bool child_released = false; bool child_released = false;
while ( 1 ) { while ( true ) {
try { try {
static const uint64_t timeout_if_no_client = 60000; static const uint64_t timeout_if_no_client = 60000;
int timeout = INT_MAX; int timeout = INT_MAX;
+1
View File
@@ -512,6 +512,7 @@ void Renditions::set_rendition( color_type num )
case 5: case 25: set_attribute(blink, value); break; case 5: case 25: set_attribute(blink, value); break;
case 7: case 27: set_attribute(inverse, value); break; case 7: case 27: set_attribute(inverse, value); break;
case 8: case 28: set_attribute(invisible, value); break; case 8: case 28: set_attribute(invisible, value); break;
default: assert(false);
} }
} }
+16 -6
View File
@@ -64,6 +64,8 @@ static void CSI_EL( Framebuffer *fb, Dispatcher *dispatch )
case 2: /* all of line */ case 2: /* all of line */
fb->reset_row( fb->get_mutable_row( -1 ) ); fb->reset_row( fb->get_mutable_row( -1 ) );
break; break;
default:
break;
} }
} }
@@ -89,6 +91,8 @@ static void CSI_ED( Framebuffer *fb, Dispatcher *dispatch ) {
fb->reset_row( fb->get_mutable_row( y ) ); fb->reset_row( fb->get_mutable_row( y ) );
} }
break; break;
default:
break;
} }
} }
@@ -114,10 +118,11 @@ static void CSI_cursormove( Framebuffer *fb, Dispatcher *dispatch )
break; break;
case 'H': case 'H':
case 'f': case 'f':
int x = dispatch->getparam( 0, 1 ); fb->ds.move_row( dispatch->getparam( 0, 1 ) - 1 );
int y = dispatch->getparam( 1, 1 ); fb->ds.move_col( dispatch->getparam( 1, 1 ) - 1 );
fb->ds.move_row( x - 1 ); break;
fb->ds.move_col( y - 1 ); default:
break;
} }
} }
@@ -261,6 +266,8 @@ static void CSI_TBC( Framebuffer *fb, Dispatcher *dispatch )
fb->ds.clear_tab( x ); fb->ds.clear_tab( x );
} }
break; break;
default:
break;
} }
} }
@@ -295,6 +302,8 @@ static bool *get_DEC_mode( int param, Framebuffer *fb ) {
return &(fb->ds.mouse_alternate_scroll); return &(fb->ds.mouse_alternate_scroll);
case 2004: /* bracketed paste */ case 2004: /* bracketed paste */
return &(fb->ds.bracketed_paste); return &(fb->ds.bracketed_paste);
default:
break;
} }
return NULL; return NULL;
} }
@@ -340,8 +349,7 @@ static Function func_CSI_DECSM( CSI, "?h", CSI_DECSM, false );
static Function func_CSI_DECRM( CSI, "?l", CSI_DECRM, false ); static Function func_CSI_DECRM( CSI, "?l", CSI_DECRM, false );
static bool *get_ANSI_mode( int param, Framebuffer *fb ) { static bool *get_ANSI_mode( int param, Framebuffer *fb ) {
switch ( param ) { if ( param == 4 ) { /* insert/replace mode */
case 4: /* insert/replace mode */
return &(fb->ds.insert_mode); return &(fb->ds.insert_mode);
} }
return NULL; return NULL;
@@ -452,6 +460,8 @@ static void CSI_DSR( Framebuffer *fb, Dispatcher *dispatch )
fb->ds.get_cursor_col() + 1 ); fb->ds.get_cursor_col() + 1 );
dispatch->terminal_to_host.append( cpr ); dispatch->terminal_to_host.append( cpr );
break; break;
default:
break;
} }
} }