Honestly, I've been thinking more and more that the "empty line after
declarations" no longer makes sense nowaways, given types with
constructors, which I kind of read like a function call, and also
with the desire to exercise the freedom (from a language perspective)
to declare variables not-just-at-the-start-of-a-scope.
In this case, the resulting code looked like this:
if (current_context->all || current_context->thread_group != -1)
{
scoped_restore_current_thread restore_thread;
int pid = 0;
if (!current_context->all)
{
struct inferior *inf
= find_inferior_id (current_context->thread_group);
pid = inf->pid;
}
iterate_over_threads (proceed_thread_callback, &pid);
}
The idea was put the "pid" variable closer to where
it's used, and the scoped_restore's ctor at the top of the scope,
kind of mirroring the fact that the dtor wil run at the end of
the scope.
Anyway, it's certainly a very minor, arguable detail, so I've
moved pid above the empty line.