While reading info_checkpoints_command, I noticed variable printed:
...
const fork_info *printed = NULL;
...
for (const fork_info &fi : fork_list)
{
if (requested > 0 && fi.num != requested)
continue;
printed = &fi;
...
}
if (printed == NULL)
...
has pointer type, but is just used as bool.
Make this explicit by changing the variable type to bool.
Tested on x86_64-linux.
Approved-By: Kevin Buettner <kevinb@redhat.com>
{
struct gdbarch *gdbarch = get_current_arch ();
int requested = -1;
- const fork_info *printed = NULL;
+ bool printed = false;
if (arg && *arg)
requested = (int) parse_and_eval_long (arg);
{
if (requested > 0 && fi.num != requested)
continue;
+ printed = true;
- printed = &fi;
if (fi.ptid == inferior_ptid)
gdb_printf ("* ");
else
gdb_putc ('\n');
}
- if (printed == NULL)
+
+ if (!printed)
{
if (requested > 0)
gdb_printf (_("No checkpoint number %d.\n"), requested);