1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-03 04:22:47 -05:00

Introduce a typedef for frontend handles.

This is another major source of unexplained 'void *' parameters
throughout the code.

In particular, the currently unused testback.c actually gave the wrong
pointer type to its internal store of the frontend handle - it cast
the input void * to a Terminal *, from which it got implicitly cast
back again when calling from_backend, and nobody noticed. Now it uses
the right type internally as well as externally.
This commit is contained in:
Simon Tatham
2018-09-12 09:10:51 +01:00
parent eefebaaa9e
commit 8dfb2a1186
40 changed files with 357 additions and 406 deletions

6
raw.c
View File

@ -14,7 +14,7 @@ typedef struct raw_backend_data {
Socket s;
int closed_on_socket_error;
int bufsize;
void *frontend;
Frontend *frontend;
int sent_console_eof, sent_socket_eof, session_started;
Conf *conf;
@ -117,7 +117,7 @@ static const Plug_vtable Raw_plugvt = {
* Also places the canonical host name into `realhost'. It must be
* freed by the caller.
*/
static const char *raw_init(void *frontend_handle, Backend **backend_handle,
static const char *raw_init(Frontend *frontend, Backend **backend_handle,
Conf *conf,
const char *host, int port, char **realhost,
int nodelay, int keepalive)
@ -139,7 +139,7 @@ static const char *raw_init(void *frontend_handle, Backend **backend_handle,
raw->session_started = FALSE;
raw->conf = conf_copy(conf);
raw->frontend = frontend_handle;
raw->frontend = frontend;
addressfamily = conf_get_int(conf, CONF_addressfamily);
/*