From: Tom Tromey Date: Fri, 16 Jan 2026 16:19:09 +0000 (-0700) Subject: Use std::make_unique with ui_files X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c1f794e28e8b92f3dbf00d3630f2e234e30665e;p=thirdparty%2Fbinutils-gdb.git Use std::make_unique with ui_files This changes a couple of spots to use std::make_unique rather than 'new'. This is a bit more idiomatic. I've only touched code involving ui_file here, there are plenty more changes like this that could be made, but I considered those unrelated to this series. Approved-By: Andrew Burgess --- diff --git a/gdb/cli/cli-logging.c b/gdb/cli/cli-logging.c index 8d22a62fa02..836c24445bc 100644 --- a/gdb/cli/cli-logging.c +++ b/gdb/cli/cli-logging.c @@ -232,7 +232,7 @@ handle_redirections (int from_tty) return; } - stdio_file_up log (new no_terminal_escape_file ()); + stdio_file_up log = std::make_unique (); if (!log->open (logging_filename.c_str (), logging_overwrite ? "w" : "a")) perror_with_name (_("set logging")); diff --git a/gdb/serial.c b/gdb/serial.c index c27e3792715..f034c1c94eb 100644 --- a/gdb/serial.c +++ b/gdb/serial.c @@ -238,7 +238,7 @@ serial_open_ops_1 (const struct serial_ops *ops, const char *open_name) if (!serial_logfile.empty ()) { - stdio_file_up file (new stdio_file ()); + stdio_file_up file = std::make_unique (); if (!file->open (serial_logfile.c_str (), "w")) perror_with_name (serial_logfile.c_str ());