Skip to content

Commit 1255408

Browse files
committed
Replace ( void ) with ()
`( void )` is a C-ism and not necessary in C++.
1 parent decd9b7 commit 1255408

41 files changed

Lines changed: 287 additions & 287 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/crypto/ae.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ typedef struct _ae_ctx ae_ctx;
5858
ae_ctx* ae_allocate( void* misc ); /* Allocate ae_ctx, set optional ptr */
5959
void ae_free( ae_ctx* ctx ); /* Deallocate ae_ctx struct */
6060
int ae_clear( ae_ctx* ctx ); /* Undo initialization */
61-
int ae_ctx_sizeof( void ); /* Return sizeof(ae_ctx) */
61+
int ae_ctx_sizeof(); /* Return sizeof(ae_ctx) */
6262
/* ae_allocate() allocates an ae_ctx structure, but does not initialize it.
6363
* ae_free() deallocates an ae_ctx structure, but does not zeroize it.
6464
* ae_clear() zeroes sensitive values associated with an ae_ctx structure

src/crypto/crypto.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ long int myatoi( const char* str )
6161
return ret;
6262
}
6363

64-
uint64_t Crypto::unique( void )
64+
uint64_t Crypto::unique()
6565
{
6666
static uint64_t counter = 0;
6767
uint64_t rv = counter++;
@@ -138,7 +138,7 @@ Base64Key::Base64Key( PRNG& prng )
138138
prng.fill( key, sizeof( key ) );
139139
}
140140

141-
std::string Base64Key::printable_key( void ) const
141+
std::string Base64Key::printable_key() const
142142
{
143143
char base64[24];
144144

@@ -174,7 +174,7 @@ Nonce::Nonce( uint64_t val )
174174
memcpy( bytes + 4, &val_net, 8 );
175175
}
176176

177-
uint64_t Nonce::val( void ) const
177+
uint64_t Nonce::val() const
178178
{
179179
uint64_t ret;
180180
memcpy( &ret, bytes + 4, 8 );
@@ -285,7 +285,7 @@ static rlim_t saved_core_rlimit;
285285

286286
/* Disable dumping core, as a precaution to avoid saving sensitive data
287287
to disk. */
288-
void Crypto::disable_dumping_core( void )
288+
void Crypto::disable_dumping_core()
289289
{
290290
struct rlimit limit;
291291
if ( 0 != getrlimit( RLIMIT_CORE, &limit ) ) {
@@ -303,7 +303,7 @@ void Crypto::disable_dumping_core( void )
303303
}
304304
}
305305

306-
void Crypto::reenable_dumping_core( void )
306+
void Crypto::reenable_dumping_core()
307307
{
308308
/* Silent failure is safe. */
309309
struct rlimit limit;

src/crypto/crypto.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class CryptoException : public std::exception
6161
* numbers that never repeats its output. Enforce that with this
6262
* function.
6363
*/
64-
uint64_t unique( void );
64+
uint64_t unique();
6565

6666
/* 16-byte-aligned buffer, with length. */
6767
class AlignedBuffer
@@ -76,8 +76,8 @@ class AlignedBuffer
7676

7777
~AlignedBuffer() { free( m_allocated ); }
7878

79-
char* data( void ) const { return m_data; }
80-
size_t len( void ) const { return m_len; }
79+
char* data() const { return m_data; }
80+
size_t len() const { return m_len; }
8181

8282
private:
8383
/* Not implemented */
@@ -94,8 +94,8 @@ class Base64Key
9494
Base64Key(); /* random key */
9595
Base64Key( PRNG& prng );
9696
Base64Key( std::string printable_key );
97-
std::string printable_key( void ) const;
98-
unsigned char* data( void ) { return key; }
97+
std::string printable_key() const;
98+
unsigned char* data() { return key; }
9999
};
100100

101101
class Nonce
@@ -110,9 +110,9 @@ class Nonce
110110
Nonce( uint64_t val );
111111
Nonce( const char* s_bytes, size_t len );
112112

113-
std::string cc_str( void ) const { return std::string( bytes + 4, 8 ); }
114-
const char* data( void ) const { return bytes; }
115-
uint64_t val( void ) const;
113+
std::string cc_str() const { return std::string( bytes + 4, 8 ); }
114+
const char* data() const { return bytes; }
115+
uint64_t val() const;
116116
};
117117

118118
class Message
@@ -156,8 +156,8 @@ class Session
156156
Session& operator=( const Session& );
157157
};
158158

159-
void disable_dumping_core( void );
160-
void reenable_dumping_core( void );
159+
void disable_dumping_core();
160+
void reenable_dumping_core();
161161
}
162162

163163
#endif

src/frontend/mosh-client.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static void print_usage( FILE* file, const char* argv0 )
9191
argv0 );
9292
}
9393

94-
static void print_colorcount( void )
94+
static void print_colorcount()
9595
{
9696
/* check colors */
9797
setupterm( (char*)0, 1, (int*)0 );

src/frontend/mosh-server.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ static void print_usage( FILE* stream, const char* argv0 )
130130
}
131131

132132
static bool print_motd( const char* filename );
133-
static void chdir_homedir( void );
134-
static bool motd_hushed( void );
133+
static void chdir_homedir();
134+
static bool motd_hushed();
135135
static void warn_unattached( const std::string& ignore_entry );
136136

137137
/* Simple spinloop */
138-
static void spin( void )
138+
static void spin()
139139
{
140140
static unsigned int spincount = 0;
141141
spincount++;
@@ -149,7 +149,7 @@ static void spin( void )
149149
}
150150
}
151151

152-
static std::string get_SSH_IP( void )
152+
static std::string get_SSH_IP()
153153
{
154154
const char* SSH_CONNECTION = getenv( "SSH_CONNECTION" );
155155
if ( !SSH_CONNECTION ) { /* Older sshds don't set this */
@@ -990,7 +990,7 @@ static bool print_motd( const char* filename )
990990
return true;
991991
}
992992

993-
static void chdir_homedir( void )
993+
static void chdir_homedir()
994994
{
995995
const char* home = getenv( "HOME" );
996996
if ( home == NULL ) {
@@ -1011,7 +1011,7 @@ static void chdir_homedir( void )
10111011
}
10121012
}
10131013

1014-
static bool motd_hushed( void )
1014+
static bool motd_hushed()
10151015
{
10161016
/* must be in home directory already */
10171017
struct stat buf;

src/frontend/stmclient.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464

6565
#include "src/network/networktransport-impl.h"
6666

67-
void STMClient::resume( void )
67+
void STMClient::resume()
6868
{
6969
/* Restore termios state */
7070
if ( tcsetattr( STDIN_FILENO, TCSANOW, &raw_termios ) < 0 ) {
@@ -79,7 +79,7 @@ void STMClient::resume( void )
7979
repaint_requested = true;
8080
}
8181

82-
void STMClient::init( void )
82+
void STMClient::init()
8383
{
8484
if ( !is_utf8_locale() ) {
8585
LocaleVar native_ctype = get_ctype();
@@ -201,7 +201,7 @@ void STMClient::init( void )
201201
connecting_notification = std::wstring( tmp );
202202
}
203203

204-
void STMClient::shutdown( void )
204+
void STMClient::shutdown()
205205
{
206206
/* Restore screen state */
207207
overlays.get_notification_engine().set_notification_string( std::wstring( L"" ) );
@@ -233,7 +233,7 @@ void STMClient::shutdown( void )
233233
}
234234
}
235235

236-
void STMClient::main_init( void )
236+
void STMClient::main_init()
237237
{
238238
Select& sel = Select::get_instance();
239239
sel.add_signal( SIGWINCH );
@@ -272,7 +272,7 @@ void STMClient::main_init( void )
272272
Select::set_verbose( verbose );
273273
}
274274

275-
void STMClient::output_new_frame( void )
275+
void STMClient::output_new_frame()
276276
{
277277
if ( !network ) { /* clean shutdown even when not initialized */
278278
return;
@@ -293,7 +293,7 @@ void STMClient::output_new_frame( void )
293293
local_framebuffer = new_state;
294294
}
295295

296-
void STMClient::process_network_input( void )
296+
void STMClient::process_network_input()
297297
{
298298
network->recv();
299299

@@ -407,7 +407,7 @@ bool STMClient::process_user_input( int fd )
407407
return true;
408408
}
409409

410-
bool STMClient::process_resize( void )
410+
bool STMClient::process_resize()
411411
{
412412
/* get new size */
413413
if ( ioctl( STDIN_FILENO, TIOCGWINSZ, &window_size ) < 0 ) {
@@ -430,7 +430,7 @@ bool STMClient::process_resize( void )
430430
return true;
431431
}
432432

433-
bool STMClient::main( void )
433+
bool STMClient::main()
434434
{
435435
/* initialize signal handling and structures */
436436
main_init();

src/frontend/stmclient.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,20 @@ class STMClient
7373
bool clean_shutdown;
7474
unsigned int verbose;
7575

76-
void main_init( void );
77-
void process_network_input( void );
76+
void main_init();
77+
void process_network_input();
7878
bool process_user_input( int fd );
79-
bool process_resize( void );
79+
bool process_resize();
8080

81-
void output_new_frame( void );
81+
void output_new_frame();
8282

83-
bool still_connecting( void ) const
83+
bool still_connecting() const
8484
{
8585
/* Initially, network == NULL */
8686
return network && ( network->get_remote_state_num() == 0 );
8787
}
8888

89-
void resume( void ); /* restore state after SIGCONT */
89+
void resume(); /* restore state after SIGCONT */
9090

9191
public:
9292
STMClient( const char* s_ip,
@@ -121,9 +121,9 @@ class STMClient
121121
}
122122
}
123123

124-
void init( void );
125-
void shutdown( void );
126-
bool main( void );
124+
void init();
125+
void shutdown();
126+
bool main();
127127

128128
/* unused */
129129
STMClient( const STMClient& );

src/frontend/terminaloverlay.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,14 +298,14 @@ void NotificationEngine::apply( Framebuffer& fb ) const
298298
}
299299
}
300300

301-
void NotificationEngine::adjust_message( void )
301+
void NotificationEngine::adjust_message()
302302
{
303303
if ( timestamp() >= message_expiration ) {
304304
message.clear();
305305
}
306306
}
307307

308-
int NotificationEngine::wait_time( void ) const
308+
int NotificationEngine::wait_time() const
309309
{
310310
uint64_t next_expiry = INT_MAX;
311311

@@ -390,7 +390,7 @@ void PredictionEngine::kill_epoch( uint64_t epoch, const Framebuffer& fb )
390390
become_tentative();
391391
}
392392

393-
void PredictionEngine::reset( void )
393+
void PredictionEngine::reset()
394394
{
395395
cursors.clear();
396396
overlays.clear();
@@ -862,7 +862,7 @@ void PredictionEngine::newline_carriage_return( const Framebuffer& fb )
862862
}
863863
}
864864

865-
void PredictionEngine::become_tentative( void )
865+
void PredictionEngine::become_tentative()
866866
{
867867
if ( display_preference != Experimental ) {
868868
prediction_epoch++;
@@ -874,7 +874,7 @@ void PredictionEngine::become_tentative( void )
874874
*/
875875
}
876876

877-
bool PredictionEngine::active( void ) const
877+
bool PredictionEngine::active() const
878878
{
879879
if ( !cursors.empty() ) {
880880
return true;

0 commit comments

Comments
 (0)