Remove spurious 'return' in void method wrappers.

For some reason, only Visual Studio bothers to give a warning when you
write "return g()" inside a function f() when both f and g have void
return type.

(Of course it would be cleaner and more orthogonal if that was simply
legal C in the first place - but given that it's not, it would be nice
if more compilers let me know about it so I could fix it...)
This commit is contained in:
Simon Tatham 2019-04-06 10:12:31 +01:00
Родитель 77bdaa2436
Коммит 1bcf2a8397
3 изменённых файлов: 10 добавлений и 10 удалений

Просмотреть файл

@ -163,14 +163,14 @@ static inline void sk_flush(Socket *s)
static inline void plug_log(
Plug *p, int type, SockAddr *addr, int port, const char *msg, int code)
{ return p->vt->log(p, type, addr, port, msg, code); }
{ p->vt->log(p, type, addr, port, msg, code); }
static inline void plug_closing(
Plug *p, const char *msg, int code, bool calling_back)
{ return p->vt->closing(p, msg, code, calling_back); }
{ p->vt->closing(p, msg, code, calling_back); }
static inline void plug_receive(Plug *p, int urg, const char *data, size_t len)
{ return p->vt->receive(p, urg, data, len); }
{ p->vt->receive(p, urg, data, len); }
static inline void plug_sent (Plug *p, size_t bufsize)
{ return p->vt->sent(p, bufsize); }
{ p->vt->sent(p, bufsize); }
static inline int plug_accepting(Plug *p, accept_fn_t cons, accept_ctx_t ctx)
{ return p->vt->accepting(p, cons, ctx); }

8
ssh.h
Просмотреть файл

@ -647,10 +647,10 @@ static inline void ssh_cipher_decrypt(ssh_cipher *c, void *blk, int len)
{ c->vt->decrypt(c, blk, len); }
static inline void ssh_cipher_encrypt_length(
ssh_cipher *c, void *blk, int len, unsigned long seq)
{ return c->vt->encrypt_length(c, blk, len, seq); }
{ c->vt->encrypt_length(c, blk, len, seq); }
static inline void ssh_cipher_decrypt_length(
ssh_cipher *c, void *blk, int len, unsigned long seq)
{ return c->vt->decrypt_length(c, blk, len, seq); }
{ c->vt->decrypt_length(c, blk, len, seq); }
static inline const struct ssh_cipheralg *ssh_cipher_alg(ssh_cipher *c)
{ return c->vt; }
@ -728,9 +728,9 @@ static inline ssh_hash *ssh_hash_new(const ssh_hashalg *alg)
static inline ssh_hash *ssh_hash_copy(ssh_hash *h)
{ return h->vt->copy(h); }
static inline void ssh_hash_final(ssh_hash *h, unsigned char *out)
{ return h->vt->final(h, out); }
{ h->vt->final(h, out); }
static inline void ssh_hash_free(ssh_hash *h)
{ return h->vt->free(h); }
{ h->vt->free(h); }
static inline const ssh_hashalg *ssh_hash_alg(ssh_hash *h)
{ return h->vt; }

Просмотреть файл

@ -250,8 +250,8 @@ static inline void sshfwd_x11_sharing_handover(
SshChannel *c, ssh_sharing_connstate *cs, share_channel *sch,
const char *addr, int port, int endian, int maj, int min,
const void *idata, int ilen)
{ return c->vt->x11_sharing_handover(c, cs, sch, addr, port, endian,
maj, min, idata, ilen); }
{ c->vt->x11_sharing_handover(c, cs, sch, addr, port, endian,
maj, min, idata, ilen); }
static inline void sshfwd_send_exit_status(SshChannel *c, int status)
{ c->vt->send_exit_status(c, status); }
static inline void sshfwd_send_exit_signal(