Mark local functions as static
This helps to catch unused functions like the former mosh_read_line, allows the compiler to make better inlining decisions, and reduces the binary size a bit. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
committed by
John Hood
parent
a52b095f50
commit
cd2ae36f36
@@ -63,9 +63,9 @@
|
||||
|
||||
const size_t buf_size = 1024;
|
||||
|
||||
void emulate_terminal( int fd );
|
||||
int copy( int src, int dest );
|
||||
int vt_parser( int fd, Parser::UTF8Parser *parser );
|
||||
static void emulate_terminal( int fd );
|
||||
static int copy( int src, int dest );
|
||||
static int vt_parser( int fd, Parser::UTF8Parser *parser );
|
||||
|
||||
int main( int argc __attribute__((unused)),
|
||||
char *argv[] __attribute__((unused)),
|
||||
@@ -135,7 +135,7 @@ int main( int argc __attribute__((unused)),
|
||||
return 0;
|
||||
}
|
||||
|
||||
void emulate_terminal( int fd )
|
||||
static void emulate_terminal( int fd )
|
||||
{
|
||||
Parser::UTF8Parser parser;
|
||||
|
||||
@@ -166,7 +166,7 @@ void emulate_terminal( int fd )
|
||||
}
|
||||
}
|
||||
|
||||
int copy( int src, int dest )
|
||||
static int copy( int src, int dest )
|
||||
{
|
||||
char buf[ buf_size ];
|
||||
|
||||
@@ -181,7 +181,7 @@ int copy( int src, int dest )
|
||||
return swrite( dest, buf, bytes_read );
|
||||
}
|
||||
|
||||
int vt_parser( int fd, Parser::UTF8Parser *parser )
|
||||
static int vt_parser( int fd, Parser::UTF8Parser *parser )
|
||||
{
|
||||
char buf[ buf_size ];
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
|
||||
const size_t buf_size = 16384;
|
||||
|
||||
void emulate_terminal( int fd );
|
||||
static void emulate_terminal( int fd );
|
||||
|
||||
int main( void )
|
||||
{
|
||||
@@ -158,8 +158,8 @@ int main( void )
|
||||
}
|
||||
|
||||
/* Print a frame if the last frame was more than 1/50 seconds ago */
|
||||
bool tick( Terminal::Framebuffer &state, Terminal::Framebuffer &new_frame,
|
||||
const Terminal::Display &display )
|
||||
static bool tick( Terminal::Framebuffer &state, Terminal::Framebuffer &new_frame,
|
||||
const Terminal::Display &display )
|
||||
{
|
||||
static bool initialized = false;
|
||||
static struct timeval last_time;
|
||||
@@ -207,7 +207,7 @@ bool tick( Terminal::Framebuffer &state, Terminal::Framebuffer &new_frame,
|
||||
assume the previous frame was sent to the real terminal.
|
||||
*/
|
||||
|
||||
void emulate_terminal( int fd )
|
||||
static void emulate_terminal( int fd )
|
||||
{
|
||||
/* get current window size */
|
||||
struct winsize window_size;
|
||||
|
||||
Reference in New Issue
Block a user