mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-12 08:43:53 -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:
6
telnet.c
6
telnet.c
@ -172,7 +172,7 @@ typedef struct telnet_tag {
|
||||
Socket s;
|
||||
int closed_on_socket_error;
|
||||
|
||||
void *frontend;
|
||||
Frontend *frontend;
|
||||
Ldisc *ldisc;
|
||||
int term_width, term_height;
|
||||
|
||||
@ -705,7 +705,7 @@ static const Plug_vtable Telnet_plugvt = {
|
||||
* Also places the canonical host name into `realhost'. It must be
|
||||
* freed by the caller.
|
||||
*/
|
||||
static const char *telnet_init(void *frontend_handle, Backend **backend_handle,
|
||||
static const char *telnet_init(Frontend *frontend, Backend **backend_handle,
|
||||
Conf *conf, const char *host, int port,
|
||||
char **realhost, int nodelay, int keepalive)
|
||||
{
|
||||
@ -726,7 +726,7 @@ static const char *telnet_init(void *frontend_handle, Backend **backend_handle,
|
||||
telnet->activated = FALSE;
|
||||
telnet->sb_buf = NULL;
|
||||
telnet->sb_size = 0;
|
||||
telnet->frontend = frontend_handle;
|
||||
telnet->frontend = frontend;
|
||||
telnet->term_width = conf_get_int(telnet->conf, CONF_width);
|
||||
telnet->term_height = conf_get_int(telnet->conf, CONF_height);
|
||||
telnet->state = TOP_LEVEL;
|
||||
|
Reference in New Issue
Block a user