1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-02 03:52:49 -05:00

Get rid of lots of implicit pointer types.

All the main backend structures - Ssh, Telnet, Pty, Serial etc - now
describe structure types themselves rather than pointers to them. The
same goes for the codebase-wide trait types Socket and Plug, and the
supporting types SockAddr and Pinger.

All those things that were typedefed as pointers are older types; the
newer ones have the explicit * at the point of use, because that's
what I now seem to be preferring. But whichever one of those is
better, inconsistently using a mixture of the two styles is worse, so
let's make everything consistent.

A few types are still implicitly pointers, such as Bignum and some of
the GSSAPI types; generally this is either because they have to be
void *, or because they're typedefed differently on different
platforms and aren't always pointers at all. Can't be helped. But I've
got rid of the main ones, at least.
This commit is contained in:
Simon Tatham
2018-10-04 19:10:23 +01:00
parent bf61af1919
commit 96ec2c2500
42 changed files with 595 additions and 596 deletions

View File

@ -5,18 +5,18 @@
#include "putty.h"
struct pinger_tag {
struct Pinger {
int interval;
int pending;
unsigned long when_set, next;
Backend *backend;
};
static void pinger_schedule(Pinger pinger);
static void pinger_schedule(Pinger *pinger);
static void pinger_timer(void *ctx, unsigned long now)
{
Pinger pinger = (Pinger)ctx;
Pinger *pinger = (Pinger *)ctx;
if (pinger->pending && now == pinger->next) {
backend_special(pinger->backend, SS_PING, 0);
@ -25,7 +25,7 @@ static void pinger_timer(void *ctx, unsigned long now)
}
}
static void pinger_schedule(Pinger pinger)
static void pinger_schedule(Pinger *pinger)
{
unsigned long next;
@ -44,9 +44,9 @@ static void pinger_schedule(Pinger pinger)
}
}
Pinger pinger_new(Conf *conf, Backend *backend)
Pinger *pinger_new(Conf *conf, Backend *backend)
{
Pinger pinger = snew(struct pinger_tag);
Pinger *pinger = snew(Pinger);
pinger->interval = conf_get_int(conf, CONF_ping_interval);
pinger->pending = FALSE;
@ -56,7 +56,7 @@ Pinger pinger_new(Conf *conf, Backend *backend)
return pinger;
}
void pinger_reconfig(Pinger pinger, Conf *oldconf, Conf *newconf)
void pinger_reconfig(Pinger *pinger, Conf *oldconf, Conf *newconf)
{
int newinterval = conf_get_int(newconf, CONF_ping_interval);
if (conf_get_int(oldconf, CONF_ping_interval) != newinterval) {
@ -65,7 +65,7 @@ void pinger_reconfig(Pinger pinger, Conf *oldconf, Conf *newconf)
}
}
void pinger_free(Pinger pinger)
void pinger_free(Pinger *pinger)
{
expire_timer_context(pinger);
sfree(pinger);