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

@ -243,8 +243,6 @@ struct fe_ctrl {
NSTableView *tableview;
NSScrollView *scrollview;
int nradiobuttons;
void *privdata;
int privdata_needs_free;
};
static int fe_ctrl_cmp_by_ctrl(void *av, void *bv)
@ -346,16 +344,12 @@ static struct fe_ctrl *fe_ctrl_new(union control *ctrl)
c->scrollview = nil;
c->radiobuttons = NULL;
c->nradiobuttons = 0;
c->privdata = NULL;
c->privdata_needs_free = FALSE;
return c;
}
static void fe_ctrl_free(struct fe_ctrl *c)
{
if (c->privdata_needs_free)
sfree(c->privdata);
sfree(c->radiobuttons);
sfree(c);
}
@ -1785,31 +1779,3 @@ void dlg_refresh(union control *ctrl, void *dv)
}
}
}
void *dlg_get_privdata(union control *ctrl, void *dv)
{
struct fe_dlg *d = (struct fe_dlg *)dv;
struct fe_ctrl *c = fe_ctrl_byctrl(d, ctrl);
return c->privdata;
}
void dlg_set_privdata(union control *ctrl, void *dv, void *ptr)
{
struct fe_dlg *d = (struct fe_dlg *)dv;
struct fe_ctrl *c = fe_ctrl_byctrl(d, ctrl);
c->privdata = ptr;
c->privdata_needs_free = FALSE;
}
void *dlg_alloc_privdata(union control *ctrl, void *dv, size_t size)
{
struct fe_dlg *d = (struct fe_dlg *)dv;
struct fe_ctrl *c = fe_ctrl_byctrl(d, ctrl);
/*
* This is an internal allocation routine, so it's allowed to
* use smalloc directly.
*/
c->privdata = smalloc(size);
c->privdata_needs_free = TRUE;
return c->privdata;
}