From 5e881697e7f589d19a2dd1451b9bd38aada9108d Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com> Date: Thu, 25 May 2023 16:55:50 +0200 Subject: [PATCH] void function return statements are not generally useful Signed-off-by: Dimitri Papadopoulos <3350651-DimitriPapadopoulos@users.noreply.gitlab.com> --- src/acct/pam.c | 1 - src/acct/radius.c | 6 ------ src/auth-unix.c | 1 - src/auth/gssapi.c | 1 - src/auth/openidconnect.c | 2 -- src/auth/plain.c | 2 -- src/common/base64-helper.c | 1 - src/config-kkdcp.c | 2 -- src/config.c | 10 ---------- src/ip-lease.c | 2 -- src/log.c | 10 ---------- src/main-ctl-unix.c | 33 +++------------------------------ src/main.c | 2 -- src/occtl/cache.c | 2 -- src/occtl/geoip.c | 4 ---- src/occtl/ip-cache.c | 2 -- src/occtl/nl.c | 3 --- src/occtl/occtl.c | 8 -------- src/occtl/session-cache.c | 2 -- src/occtl/unix.c | 1 - src/route-add.c | 2 -- src/sec-mod-auth.c | 4 ---- src/sec-mod-resume.c | 2 -- src/sec-mod.c | 2 -- src/setproctitle.c | 1 - src/tlslib.c | 9 --------- src/tun.c | 3 --- src/worker-vpn.c | 10 ++-------- tests/cstp-recv.c | 3 --- tests/human_addr.c | 2 -- tests/port-parsing.c | 1 - 31 files changed, 5 insertions(+), 129 deletions(-) diff --git a/src/acct/pam.c b/src/acct/pam.c index 4d7e8d8f..9752c4c9 100644 --- a/src/acct/pam.c +++ b/src/acct/pam.c @@ -81,7 +81,6 @@ fail1: static void pam_acct_close_session(void *vctx, unsigned auth_method, const struct common_acct_info_st *ai, stats_st *stats, unsigned status) { - return; } const struct acct_mod_st pam_acct_funcs = { diff --git a/src/acct/radius.c b/src/acct/radius.c index e8912d53..470ab36d 100644 --- a/src/acct/radius.c +++ b/src/acct/radius.c @@ -105,8 +105,6 @@ static void append_stats(rc_handle *rh, VALUE_PAIR **send, stats_st *stats) uout = stats->bytes_out / 4294967296; rc_avpair_add(rh, send, PW_ACCT_OUTPUT_GIGAWORDS, &uout, -1, 0); - - return; } static void append_acct_standard(struct radius_vhost_ctx *vctx, rc_handle *rh, const common_acct_info_st *ai, VALUE_PAIR **send) @@ -163,8 +161,6 @@ static void append_acct_standard(struct radius_vhost_ctx *vctx, rc_handle *rh, c i = PW_RADIUS; rc_avpair_add(rh, send, PW_ACCT_AUTHENTIC, &i, -1, 0); - - return; } static void radius_acct_session_stats(void *_vctx, unsigned auth_method, const common_acct_info_st *ai, stats_st *stats) @@ -197,7 +193,6 @@ static void radius_acct_session_stats(void *_vctx, unsigned auth_method, const c cleanup: rc_avpair_free(send); - return; } static int radius_acct_open_session(void *_vctx, unsigned auth_method, const common_acct_info_st *ai, const void *sid, unsigned sid_size) @@ -287,7 +282,6 @@ static void radius_acct_close_session(void *_vctx, unsigned auth_method, const c cleanup: rc_avpair_free(send); - return; } const struct acct_mod_st radius_acct_funcs = { diff --git a/src/auth-unix.c b/src/auth-unix.c index 8ac2e8e7..80841e61 100644 --- a/src/auth-unix.c +++ b/src/auth-unix.c @@ -102,7 +102,6 @@ void unix_group_list(void *pool, unsigned gid_min, char ***groupname, unsigned * exit: endgrent(); - return; } #endif diff --git a/src/auth/gssapi.c b/src/auth/gssapi.c index 700cedfe..0ef00cc4 100644 --- a/src/auth/gssapi.c +++ b/src/auth/gssapi.c @@ -137,7 +137,6 @@ static void gssapi_vhost_init(void **_vctx, void *pool, void *additional) } *_vctx = vctx; - return; } static void gssapi_vhost_deinit(void *_vctx) diff --git a/src/auth/openidconnect.c b/src/auth/openidconnect.c index d01e5638..ab787d8c 100644 --- a/src/auth/openidconnect.c +++ b/src/auth/openidconnect.c @@ -112,8 +112,6 @@ static void oidc_vhost_init(void **vctx, void *pool, void *additional) } *vctx = (void *)vc; - - return; } static void oidc_vhost_deinit(void *ctx) diff --git a/src/auth/plain.c b/src/auth/plain.c index 8ca891e7..1c5de9c8 100644 --- a/src/auth/plain.c +++ b/src/auth/plain.c @@ -76,7 +76,6 @@ static void plain_vhost_init(void **vctx, void *pool, void *additional) #ifdef HAVE_LIBOATH oath_init(); #endif - return; } /* Breaks a list of "xxx", "yyy", to a character array, of @@ -483,7 +482,6 @@ static void plain_group_list(void *pool, void *additional, char ***groupname, un htable_clear(&hash); safe_memset(line, 0, sizeof(line)); fclose(fp); - return; } const struct auth_mod_st plain_auth_funcs = { diff --git a/src/common/base64-helper.c b/src/common/base64-helper.c index 6481bedc..5852da94 100644 --- a/src/common/base64-helper.c +++ b/src/common/base64-helper.c @@ -32,7 +32,6 @@ void oc_base64_encode (const char *restrict in, size_t inlen, } base64_encode_raw((void*)out, inlen, (uint8_t*)in); out[raw] = 0; - return; } int diff --git a/src/config-kkdcp.c b/src/config-kkdcp.c index 61a3dfb7..fcf084d8 100644 --- a/src/config-kkdcp.c +++ b/src/config-kkdcp.c @@ -102,8 +102,6 @@ void parse_kkdcp_string(char *str, int *socktype, char **_port, char **_server, *_realm = realm; *_path = path; *_server = server; - - return; } #endif diff --git a/src/config.c b/src/config.c index 3b3cea21..01ab6899 100644 --- a/src/config.c +++ b/src/config.c @@ -489,8 +489,6 @@ static void append_iroutes_from_file(struct cfg_st *config, const char *file) if (ip_route_sanity_check(config->known_iroutes, &config->known_iroutes[j]) != 0) exit(EXIT_FAILURE); } - - return; } static void load_iroutes(struct cfg_st *config) @@ -1688,8 +1686,6 @@ static void archive_cfg(struct list_head *head) list_add(&vhost->perm_config.attic, &e->list); } } - - return; } static void clear_cfg(struct list_head *head) @@ -1701,8 +1697,6 @@ static void clear_cfg(struct list_head *head) talloc_free(cpos->perm_config.config); cpos->perm_config.config = NULL; } - - return; } void clear_vhosts(struct list_head *head) @@ -1715,8 +1709,6 @@ void clear_vhosts(struct list_head *head) talloc_free(vhost->perm_config.config); vhost->perm_config.config = NULL; } - - return; } static void append(const char *option) @@ -1795,8 +1787,6 @@ void reload_cfg_file(void *pool, struct list_head *configs, unsigned sec_mod) /* parse the config again */ parse_cfg_file(pool, cfg_file, configs, flags); - - return; } void write_pid_file(void) diff --git a/src/ip-lease.c b/src/ip-lease.c index 7f6b13c0..b88476c4 100644 --- a/src/ip-lease.c +++ b/src/ip-lease.c @@ -62,8 +62,6 @@ struct htable_iter iter; cache = htable_next(&db->ht, &iter); } htable_clear(&db->ht); - - return; } static size_t rehash(const void* _e, void* unused) diff --git a/src/log.c b/src/log.c index 583ccdf9..4a75aeac 100644 --- a/src/log.c +++ b/src/log.c @@ -105,8 +105,6 @@ void __attribute__ ((format(printf, 3, 4))) name[0] = 0; syslog(priority, "worker%s: %s %s", name, ip?ip:"[unknown]", buf); - - return; } /* proc is optional */ @@ -151,8 +149,6 @@ void __attribute__ ((format(printf, 4, 5))) name[0] = 0; syslog(priority, "main%s:%s %s", name, ip?ip:"[unknown]", buf); - - return; } void mslog_hex(const main_server_st * s, const struct proc_st* proc, @@ -182,8 +178,6 @@ void mslog_hex(const main_server_st * s, const struct proc_st* proc, } _mslog(s, proc, priority, "%s %s", prefix, buf); - - return; } void oclog_hex(const worker_st* ws, int priority, @@ -213,8 +207,6 @@ void oclog_hex(const worker_st* ws, int priority, } _oclog(ws, priority, "%s %s", prefix, buf); - - return; } void seclog_hex(const struct sec_mod_st* sec, int priority, @@ -238,6 +230,4 @@ void seclog_hex(const struct sec_mod_st* sec, int priority, } seclog(sec, priority, "%s %s", prefix, buf); - - return; } diff --git a/src/main-ctl-unix.c b/src/main-ctl-unix.c index 25d5c26b..e951c40b 100644 --- a/src/main-ctl-unix.c +++ b/src/main-ctl-unix.c @@ -241,8 +241,6 @@ static void method_status(method_ctx *ctx, int cfd, uint8_t * msg, if (ret < 0) { mslog(ctx->s, NULL, LOG_ERR, "error sending ctl reply"); } - - return; } static void method_reload(method_ctx *ctx, int cfd, uint8_t * msg, @@ -263,8 +261,6 @@ static void method_reload(method_ctx *ctx, int cfd, uint8_t * msg, if (ret < 0) { mslog(ctx->s, NULL, LOG_ERR, "error sending ctl reply"); } - - return; } static void method_stop(method_ctx *ctx, int cfd, uint8_t * msg, @@ -285,8 +281,6 @@ static void method_stop(method_ctx *ctx, int cfd, uint8_t * msg, if (ret < 0) { mslog(ctx->s, NULL, LOG_ERR, "error sending ctl reply"); } - - return; } #define IPBUF_SIZE 64 @@ -479,7 +473,7 @@ static void method_list_users(method_ctx *ctx, int cfd, uint8_t * msg, if (ret < 0) { mslog(ctx->s, NULL, LOG_ERR, "error appending user info to reply"); - goto error; + return; } } @@ -489,9 +483,6 @@ static void method_list_users(method_ctx *ctx, int cfd, uint8_t * msg, if (ret < 0) { mslog(ctx->s, NULL, LOG_ERR, "error sending ctl reply"); } - - error: - return; } static void method_top(method_ctx *ctx, int cfd, uint8_t * msg, @@ -557,7 +548,7 @@ static void method_list_banned(method_ctx *ctx, int cfd, uint8_t * msg, if (ret < 0) { mslog(ctx->s, NULL, LOG_ERR, "error appending ban info to reply"); - goto error; + return; } e = htable_next(db, &iter); } @@ -568,9 +559,6 @@ static void method_list_banned(method_ctx *ctx, int cfd, uint8_t * msg, if (ret < 0) { mslog(ctx->s, NULL, LOG_ERR, "error sending ban list reply"); } - - error: - return; } static void method_list_cookies(method_ctx *ctx, int cfd, uint8_t * msg, @@ -655,7 +643,6 @@ reply_and_exit: if (cookies) { talloc_free(cookies); } - return; } static void single_info_common(method_ctx *ctx, int cfd, uint8_t * msg, @@ -686,7 +673,7 @@ static void single_info_common(method_ctx *ctx, int cfd, uint8_t * msg, if (ret < 0) { mslog(ctx->s, NULL, LOG_ERR, "error appending user info to reply"); - goto error; + return; } found_user = 1; @@ -709,9 +696,6 @@ static void single_info_common(method_ctx *ctx, int cfd, uint8_t * msg, if (ret < 0) { mslog(ctx->s, NULL, LOG_ERR, "error sending ctl reply"); } - - error: - return; } static void method_user_info(method_ctx *ctx, int cfd, uint8_t * msg, @@ -729,8 +713,6 @@ static void method_user_info(method_ctx *ctx, int cfd, uint8_t * msg, single_info_common(ctx, cfd, msg, msg_size, req->username, 0); username_req__free_unpacked(req, NULL); - - return; } static void method_id_info(method_ctx *ctx, int cfd, uint8_t * msg, @@ -748,8 +730,6 @@ static void method_id_info(method_ctx *ctx, int cfd, uint8_t * msg, single_info_common(ctx, cfd, msg, msg_size, NULL, req->id); id_req__free_unpacked(req, NULL); - - return; } static void method_unban_ip(method_ctx *ctx, @@ -781,8 +761,6 @@ static void method_unban_ip(method_ctx *ctx, if (ret < 0) { mslog(ctx->s, NULL, LOG_ERR, "error sending unban IP ctl reply"); } - - return; } static void method_disconnect_user_name(method_ctx *ctx, @@ -820,8 +798,6 @@ static void method_disconnect_user_name(method_ctx *ctx, if (ret < 0) { mslog(ctx->s, NULL, LOG_ERR, "error sending ctl reply"); } - - return; } static void method_disconnect_user_id(method_ctx *ctx, int cfd, @@ -861,8 +837,6 @@ static void method_disconnect_user_id(method_ctx *ctx, int cfd, if (ret < 0) { mslog(ctx->s, NULL, LOG_ERR, "error sending ctl reply"); } - - return; } struct ctl_watcher_st { @@ -919,7 +893,6 @@ static void ctl_cmd_wacher_cb(EV_P_ ev_io *w, int revents) close(wst->fd); ev_io_stop(EV_A_ w); talloc_free(wst); - return; } static void ctl_handle_commands(main_server_st * s) diff --git a/src/main.c b/src/main.c index a3fae080..b79aba7d 100644 --- a/src/main.c +++ b/src/main.c @@ -431,8 +431,6 @@ int y; set_mtu_disc(fd, family, 1); } set_cloexec_flag (fd, 1); - - return; } /* clears the server listen_list and proc_list. To be used after fork(). diff --git a/src/occtl/cache.c b/src/occtl/cache.c index 63099e43..d194a40f 100644 --- a/src/occtl/cache.c +++ b/src/occtl/cache.c @@ -62,8 +62,6 @@ void entries_add(void *pool, const char* user, unsigned user_size, unsigned id) snprintf(entries[entries_size].id, sizeof(entries[entries_size].id), "%u", id); entries_size++; - - return; } char* search_for_user(unsigned idx, const char* match, int match_size) diff --git a/src/occtl/geoip.c b/src/occtl/geoip.c index 1d843ce8..622902a5 100644 --- a/src/occtl/geoip.c +++ b/src/occtl/geoip.c @@ -113,8 +113,6 @@ void geo_ipv4_lookup(struct in_addr ip, char **country, char **city, char **coor pGeoIP_delete(gi); } } - - return; } void geo_ipv6_lookup(struct in6_addr *ip, char **country, char **city, char **coord) @@ -171,8 +169,6 @@ void geo_ipv6_lookup(struct in6_addr *ip, char **country, char **city, char **co pGeoIP_delete(gi); } } - - return; } char *geo_lookup(const char *ip, char *buf, unsigned buf_size) diff --git a/src/occtl/ip-cache.c b/src/occtl/ip-cache.c index caa8b8b0..e382c9d4 100644 --- a/src/occtl/ip-cache.c +++ b/src/occtl/ip-cache.c @@ -57,8 +57,6 @@ void ip_entries_add(void *pool, const char* ip, unsigned ip_size) strlcpy(ip_entries[ip_entries_size].ip, ip, sizeof(ip_entries[ip_entries_size].ip)); ip_entries[ip_entries_size].ip_size = ip_size; ip_entries_size++; - - return; } char* search_for_ip(unsigned idx, const char* match, int match_size) diff --git a/src/occtl/nl.c b/src/occtl/nl.c index 93075946..8b154e71 100644 --- a/src/occtl/nl.c +++ b/src/occtl/nl.c @@ -117,13 +117,10 @@ void print_iface_stats(const char *iface, time_t since, FILE * out, cmd_params_s fprintf(out, " \"Average RX\": \"%s\",\n \"Average TX\": \"%s\"%s\n", buf1, buf2, have_more?",":""); else fprintf(out, "\tAverage bandwidth RX: %s TX: %s\n", buf1, buf2); - - return; } #else void print_iface_stats(const char *iface, time_t since, FILE * out, cmd_params_st *params, unsigned have_more) { - return; } #endif diff --git a/src/occtl/occtl.c b/src/occtl/occtl.c index 8a9df2a7..7111c781 100644 --- a/src/occtl/occtl.c +++ b/src/occtl/occtl.c @@ -225,18 +225,14 @@ double data; if (bytes > 1000 && bytes < 1000 * 1000) { data = ((double) bytes) / 1000; snprintf(output, output_size, "%.1f KB%s", data, suffix); - return; } else if (bytes >= 1000 * 1000 && bytes < 1000 * 1000 * 1000) { data = ((double) bytes) / (1000 * 1000); snprintf(output, output_size, "%.1f MB%s", data, suffix); - return; } else if (bytes >= 1000 * 1000 * 1000) { data = ((double) bytes) / (1000 * 1000 * 1000); snprintf(output, output_size, "%.1f GB%s", data, suffix); - return; } else { snprintf(output, output_size, "%lu bytes%s", bytes, suffix); - return; } } @@ -245,13 +241,10 @@ time2human(uint64_t microseconds, char* output, unsigned output_size) { if (microseconds < 1000) { snprintf(output, output_size, "<1ms"); - return; } else if (microseconds < 1000000) { snprintf(output, output_size, "%ldms", microseconds / 1000); - return; } else { snprintf(output, output_size, "%lds", microseconds / 1000000); - return; } } @@ -520,7 +513,6 @@ void handle_sigint(int signo) rl_crlf(); #endif rl_redisplay(); - return; } void initialize_readline(void) diff --git a/src/occtl/session-cache.c b/src/occtl/session-cache.c index d74af6c7..7fc473e8 100644 --- a/src/occtl/session-cache.c +++ b/src/occtl/session-cache.c @@ -50,8 +50,6 @@ void session_entries_add(void *pool, const char* session) strlcpy(session_entries[session_entries_size].session, session, sizeof(session_entries[session_entries_size].session)); session_entries_size++; - - return; } char* search_for_session(unsigned idx, const char* match, int match_size) diff --git a/src/occtl/unix.c b/src/occtl/unix.c index f187d42e..5a3b8f7f 100644 --- a/src/occtl/unix.c +++ b/src/occtl/unix.c @@ -1426,7 +1426,6 @@ int handle_show_user_cmd(struct unix_ctx *ctx, const char *arg, cmd_params_st *p static void dummy_sighandler(int signo) { - return; } diff --git a/src/route-add.c b/src/route-add.c index 2f5fa925..929558a1 100644 --- a/src/route-add.c +++ b/src/route-add.c @@ -196,6 +196,4 @@ unsigned i; route_del(s, proc, proc->config->iroutes[i], proc->tun_lease.name); } proc->applied_iroutes = 0; - - return; } diff --git a/src/sec-mod-auth.c b/src/sec-mod-auth.c index dca342fc..2be1a37c 100644 --- a/src/sec-mod-auth.c +++ b/src/sec-mod-auth.c @@ -113,8 +113,6 @@ void sec_mod_add_score_to_ip(sec_mod_st *sec, client_entry_st *e, const char *ip fail: talloc_free(lpool); - - return; } static void update_auth_time_stats(sec_mod_st * sec, time_t secs) @@ -629,8 +627,6 @@ void handle_sec_auth_ban_ip_reply(sec_mod_st *sec, const BanIpReplyMsg *msg) if (msg->reply != AUTH__REP__OK) { e->status = PS_AUTH_FAILED; } - - return; } int handle_sec_auth_stats_cmd(sec_mod_st * sec, const CliStatsMsg * req, pid_t pid) diff --git a/src/sec-mod-resume.c b/src/sec-mod-resume.c index 68a55385..39ded40b 100644 --- a/src/sec-mod-resume.c +++ b/src/sec-mod-resume.c @@ -208,6 +208,4 @@ void expire_tls_sessions(sec_mod_st *sec) } cache = htable_next(sec->tls_db.ht, &iter); } - - return; } diff --git a/src/sec-mod.c b/src/sec-mod.c index 2236c9e0..f3dbb28b 100644 --- a/src/sec-mod.c +++ b/src/sec-mod.c @@ -609,8 +609,6 @@ static void send_stats_to_main(sec_mod_st *sec) seclog(sec, LOG_ERR, "error in sending statistics to main"); return; } - - return; } static void reload_server(sec_mod_st *sec) diff --git a/src/setproctitle.c b/src/setproctitle.c index dfffd17c..3f3591b0 100644 --- a/src/setproctitle.c +++ b/src/setproctitle.c @@ -60,7 +60,6 @@ void setproctitle (const char *fmt, ...) void setproctitle (const char *fmt, ...) { - return; } # endif /* __linux__ */ diff --git a/src/tlslib.c b/src/tlslib.c index 981282b0..b91d1cc1 100644 --- a/src/tlslib.c +++ b/src/tlslib.c @@ -433,8 +433,6 @@ void tls_cache_deinit(tls_sess_db_st* db) htable_clear(db->ht); db->entries = 0; talloc_free(db->ht); - - return; } #ifndef UNDER_TEST @@ -575,8 +573,6 @@ void tls_vhost_deinit(struct vhost_cfg_st *vhost) vhost->creds.xcred = NULL; vhost->creds.pskcred = NULL; vhost->creds.cprio = NULL; - - return; } #ifndef UNDER_TEST @@ -645,7 +641,6 @@ cleanup: gnutls_x509_crt_deinit(crt); gnutls_free(data.data); gnutls_free(dn.data); - return; } static void set_dh_params(main_server_st* s, struct vhost_cfg_st *vhost) @@ -1020,8 +1015,6 @@ void tls_load_files(main_server_st *s, struct vhost_cfg_st *vhost) } tls_reload_ocsp(s, vhost); - - return; } static int ocsp_get_func(gnutls_session_t session, void *ptr, gnutls_datum_t *response) @@ -1075,8 +1068,6 @@ void tls_load_prio(main_server_st *s, struct vhost_cfg_st *vhost) if (ret == GNUTLS_E_PARSING_ERROR) mslog(s, NULL, LOG_ERR, "error in TLS priority string: %s", perr); GNUTLS_FATAL_ERR(ret); - - return; } /* diff --git a/src/tun.c b/src/tun.c index d290becf..bcef3e7b 100644 --- a/src/tun.c +++ b/src/tun.c @@ -320,7 +320,6 @@ static int os_set_ipv6_addr(main_server_st * s, struct proc_st *proc) static void os_reset_ipv6_addr(struct proc_st *proc) { - return; } #endif @@ -785,8 +784,6 @@ void close_tun(main_server_st * s, struct proc_st *proc) if (fd != -1) close(fd); #endif - - return; } static void reset_ipv4_addr(struct proc_st *proc) diff --git a/src/worker-vpn.c b/src/worker-vpn.c index 9c07b8ed..fb4be017 100644 --- a/src/worker-vpn.c +++ b/src/worker-vpn.c @@ -490,8 +490,6 @@ void ws_add_score_to_ip(worker_st *ws, unsigned points, unsigned final, unsigned } ban_ip_reply_msg__free_unpacked(reply, &pa); - - return; } void send_stats_to_secmod(worker_st * ws, time_t now, unsigned discon_reason) @@ -1182,7 +1180,6 @@ void mtu_ok(worker_st * ws, struct dtls_st * dtls) c = (ws->link_mtu + ws->last_bad_mtu) / 2; link_mtu_set(ws, dtls, c); - return; } #define FUZZ(x, diff, rnd) \ @@ -1349,11 +1346,9 @@ static void set_no_delay(worker_st * ws, int fd) int ret; ret = setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &flag, sizeof(flag)); - if (ret == -1) { + if (ret == -1) oclog(ws, LOG_DEBUG, "setsockopt(TCP_NODELAY) to %x, failed.", (unsigned)flag); - return; - } } #define TOSCLASS(x) (IPTOS_CLASS_CS##x) @@ -1374,7 +1369,7 @@ static void set_net_priority(worker_st * ws, int fd, int priority) } #endif -#ifdef SO_PRIORITY +#if defined(SO_PRIORITY) if (priority != 0 && priority <= 7) { t = ws->user_config->net_priority - 1; ret = setsockopt(fd, SOL_SOCKET, SO_PRIORITY, &t, sizeof(t)); @@ -1385,7 +1380,6 @@ static void set_net_priority(worker_st * ws, int fd, int priority) return; } #endif - return; } #define SEND_ERR(x) if (x<0) goto send_error diff --git a/tests/cstp-recv.c b/tests/cstp-recv.c index f474e493..6441ac81 100644 --- a/tests/cstp-recv.c +++ b/tests/cstp-recv.c @@ -68,7 +68,6 @@ void writer(int fd) assert(write(fd, buf+j, 1) == 1); } } - return; } void receiver(int fd) @@ -87,8 +86,6 @@ void receiver(int fd) fprintf(stderr, "received %d\n", ret); assert(ret > 0); } - - return; } int main(int argc, char **argv) diff --git a/tests/human_addr.c b/tests/human_addr.c index 9a663179..cd6d191f 100644 --- a/tests/human_addr.c +++ b/tests/human_addr.c @@ -76,7 +76,6 @@ static void check(const char *ip) exit(1); } - return; } static void check_port(const char *ip, unsigned port) @@ -105,7 +104,6 @@ static void check_port(const char *ip, unsigned port) exit(1); } - return; } int main() diff --git a/tests/port-parsing.c b/tests/port-parsing.c index fd355198..a5b14214 100644 --- a/tests/port-parsing.c +++ b/tests/port-parsing.c @@ -35,7 +35,6 @@ void fw_port_st__init(FwPortSt *message) { - return; } void check_vals(FwPortSt **fw_ports, size_t n_fw_ports) {