This changes tui_win_info to use new and delete, rather than XNEW and
xfree.
gdb/ChangeLog
2019-06-25 Tom Tromey <tom@tromey.com>
* tui/tui-data.h (struct tui_win_info): Add constructor.
* tui/tui-data.c (tui_alloc_win_info): Use new.
(tui_free_window): Use delete.
+2019-06-25 Tom Tromey <tom@tromey.com>
+
+ * tui/tui-data.h (struct tui_win_info): Add constructor.
+ * tui/tui-data.c (tui_alloc_win_info): Use new.
+ (tui_free_window): Use delete.
+
2019-06-22 Tom Tromey <tom@tromey.com>
* tui/tui-windata.h (tui_first_data_element_no_in_line): Don't
struct tui_win_info *
tui_alloc_win_info (enum tui_win_type type)
{
- struct tui_win_info *win_info = XNEW (struct tui_win_info);
+ struct tui_win_info *win_info = new struct tui_win_info (type);
- win_info->generic.type = type;
init_win_info (win_info);
return win_info;
}
if (win_info->generic.title)
xfree (win_info->generic.title);
- xfree (win_info);
+ delete win_info;
}
/* This defines information about each logical window. */
struct tui_win_info
{
+ explicit tui_win_info (enum tui_win_type type)
+ {
+ generic.type = type;
+ }
+
+ DISABLE_COPY_AND_ASSIGN (tui_win_info);
+
struct tui_gen_win_info generic; /* General window information. */
union
{