Const correctness and const-ref in Crypto and elsewhere.

This commit is contained in:
John Hood
2015-12-25 22:18:04 -05:00
parent 13928e9c10
commit 6abd4739de
16 changed files with 46 additions and 46 deletions
+1 -1
View File
@@ -102,7 +102,7 @@ string Complete::init_diff( void ) const
return diff_from( Complete( get_fb().ds.get_width(), get_fb().ds.get_height() ));
}
void Complete::apply_string( string diff )
void Complete::apply_string( const string & diff )
{
HostBuffers::HostMessage input;
fatal_assert( input.ParseFromString( diff ) );
+1 -1
View File
@@ -77,7 +77,7 @@ namespace Terminal {
void subtract( const Complete * ) const {}
std::string diff_from( const Complete &existing ) const;
std::string init_diff( void ) const;
void apply_string( std::string diff );
void apply_string( const std::string & diff );
bool operator==( const Complete &x ) const;
bool compare( const Complete &other ) const;
+1 -1
View File
@@ -105,7 +105,7 @@ string UserStream::diff_from( const UserStream &existing ) const
return output.SerializeAsString();
}
void UserStream::apply_string( string diff )
void UserStream::apply_string( const string &diff )
{
ClientBuffers::UserMessage input;
fatal_assert( input.ParseFromString( diff ) );
+5 -5
View File
@@ -57,8 +57,8 @@ namespace Network {
Parser::UserByte userbyte;
Parser::Resize resize;
UserEvent( Parser::UserByte s_userbyte ) : type( UserByteType ), userbyte( s_userbyte ), resize( -1, -1 ) {}
UserEvent( Parser::Resize s_resize ) : type( ResizeType ), userbyte( 0 ), resize( s_resize ) {}
UserEvent( const Parser::UserByte & s_userbyte ) : type( UserByteType ), userbyte( s_userbyte ), resize( -1, -1 ) {}
UserEvent( const Parser::Resize & s_resize ) : type( ResizeType ), userbyte( 0 ), resize( s_resize ) {}
UserEvent() /* default constructor required by C++11 STL */
: type( UserByteType ),
@@ -79,8 +79,8 @@ namespace Network {
public:
UserStream() : actions() {}
void push_back( Parser::UserByte s_userbyte ) { actions.push_back( UserEvent( s_userbyte ) ); }
void push_back( Parser::Resize s_resize ) { actions.push_back( UserEvent( s_resize ) ); }
void push_back( const Parser::UserByte & s_userbyte ) { actions.push_back( UserEvent( s_userbyte ) ); }
void push_back( const Parser::Resize & s_resize ) { actions.push_back( UserEvent( s_resize ) ); }
bool empty( void ) const { return actions.empty(); }
size_t size( void ) const { return actions.size(); }
@@ -90,7 +90,7 @@ namespace Network {
void subtract( const UserStream *prefix );
string diff_from( const UserStream &existing ) const;
string init_diff( void ) const { assert( false ); return string(); };
void apply_string( string diff );
void apply_string( const string &diff );
bool operator==( const UserStream &x ) const { return actions == x.actions; }
bool compare( const UserStream & ) { return false; }