This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Remove pre_expand_symtabs_matching quick_symbol_functions API
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Doug Evans <dje at google dot com>
- Cc: gdb-patches <gdb-patches at sourceware dot org>, Tom Tromey <tromey at redhat dot com>, Cary Coutant <ccoutant at google dot com>, Sterling Augustine <saugustine at google dot com>
- Date: Wed, 2 Jan 2013 23:56:36 +0100
- Subject: Re: [RFA] Remove pre_expand_symtabs_matching quick_symbol_functions API
- References: <yjt2obhnfiwq.fsf@ruffy2.mtv.corp.google.com> <20130101192235.GA16192@host2.jankratochvil.net> <CADPb22SXchi-Pq_nVTzdbSYxPVCjpXF0ZXFJ7m6TFjTzYYZsjA@mail.gmail.com>
On Wed, 02 Jan 2013 18:54:27 +0100, Doug Evans wrote:
> Yeah, except I think this case is a valid instance to violate them.
>
> An equivalent is:
>
> for (per_cu = dw2_symtab_iter_next (&iter);
> per_cu != NULL;
> per_cu = dw2_symtab_iter_next (&iter))
>
> I could change foo_init/foo_next to foo_first/foo_next so that it
> works better with for(), but blech.
I find the following code appropriate in such cases:
while ((per_cu = dw2_symtab_iter_next (&iter)) != NULL)
{
}
->
for (;;)
{
per_cu = dw2_symtab_iter_next (&iter);
if (per_cu == NULL)
break;
}
Sorry for this nitpick.
Jan