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

View File

@ -63,15 +63,15 @@ void cleanup_exit(int code)
exit(code);
}
void set_busy_status(void *frontend, int status)
void set_busy_status(Frontend *frontend, int status)
{
}
void update_specials_menu(void *frontend)
void update_specials_menu(Frontend *frontend)
{
}
void notify_remote_exit(void *frontend)
void notify_remote_exit(Frontend *frontend)
{
}
@ -113,7 +113,7 @@ static int block_and_read(int fd, void *buf, size_t len)
return ret;
}
int verify_ssh_host_key(void *frontend, char *host, int port,
int verify_ssh_host_key(Frontend *frontend, char *host, int port,
const char *keytype, char *keystr, char *fingerprint,
void (*callback)(void *ctx, int result), void *ctx)
{
@ -223,7 +223,7 @@ int verify_ssh_host_key(void *frontend, char *host, int port,
* Ask whether the selected algorithm is acceptable (since it was
* below the configured 'warn' threshold).
*/
int askalg(void *frontend, const char *algtype, const char *algname,
int askalg(Frontend *frontend, const char *algtype, const char *algname,
void (*callback)(void *ctx, int result), void *ctx)
{
static const char msg[] =
@ -270,7 +270,7 @@ int askalg(void *frontend, const char *algtype, const char *algname,
}
}
int askhk(void *frontend, const char *algname, const char *betteralgs,
int askhk(Frontend *frontend, const char *algname, const char *betteralgs,
void (*callback)(void *ctx, int result), void *ctx)
{
static const char msg[] =
@ -327,7 +327,7 @@ int askhk(void *frontend, const char *algname, const char *betteralgs,
* Ask whether to wipe a session log file before writing to it.
* Returns 2 for wipe, 1 for append, 0 for cancel (don't log).
*/
int askappend(void *frontend, Filename *filename,
int askappend(Frontend *frontend, Filename *filename,
void (*callback)(void *ctx, int result), void *ctx)
{
static const char msgtemplate[] =
@ -410,7 +410,7 @@ void console_provide_logctx(LogContext *logctx)
console_logctx = logctx;
}
void logevent(void *frontend, const char *string)
void logevent(Frontend *frontend, const char *string)
{
struct termios cf;
if ((flags & FLAG_STDERR) && (flags & FLAG_VERBOSE))
@ -546,7 +546,7 @@ int console_get_userpass_input(prompts_t *p)
return 1; /* success */
}
void frontend_keypress(void *handle)
void frontend_keypress(Frontend *frontend)
{
/*
* This is nothing but a stub, in console code.