Remove various assert(constant) calls
These cause warnings from static checkers, and seem to lead to spurious GCC7 -Wmaybe-uninitialized.
This commit is contained in:
@@ -126,7 +126,6 @@ Validity ConditionalCursorMove::get_validity( const Framebuffer &fb,
|
||||
|
||||
if ( (row >= fb.ds.get_height())
|
||||
|| (col >= fb.ds.get_width()) ) {
|
||||
// assert( false );
|
||||
// fprintf( stderr, "Crazy cursor (%d,%d)!\n", row, col );
|
||||
return IncorrectOrExpired;
|
||||
}
|
||||
@@ -299,9 +298,8 @@ void NotificationEngine::apply( Framebuffer &fb ) const
|
||||
}
|
||||
break;
|
||||
case -1: /* unprintable character */
|
||||
default: /* Bogus width, ignore. */
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,7 +286,6 @@ Connection::Connection( const char *desired_ip, const char *desired_port ) /* se
|
||||
throw; /* this time it's fatal */
|
||||
}
|
||||
|
||||
assert( false );
|
||||
throw NetworkException( "Could not bind", errno );
|
||||
}
|
||||
|
||||
@@ -352,7 +351,6 @@ bool Connection::try_bind( const char *addr, int port_low, int port_high )
|
||||
}
|
||||
}
|
||||
|
||||
assert( false );
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -458,7 +456,6 @@ string Connection::recv( void )
|
||||
prune_sockets();
|
||||
return payload;
|
||||
}
|
||||
assert( false );
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@@ -95,7 +95,6 @@ string UserStream::diff_from( const UserStream &existing ) const
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -131,7 +130,6 @@ const Parser::Action &UserStream::get_action( unsigned int i ) const
|
||||
case ResizeType:
|
||||
return actions[ i ].resize;
|
||||
default:
|
||||
assert( false );
|
||||
static const Parser::Ignore nothing = Parser::Ignore();
|
||||
return nothing;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace Network {
|
||||
/* interface for Network::Transport */
|
||||
void subtract( const UserStream *prefix );
|
||||
string diff_from( const UserStream &existing ) const;
|
||||
string init_diff( void ) const { assert( false ); return string(); };
|
||||
string init_diff( void ) const { return string(); };
|
||||
void apply_string( const string &diff );
|
||||
bool operator==( const UserStream &x ) const { return actions == x.actions; }
|
||||
|
||||
|
||||
@@ -140,9 +140,7 @@ void Emulator::print( const Parser::Print *act )
|
||||
}
|
||||
break;
|
||||
case -1: /* unprintable character */
|
||||
break;
|
||||
default:
|
||||
assert( false );
|
||||
default: /* bogus width, ignore */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,6 @@ string UserInput::input( const Parser::UserByte *act,
|
||||
default:
|
||||
/* This doesn't handle the 8-bit SS3 C1 control, which would be
|
||||
two octets in UTF-8. Fortunately nobody seems to send this. */
|
||||
assert( false );
|
||||
return string();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ int main( int argc, char *argv[] ) {
|
||||
} catch ( const CryptoException &e ) {
|
||||
fprintf( stderr, "Crypto exception: %s\r\n",
|
||||
e.what() );
|
||||
fatal_assert( false );
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user