Re: [PATCH 17/22] Simplify ui-out level code

Pedro Alves
2016-11-24T18:42:03Z

On 11/24/2016 03:27 PM, Simon Marchi wrote:
> /* Discard the current level, return the discarded level's index.

"return the..." is stale.

> TYPE is the type of the level being discarded. */

> -static int
> +static void
> pop_level (struct ui_out *uiout,
> enum ui_out_type type)
> {

> specified after table_body and inside a list."));
> /* NOTE: cagney/2001-12-08: There was a check here to ensure
> - that this code was only executed when uiout->level was
> + that this code was only executed when uiout->level () was
> greater than zero. That no longer applies - this code is run
> before each table row tuple is started and at that point the
> level is zero. */

This is talking about level zero. Should we just delete the whole
comment?

> @@ -842,7 +833,7 @@ specified after table_body and inside a list."));

> @@ -906,11 +897,9 @@ ui_out_new (const struct ui_out_impl *impl, void *data,
> uiout->flags = flags;
> uiout->table.flag = 0;
> uiout->table.body_flag = 0;
> - uiout->level = 0;
>
> - /* Create uiout->level 0, the default level. */
> - std::unique_ptr<ui_out_level> level (new ui_out_level (ui_out_type_tuple));
> - uiout->levels.push_back (std::move (level));
> + /* Create uiout->level () 0, the default level. */
> + push_level (uiout, ui_out_type_tuple);

level 0 again?

Thanks,
Pedro Alves