1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-13 17:17:37 -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

@ -99,7 +99,7 @@ int main(int argc, char **argv)
fprintf(stderr, "GtkApplication frontend doesn't work pre-GTK3\n");
return 1;
}
GtkWidget *make_gtk_toplevel_window(void *frontend) { return NULL; }
GtkWidget *make_gtk_toplevel_window(Frontend *frontend) { return NULL; }
void launch_duplicate_session(Conf *conf) {}
void launch_new_session(void) {}
void launch_saved_session(const char *str) {}
@ -204,7 +204,7 @@ WIN_ACTION_LIST(WIN_ACTION_ENTRY)
};
static GtkApplication *app;
GtkWidget *make_gtk_toplevel_window(void *frontend)
GtkWidget *make_gtk_toplevel_window(Frontend *frontend)
{
GtkWidget *win = gtk_application_window_new(app);
g_action_map_add_action_entries(G_ACTION_MAP(win),