1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-05 21:42: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
ssh.c
View File

@ -729,7 +729,7 @@ struct ssh_tag {
int echoing, editing;
int session_started;
void *frontend;
Frontend *frontend;
int ospeed, ispeed; /* temporaries */
int term_width, term_height;
@ -10665,7 +10665,7 @@ static void ssh_cache_conf_values(Ssh ssh)
*
* Returns an error message, or NULL on success.
*/
static const char *ssh_init(void *frontend_handle, Backend **backend_handle,
static const char *ssh_init(Frontend *frontend, Backend **backend_handle,
Conf *conf,
const char *host, int port, char **realhost,
int nodelay, int keepalive)
@ -10781,7 +10781,7 @@ static const char *ssh_init(void *frontend_handle, Backend **backend_handle,
ssh->backend.vt = &ssh_backend;
*backend_handle = &ssh->backend;
ssh->frontend = frontend_handle;
ssh->frontend = frontend;
ssh->term_width = conf_get_int(ssh->conf, CONF_width);
ssh->term_height = conf_get_int(ssh->conf, CONF_height);