1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 19:42:48 -05:00

Completely remove the privdata mechanism in dialog.h.

The last use of it, to store the contents of the saved session name
edit box, was removed nearly two years ago in svn r9923 and replaced
by ctrl_alloc_with_free. The mechanism has been unused ever since
then, and I suspect any further uses of it would be a bad idea for the
same reasons, so let's get rid of it.
This commit is contained in:
Simon Tatham
2015-05-08 19:04:16 +01:00
parent f4956a1f9d
commit 42c592c4ef
4 changed files with 0 additions and 162 deletions

View File

@ -37,8 +37,6 @@ struct Shortcuts {
struct uctrl {
union control *ctrl;
GtkWidget *toplevel;
void *privdata;
int privdata_needs_free;
GtkWidget **buttons; int nbuttons; /* for radio buttons */
GtkWidget *entry; /* for editbox, filesel, fontsel */
GtkWidget *button; /* for filesel, fontsel */
@ -189,8 +187,6 @@ static void dlg_cleanup(struct dlgparam *dp)
dp->byctrl = NULL;
while ( (uc = index234(dp->bywidget, 0)) != NULL) {
del234(dp->bywidget, uc);
if (uc->privdata_needs_free)
sfree(uc->privdata);
sfree(uc->buttons);
sfree(uc);
}
@ -228,34 +224,6 @@ static struct uctrl *dlg_find_bywidget(struct dlgparam *dp, GtkWidget *w)
return ret;
}
void *dlg_get_privdata(union control *ctrl, void *dlg)
{
struct dlgparam *dp = (struct dlgparam *)dlg;
struct uctrl *uc = dlg_find_byctrl(dp, ctrl);
return uc->privdata;
}
void dlg_set_privdata(union control *ctrl, void *dlg, void *ptr)
{
struct dlgparam *dp = (struct dlgparam *)dlg;
struct uctrl *uc = dlg_find_byctrl(dp, ctrl);
uc->privdata = ptr;
uc->privdata_needs_free = FALSE;
}
void *dlg_alloc_privdata(union control *ctrl, void *dlg, size_t size)
{
struct dlgparam *dp = (struct dlgparam *)dlg;
struct uctrl *uc = dlg_find_byctrl(dp, ctrl);
/*
* This is an internal allocation routine, so it's allowed to
* use smalloc directly.
*/
uc->privdata = smalloc(size);
uc->privdata_needs_free = FALSE;
return uc->privdata;
}
union control *dlg_last_focused(union control *ctrl, void *dlg)
{
struct dlgparam *dp = (struct dlgparam *)dlg;
@ -1832,8 +1800,6 @@ GtkWidget *layout_ctrls(struct dlgparam *dp, struct Shortcuts *scs,
uc = snew(struct uctrl);
uc->ctrl = ctrl;
uc->privdata = NULL;
uc->privdata_needs_free = FALSE;
uc->buttons = NULL;
uc->entry = NULL;
#if !GTK_CHECK_VERSION(2,4,0)