Correct function definitions without parameters

This commit is contained in:
Marc André Tanner 2014-10-10 20:43:06 +02:00
parent 94051967ff
commit 35117affb9
3 changed files with 9 additions and 9 deletions

View File

@ -209,12 +209,12 @@ static void die(const char *s) {
exit(EXIT_FAILURE);
}
static void usage() {
static void usage(void) {
fprintf(stderr, "usage: abduco [-a|-A|-c|-n] [-r] [-e detachkey] name command\n");
exit(EXIT_FAILURE);
}
static int create_socket_dir() {
static int create_socket_dir(void) {
size_t maxlen = sizeof(sockaddr.sun_path);
char *dirs[] = { getenv("HOME"), getenv("TMPDIR"), "/tmp" };
int socketfd = socket(AF_UNIX, SOCK_STREAM, 0);
@ -440,7 +440,7 @@ static int session_comparator(const struct dirent **a, const struct dirent **b)
return sa.st_atime < sb.st_atime ? -1 : 1;
}
static int list_session() {
static int list_session(void) {
if (create_socket_dir() == -1)
return 1;
chdir(sockaddr.sun_path);

View File

@ -21,18 +21,18 @@ static bool client_recv_packet(Packet *pkt) {
return false;
}
static void client_show_cursor() {
static void client_show_cursor(void) {
printf("\033[?25h");
fflush(stdout);
}
static void client_restore_terminal() {
static void client_restore_terminal(void) {
if (has_term)
tcsetattr(STDIN_FILENO, TCSADRAIN, &orig_term);
client_show_cursor();
}
static int client_mainloop() {
static int client_mainloop(void) {
client.need_resize = true;
Packet pkt = {
.type = MSG_ATTACH,

View File

@ -57,7 +57,7 @@ static int server_set_socket_non_blocking(int sock) {
return fcntl(sock, F_SETFL, flags | O_NONBLOCK);
}
static Client *server_accept_client() {
static Client *server_accept_client(void) {
int newfd = accept(server.socket, NULL, NULL);
if (newfd == -1)
return NULL;
@ -143,11 +143,11 @@ static void server_sigusr1_handler(int sig) {
}
}
static void server_atexit_handler() {
static void server_atexit_handler(void) {
unlink(sockaddr.sun_path);
}
static void server_mainloop() {
static void server_mainloop(void) {
atexit(server_atexit_handler);
fd_set new_readfds, new_writefds;
FD_ZERO(&new_readfds);