Skip to content

Commit 4355a29

Browse files
committed
remove trailing whitespace
1 parent 851195d commit 4355a29

27 files changed

+78
-81
lines changed

src/crypto/base64.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ void base64_encode( const uint8_t *raw, const size_t raw_len,
110110
raw += 3;
111111
b64 += 4;
112112
}
113-
113+
114114
/* last byte of input, last 4 of output */
115115
uint8_t lastchar = *raw;
116116
b64[0] = table[(lastchar >> 2) & 0x3f];

src/crypto/crypto.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Base64Key::Base64Key(PRNG &prng)
143143
string Base64Key::printable_key( void ) const
144144
{
145145
char base64[ 24 ];
146-
146+
147147
base64_encode( key, 16, base64, 24 );
148148

149149
if ( (base64[ 23 ] != '=')

src/crypto/crypto.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,17 @@ namespace Crypto {
110110
public:
111111
Nonce( uint64_t val );
112112
Nonce( const char *s_bytes, size_t len );
113-
113+
114114
string cc_str( void ) const { return string( bytes + 4, 8 ); }
115115
const char *data( void ) const { return bytes; }
116116
uint64_t val( void ) const;
117117
};
118-
118+
119119
class Message {
120120
public:
121121
const Nonce nonce;
122122
const string text;
123-
123+
124124
Message( const char *nonce_bytes, size_t nonce_len,
125125
const char *text_bytes, size_t text_len )
126126
: nonce( nonce_bytes, nonce_len ),
@@ -130,7 +130,7 @@ namespace Crypto {
130130
: nonce( s_nonce ),
131131
text( s_text ) {}
132132
};
133-
133+
134134
class Session {
135135
private:
136136
Base64Key key;
@@ -141,21 +141,21 @@ namespace Crypto {
141141
AlignedBuffer plaintext_buffer;
142142
AlignedBuffer ciphertext_buffer;
143143
AlignedBuffer nonce_buffer;
144-
144+
145145
public:
146146
static const int RECEIVE_MTU = 2048;
147147
/* Overhead (not counting the nonce, which is handled by network transport) */
148148
static const int ADDED_BYTES = 16 /* final OCB block */;
149149

150150
Session( Base64Key s_key );
151151
~Session();
152-
152+
153153
const string encrypt( const Message & plaintext );
154154
const Message decrypt( const char *str, size_t len );
155155
const Message decrypt( const string & ciphertext ) {
156156
return decrypt( ciphertext.data(), ciphertext.size() );
157157
}
158-
158+
159159
Session( const Session & );
160160
Session & operator=( const Session & );
161161
};

src/examples/ntester.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ int main( int argc, char *argv[] )
5656
if ( argc > 1 ) {
5757
server = false;
5858
/* client */
59-
59+
6060
key = argv[ 1 ];
6161
ip = argv[ 2 ];
6262
port = argv[ 3 ];
63-
63+
6464
raw_n = new Transport<UserStream, UserStream>( me, remote, key, ip, port );
6565
} else {
6666
raw_n = new Transport<UserStream, UserStream>( me, remote, NULL, NULL );
@@ -86,7 +86,7 @@ int main( int argc, char *argv[] )
8686
perror( "select" );
8787
exit( 1 );
8888
}
89-
89+
9090
n->tick();
9191

9292
if ( sel.read( network_fd ) ) {
@@ -167,6 +167,6 @@ int main( int argc, char *argv[] )
167167
if ( tcsetattr( STDIN_FILENO, TCSANOW, &saved_termios ) < 0 ) {
168168
perror( "tcsetattr" );
169169
exit( 1 );
170-
}
170+
}
171171
}
172172
}

src/examples/termemu.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,13 +266,13 @@ static void emulate_terminal( int fd )
266266
perror( "read" );
267267
return;
268268
}
269-
269+
270270
std::string terminal_to_host;
271-
271+
272272
for ( int i = 0; i < bytes_read; i++ ) {
273273
terminal_to_host += complete.act( Parser::UserByte( buf[ i ] ) );
274274
}
275-
275+
276276
if ( swrite( fd, terminal_to_host.c_str(), terminal_to_host.length() ) < 0 ) {
277277
break;
278278
}
@@ -288,7 +288,7 @@ static void emulate_terminal( int fd )
288288
perror( "read" );
289289
return;
290290
}
291-
291+
292292
std::string terminal_to_host = complete.act( std::string( buf, bytes_read ) );
293293
if ( swrite( fd, terminal_to_host.c_str(), terminal_to_host.length() ) < 0 ) {
294294
break;

src/frontend/mosh-server.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -728,12 +728,12 @@ static void serve( int host_fd, Terminal::Complete &terminal, ServerConnection &
728728
if ( sel.read( network_fd ) ) {
729729
/* packet received from the network */
730730
network.recv();
731-
731+
732732
/* is new user input available for the terminal? */
733733
if ( network.get_remote_state_num() != last_remote_num ) {
734734
last_remote_num = network.get_remote_state_num();
735735

736-
736+
737737
Network::UserStream us;
738738
us.apply_string( network.get_remote_diff() );
739739
/* apply userstream to terminal */
@@ -828,12 +828,12 @@ static void serve( int host_fd, Terminal::Complete &terminal, ServerConnection &
828828
}
829829
}
830830
}
831-
831+
832832
if ( (!network.shutdown_in_progress()) && sel.read( host_fd ) ) {
833833
/* input from the host needs to be fed to the terminal */
834834
const int buf_size = 16384;
835835
char buf[ buf_size ];
836-
836+
837837
/* fill buffer if possible */
838838
ssize_t bytes_read = read( host_fd, buf, buf_size );
839839

@@ -843,7 +843,7 @@ static void serve( int host_fd, Terminal::Complete &terminal, ServerConnection &
843843
network.start_shutdown();
844844
} else {
845845
terminal_to_host += terminal.act( string( buf, bytes_read ) );
846-
846+
847847
/* update client with new state of terminal */
848848
network.set_current_state( terminal );
849849
}
@@ -858,7 +858,7 @@ static void serve( int host_fd, Terminal::Complete &terminal, ServerConnection &
858858
if ( network_timeout_ms &&
859859
network_timeout_ms <= time_since_remote_state ) {
860860
idle_shutdown = true;
861-
fprintf( stderr, "Network idle for %llu seconds.\n",
861+
fprintf( stderr, "Network idle for %llu seconds.\n",
862862
static_cast<unsigned long long>( time_since_remote_state / 1000 ) );
863863
}
864864
if ( sel.signal( SIGUSR1 )
@@ -876,7 +876,7 @@ static void serve( int host_fd, Terminal::Complete &terminal, ServerConnection &
876876
break;
877877
}
878878
}
879-
879+
880880
/* quit if our shutdown has been acknowledged */
881881
if ( network.shutdown_in_progress() && network.shutdown_acknowledged() ) {
882882
break;
@@ -894,7 +894,7 @@ static void serve( int host_fd, Terminal::Complete &terminal, ServerConnection &
894894

895895
#ifdef HAVE_UTEMPTER
896896
/* update utmp if has been more than 30 seconds since heard from client */
897-
if ( connected_utmp
897+
if ( connected_utmp
898898
&& time_since_remote_state > 30000 ) {
899899
utempter_remove_record( host_fd );
900900

src/frontend/stmclient.cc

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ void STMClient::shutdown( void )
208208

209209
/* Restore terminal and terminal-driver state */
210210
swrite( STDOUT_FILENO, display.close().c_str() );
211-
211+
212212
if ( tcsetattr( STDIN_FILENO, TCSANOW, &saved_termios ) < 0 ) {
213213
perror( "tcsetattr" );
214214
exit( 1 );
@@ -239,7 +239,7 @@ void STMClient::main_init( void )
239239
if ( ioctl( STDIN_FILENO, TIOCGWINSZ, &window_size ) < 0 ) {
240240
perror( "ioctl TIOCGWINSZ" );
241241
return;
242-
}
242+
}
243243

244244
/* local state */
245245
local_framebuffer = Terminal::Framebuffer( window_size.ws_col, window_size.ws_row );
@@ -290,7 +290,7 @@ void STMClient::output_new_frame( void )
290290
void STMClient::process_network_input( void )
291291
{
292292
network->recv();
293-
293+
294294
/* Now give hints to the overlays */
295295
overlays.get_notification_engine().server_heard( network->get_latest_remote_state().timestamp );
296296
overlays.get_notification_engine().server_acked( network->get_sent_state_acked_timestamp() );
@@ -366,7 +366,7 @@ bool STMClient::process_user_input( int fd )
366366
} else {
367367
/* Escape key followed by anything other than . and ^ gets sent literally */
368368
net.get_current_state().push_back( Parser::UserByte( escape_key ) );
369-
net.get_current_state().push_back( Parser::UserByte( the_byte ) );
369+
net.get_current_state().push_back( Parser::UserByte( the_byte ) );
370370
}
371371

372372
quit_sequence_started = false;
@@ -391,7 +391,7 @@ bool STMClient::process_user_input( int fd )
391391
repaint_requested = true;
392392
}
393393

394-
net.get_current_state().push_back( Parser::UserByte( the_byte ) );
394+
net.get_current_state().push_back( Parser::UserByte( the_byte ) );
395395
}
396396

397397
return true;
@@ -404,16 +404,16 @@ bool STMClient::process_resize( void )
404404
perror( "ioctl TIOCGWINSZ" );
405405
return false;
406406
}
407-
407+
408408
/* tell remote emulator */
409409
Parser::Resize res( window_size.ws_col, window_size.ws_row );
410-
410+
411411
if ( !network->shutdown_in_progress() ) {
412412
network->get_current_state().push_back( res );
413413
}
414414

415415
/* note remote emulator will probably reply with its own Resize to adjust our state */
416-
416+
417417
/* tell prediction engine */
418418
overlays.get_prediction_engine().reset();
419419

@@ -480,7 +480,7 @@ bool STMClient::main( void )
480480
if ( network_ready_to_read ) {
481481
process_network_input();
482482
}
483-
483+
484484
if ( sel.read( STDIN_FILENO ) && !process_user_input( STDIN_FILENO ) ) { /* input from the user needs to be fed to the network */
485485
if ( !network->has_remote_addr() ) {
486486
break;
@@ -577,4 +577,3 @@ bool STMClient::main( void )
577577
}
578578
return clean_shutdown;
579579
}
580-

src/frontend/stmclient.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class STMClient {
122122
}
123123
if ( predict_overwrite && !strcmp( predict_overwrite, "yes" ) ) {
124124
overlays.get_prediction_engine().set_predict_overwrite( true );
125-
}
125+
}
126126
}
127127

128128
void init( void );

src/frontend/terminaloverlay.cc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ void NotificationEngine::apply( Framebuffer &fb ) const
272272
this_cell->get_renditions().set_attribute(Renditions::bold, true);
273273
this_cell->get_renditions().set_foreground_color( 7 );
274274
this_cell->get_renditions().set_background_color( 4 );
275-
275+
276276
this_cell->append( ch );
277277
this_cell->set_wide( chwidth == 2 );
278278
combining_cell = this_cell;
@@ -306,7 +306,7 @@ void NotificationEngine::adjust_message( void )
306306
{
307307
if ( timestamp() >= message_expiration ) {
308308
message.clear();
309-
}
309+
}
310310
}
311311

312312
int NotificationEngine::wait_time( void ) const
@@ -420,7 +420,7 @@ void PredictionEngine::init_cursor( const Framebuffer &fb )
420420
{
421421
if ( cursors.empty() ) {
422422
/* initialize new cursor prediction */
423-
423+
424424
cursors.push_back( ConditionalCursorMove( local_frame_sent + 1,
425425
fb.ds.get_cursor_row(),
426426
fb.ds.get_cursor_col(),
@@ -552,7 +552,7 @@ void PredictionEngine::cull( const Framebuffer &fb )
552552
}
553553

554554
/* When predictions come in quickly, slowly take away the glitch trigger. */
555-
if ( now - j->prediction_time < GLITCH_THRESHOLD
555+
if ( now - j->prediction_time < GLITCH_THRESHOLD
556556
&& ( glitch_trigger > 0 && now - GLITCH_REPAIR_MININTERVAL >= last_quick_confirmation ) ) {
557557
glitch_trigger--;
558558
last_quick_confirmation = now;
@@ -593,7 +593,7 @@ void PredictionEngine::cull( const Framebuffer &fb )
593593
}
594594

595595
/* go through cursor predictions */
596-
if ( !cursors.empty()
596+
if ( !cursors.empty()
597597
&& cursor().get_validity( fb,
598598
local_frame_acked, local_frame_late_acked ) == IncorrectOrExpired ) {
599599
/*
@@ -721,7 +721,7 @@ void PredictionEngine::new_user_byte( char the_byte, const Framebuffer &fb )
721721
cell.tentative_until_epoch = prediction_epoch;
722722
cell.expire( local_frame_sent + 1, now );
723723
cell.original_contents.push_back( *fb.get_cell( cursor().row, i ) );
724-
724+
725725
if ( i + 2 < fb.ds.get_width() ) {
726726
ConditionalOverlayCell &next_cell = the_row.overlay_cells[ i + 1 ];
727727
const Cell *next_cell_actual = fb.get_cell( cursor().row, i + 1 );
@@ -788,7 +788,7 @@ void PredictionEngine::new_user_byte( char the_byte, const Framebuffer &fb )
788788
cell.replacement = *prev_cell_actual;
789789
}
790790
}
791-
791+
792792
ConditionalOverlayCell &cell = the_row.overlay_cells[ cursor().col ];
793793
cell.reset_with_orig();
794794
cell.active = true;
@@ -834,7 +834,7 @@ void PredictionEngine::new_user_byte( char the_byte, const Framebuffer &fb )
834834
newline_carriage_return( fb );
835835
} else {
836836
// fprintf( stderr, "Execute 0x%x\n", act.ch );
837-
become_tentative();
837+
become_tentative();
838838
}
839839
} else if ( type_act == typeid( Parser::Esc_Dispatch ) ) {
840840
// fprintf( stderr, "Escape sequence\n" );
@@ -848,7 +848,7 @@ void PredictionEngine::new_user_byte( char the_byte, const Framebuffer &fb )
848848
}
849849
} else if ( act.char_present && (act.ch == L'D') ) { /* left arrow */
850850
init_cursor( fb );
851-
851+
852852
if ( cursor().col > 0 ) {
853853
cursor().col--;
854854
cursor().expire( local_frame_sent + 1, now );

src/include/Makefile.am

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ version.h: ../../VERSION
1111
mv -f $@.new $@; \
1212
fi
1313
@rm -f $@.new
14-

0 commit comments

Comments
 (0)