clang-format Mosh
Run clang-format over the Mosh source tree. This is a large change and
has been factored into its own commit for auditability. Reproduce it
with
find . -name \*.cc -or -name \*.h | while read f; do clang-format -i --style=file $f; done
This commit is contained in:
committed by
Alex Chernyakhovsky
parent
0b15dc94fa
commit
3acaa1c4d3
+27
-32
@@ -33,18 +33,19 @@
|
||||
#ifndef STM_CLIENT_HPP
|
||||
#define STM_CLIENT_HPP
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
#include <termios.h>
|
||||
|
||||
#include "src/statesync/completeterminal.h"
|
||||
#include "src/network/networktransport.h"
|
||||
#include "src/statesync/user.h"
|
||||
#include "src/frontend/terminaloverlay.h"
|
||||
#include "src/network/networktransport.h"
|
||||
#include "src/statesync/completeterminal.h"
|
||||
#include "src/statesync/user.h"
|
||||
|
||||
class STMClient {
|
||||
class STMClient
|
||||
{
|
||||
private:
|
||||
std::string ip;
|
||||
std::string port;
|
||||
@@ -88,42 +89,36 @@ private:
|
||||
void resume( void ); /* restore state after SIGCONT */
|
||||
|
||||
public:
|
||||
STMClient( const char *s_ip, const char *s_port, const char *s_key, const char *predict_mode, unsigned int s_verbose, const char *predict_overwrite )
|
||||
: ip( s_ip ? s_ip : "" ), port( s_port ? s_port : "" ),
|
||||
key( s_key ? s_key : "" ),
|
||||
escape_key( 0x1E ), escape_pass_key( '^' ), escape_pass_key2( '^' ),
|
||||
escape_requires_lf( false ), escape_key_help( L"?" ),
|
||||
saved_termios(), raw_termios(),
|
||||
window_size(),
|
||||
local_framebuffer( 1, 1 ),
|
||||
new_state( 1, 1 ),
|
||||
overlays(),
|
||||
network(),
|
||||
display( true ), /* use TERM environment var to initialize display */
|
||||
connecting_notification(),
|
||||
repaint_requested( false ),
|
||||
lf_entered( false ),
|
||||
quit_sequence_started( false ),
|
||||
clean_shutdown( false ),
|
||||
verbose( s_verbose )
|
||||
STMClient( const char* s_ip,
|
||||
const char* s_port,
|
||||
const char* s_key,
|
||||
const char* predict_mode,
|
||||
unsigned int s_verbose,
|
||||
const char* predict_overwrite )
|
||||
: ip( s_ip ? s_ip : "" ), port( s_port ? s_port : "" ), key( s_key ? s_key : "" ), escape_key( 0x1E ),
|
||||
escape_pass_key( '^' ), escape_pass_key2( '^' ), escape_requires_lf( false ), escape_key_help( L"?" ),
|
||||
saved_termios(), raw_termios(), window_size(), local_framebuffer( 1, 1 ), new_state( 1, 1 ), overlays(),
|
||||
network(), display( true ), /* use TERM environment var to initialize display */
|
||||
connecting_notification(), repaint_requested( false ), lf_entered( false ), quit_sequence_started( false ),
|
||||
clean_shutdown( false ), verbose( s_verbose )
|
||||
{
|
||||
if ( predict_mode ) {
|
||||
if ( !strcmp( predict_mode, "always" ) ) {
|
||||
overlays.get_prediction_engine().set_display_preference( Overlay::PredictionEngine::Always );
|
||||
overlays.get_prediction_engine().set_display_preference( Overlay::PredictionEngine::Always );
|
||||
} else if ( !strcmp( predict_mode, "never" ) ) {
|
||||
overlays.get_prediction_engine().set_display_preference( Overlay::PredictionEngine::Never );
|
||||
overlays.get_prediction_engine().set_display_preference( Overlay::PredictionEngine::Never );
|
||||
} else if ( !strcmp( predict_mode, "adaptive" ) ) {
|
||||
overlays.get_prediction_engine().set_display_preference( Overlay::PredictionEngine::Adaptive );
|
||||
overlays.get_prediction_engine().set_display_preference( Overlay::PredictionEngine::Adaptive );
|
||||
} else if ( !strcmp( predict_mode, "experimental" ) ) {
|
||||
overlays.get_prediction_engine().set_display_preference( Overlay::PredictionEngine::Experimental );
|
||||
overlays.get_prediction_engine().set_display_preference( Overlay::PredictionEngine::Experimental );
|
||||
} else {
|
||||
fprintf( stderr, "Unknown prediction mode %s.\n", predict_mode );
|
||||
exit( 1 );
|
||||
fprintf( stderr, "Unknown prediction mode %s.\n", predict_mode );
|
||||
exit( 1 );
|
||||
}
|
||||
}
|
||||
if ( predict_overwrite && !strcmp( predict_overwrite, "yes" ) ) {
|
||||
overlays.get_prediction_engine().set_predict_overwrite( true );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void init( void );
|
||||
@@ -131,8 +126,8 @@ public:
|
||||
bool main( void );
|
||||
|
||||
/* unused */
|
||||
STMClient( const STMClient & );
|
||||
STMClient & operator=( const STMClient & );
|
||||
STMClient( const STMClient& );
|
||||
STMClient& operator=( const STMClient& );
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user