Skip to content

Commit

Permalink
Refactor: some more cleanups (unused or shall-be-static functions)
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Pokorný <[email protected]>
  • Loading branch information
jnpkrn committed Jan 30, 2020
1 parent 2246488 commit 47034dc
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/request.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ void *add_req(
return rp;
}

/* XXX UNUSED */
int get_req_id(const void *rp)
{
if (!rp)
Expand Down
2 changes: 2 additions & 0 deletions src/request.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ void *add_req(struct ticket_config *tk, struct client *req_client,
*/
void foreach_tkt_req(struct booth_config *conf_ptr, struct ticket_config *tk,
req_fp f);

/* XXX UNUSED */
int get_req_id(const void *rp);

#endif /* _REQUEST_H */
3 changes: 2 additions & 1 deletion src/ticket.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ void disown_ticket(struct ticket_config *tk)
get_time(&tk->term_expires);
}

/* XXX UNUSED */
int disown_if_expired(struct ticket_config *tk)
{
if (is_past(&tk->term_expires) ||
Expand Down Expand Up @@ -985,7 +986,7 @@ static void handle_resends(struct booth_config *conf_ptr,
resend_msg(conf_ptr, tk);
}

int postpone_ticket_processing(struct ticket_config *tk)
static int postpone_ticket_processing(struct ticket_config *tk)
{
extern timetype start_time;

Expand Down
6 changes: 2 additions & 4 deletions src/ticket.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ extern int TIME_RES;

void save_committed_tkt(struct ticket_config *tk);
void disown_ticket(struct ticket_config *tk);

/* XXX UNUSED */
int disown_if_expired(struct ticket_config *tk);

/**
Expand Down Expand Up @@ -125,9 +127,6 @@ int check_ticket(struct booth_config *conf_ptr, const char *ticket,
int check_site(struct booth_config *conf_ptr, const char *site,
int *local);

int grant_ticket(struct ticket_config *ticket);
int revoke_ticket(struct ticket_config *ticket);

/**
* @internal
* Second stage of incoming datagram handling (after authentication)
Expand Down Expand Up @@ -181,7 +180,6 @@ int find_ticket_by_name(struct booth_config *conf_ptr,
const char *ticket, struct ticket_config **found);

void set_ticket_wakeup(struct ticket_config *tk);
int postpone_ticket_processing(struct ticket_config *tk);

/**
* @internal
Expand Down
4 changes: 1 addition & 3 deletions src/transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,8 @@ static int do_write(int fd, void *buf, size_t count)
return 0;
}


/* Only used for client requests (tcp) */
int read_client(struct client *req_cl)
static int read_client(struct client *req_cl)
{
char *msg;
struct boothc_header *header;
Expand Down Expand Up @@ -424,7 +423,6 @@ int read_client(struct client *req_cl)
return 0;
}


/* Only used for client requests (tcp) */
static void process_connection(struct booth_config *conf_ptr, int ci)
{
Expand Down
1 change: 0 additions & 1 deletion src/transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ typedef struct booth_transport booth_transport_table_t[TRANSPORT_ENTRIES];
int find_myself(struct booth_config *conf_ptr, struct booth_site **mep,
int fuzzy_allowed);

int read_client(struct client *req_cl);
int check_boothc_header(struct boothc_header *data, int len_incl_data);

int setup_tcp_listener(int test_only);
Expand Down

0 comments on commit 47034dc

Please sign in to comment.