mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -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:
18
pageant.c
18
pageant.c
@ -699,7 +699,7 @@ int pageant_delete_ssh2_key(struct ssh2_userkey *skey)
|
||||
} while (0)
|
||||
|
||||
struct pageant_conn_state {
|
||||
Socket connsock;
|
||||
Socket *connsock;
|
||||
void *logctx;
|
||||
pageant_logfn_t logfn;
|
||||
unsigned char lenbuf[4], pktbuf[AGENT_MAX_MSGLEN];
|
||||
@ -710,7 +710,7 @@ struct pageant_conn_state {
|
||||
const Plug_vtable *plugvt;
|
||||
};
|
||||
|
||||
static void pageant_conn_closing(Plug plug, const char *error_msg,
|
||||
static void pageant_conn_closing(Plug *plug, const char *error_msg,
|
||||
int error_code, int calling_back)
|
||||
{
|
||||
struct pageant_conn_state *pc = FROMFIELD(
|
||||
@ -723,7 +723,7 @@ static void pageant_conn_closing(Plug plug, const char *error_msg,
|
||||
sfree(pc);
|
||||
}
|
||||
|
||||
static void pageant_conn_sent(Plug plug, int bufsize)
|
||||
static void pageant_conn_sent(Plug *plug, int bufsize)
|
||||
{
|
||||
/* struct pageant_conn_state *pc = FROMFIELD(
|
||||
plug, struct pageant_conn_state, plugvt); */
|
||||
@ -745,7 +745,7 @@ static void pageant_conn_log(void *logctx, const char *fmt, va_list ap)
|
||||
sfree(formatted);
|
||||
}
|
||||
|
||||
static void pageant_conn_receive(Plug plug, int urgent, char *data, int len)
|
||||
static void pageant_conn_receive(Plug *plug, int urgent, char *data, int len)
|
||||
{
|
||||
struct pageant_conn_state *pc = FROMFIELD(
|
||||
plug, struct pageant_conn_state, plugvt);
|
||||
@ -797,14 +797,14 @@ static void pageant_conn_receive(Plug plug, int urgent, char *data, int len)
|
||||
}
|
||||
|
||||
struct pageant_listen_state {
|
||||
Socket listensock;
|
||||
Socket *listensock;
|
||||
void *logctx;
|
||||
pageant_logfn_t logfn;
|
||||
|
||||
const Plug_vtable *plugvt;
|
||||
};
|
||||
|
||||
static void pageant_listen_closing(Plug plug, const char *error_msg,
|
||||
static void pageant_listen_closing(Plug *plug, const char *error_msg,
|
||||
int error_code, int calling_back)
|
||||
{
|
||||
struct pageant_listen_state *pl = FROMFIELD(
|
||||
@ -823,7 +823,7 @@ static const Plug_vtable pageant_connection_plugvt = {
|
||||
NULL /* no accepting function, because we've already done it */
|
||||
};
|
||||
|
||||
static int pageant_listen_accepting(Plug plug,
|
||||
static int pageant_listen_accepting(Plug *plug,
|
||||
accept_fn_t constructor, accept_ctx_t ctx)
|
||||
{
|
||||
struct pageant_listen_state *pl = FROMFIELD(
|
||||
@ -866,7 +866,7 @@ static const Plug_vtable pageant_listener_plugvt = {
|
||||
pageant_listen_accepting
|
||||
};
|
||||
|
||||
struct pageant_listen_state *pageant_listener_new(Plug *plug)
|
||||
struct pageant_listen_state *pageant_listener_new(Plug **plug)
|
||||
{
|
||||
struct pageant_listen_state *pl = snew(struct pageant_listen_state);
|
||||
pl->plugvt = &pageant_listener_plugvt;
|
||||
@ -877,7 +877,7 @@ struct pageant_listen_state *pageant_listener_new(Plug *plug)
|
||||
return pl;
|
||||
}
|
||||
|
||||
void pageant_listener_got_socket(struct pageant_listen_state *pl, Socket sock)
|
||||
void pageant_listener_got_socket(struct pageant_listen_state *pl, Socket *sock)
|
||||
{
|
||||
pl->listensock = sock;
|
||||
}
|
||||
|
Reference in New Issue
Block a user