+2016-11-09 Pedro Alves <palves@redhat.com>
+
+ * main.c (struct cmdarg): Add constructor.
+ (captured_main_1): Use vector::emplace_back.
+ * tracepoint.c (collection_list::add_memrange): Likewise.
+
2016-11-09 Andreas Arnez <arnez@linux.vnet.ibm.com>
* tui/tui-winsource.c (tui_alloc_source_buffer): Remove
};
/* Arguments of --command option and its counterpart. */
-struct cmdarg {
+struct cmdarg
+{
+ cmdarg (cmdarg_kind type_, char *string_)
+ : type (type_), string (string_)
+ {}
+
/* Type of this option. */
enum cmdarg_kind type;
pidarg = optarg;
break;
case 'x':
- {
- struct cmdarg cmdarg = { CMDARG_FILE, optarg };
-
- cmdarg_vec.push_back (cmdarg);
- }
+ cmdarg_vec.emplace_back (CMDARG_FILE, optarg);
break;
case 'X':
- {
- struct cmdarg cmdarg = { CMDARG_COMMAND, optarg };
-
- cmdarg_vec.push_back (cmdarg);
- }
+ cmdarg_vec.emplace_back (CMDARG_COMMAND, optarg);
break;
case OPT_IX:
- {
- struct cmdarg cmdarg = { CMDARG_INIT_FILE, optarg };
-
- cmdarg_vec.push_back (cmdarg);
- }
+ cmdarg_vec.emplace_back (CMDARG_INIT_FILE, optarg);
break;
case OPT_IEX:
- {
- struct cmdarg cmdarg = { CMDARG_INIT_COMMAND, optarg };
-
- cmdarg_vec.push_back (cmdarg);
- }
+ cmdarg_vec.emplace_back (CMDARG_INIT_COMMAND, optarg);
break;
case 'B':
batch_flag = batch_silent = 1;
/* type: memrange_absolute == memory, other n == basereg */
/* base: addr if memory, offset if reg relative. */
/* len: we actually save end (base + len) for convenience */
- m_memranges.push_back (memrange (type, base, base + len));
+ m_memranges.emplace_back (type, base, base + len);
if (type != memrange_absolute) /* Better collect the base register! */
add_register (type);