From: Simon Marchi <simon.marchi@polymtl.ca>
To: Jerome Guitton <guitton@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] completion in command definition
Date: Wed, 11 Jan 2017 16:14:00 -0000 [thread overview]
Message-ID: <677c2a720f77b21fd672c24efc41c878@polymtl.ca> (raw)
In-Reply-To: <20170111160518.GH27546@adacore.com>
On 2017-01-11 11:05, Jerome Guitton wrote:
>> >+ struct cmd_list_element *last_line = 0;
>>
>> This should be either "= NULL" or "= nullptr", but actually I don't
>> think it needs to be initialized.
>
> lookup_cmd_1 does not set this parameter when it is initialized
> to NULL. However, the name of the variable was a thinko. I changed it
> to "result_list".
Actually, I think you are confusing pointer and pointee. lookup_cmd_1
checks if result_list is NULL, not if *result_list is NULL. So with
your version, since result_list is not NULL (&last_line is not NULL,
it's the address of the variable) lookup_cmd_1 will set the last_line
variable. There's no harm, but since we don't care about that value
it's not useful either. I think what you want is:
cmd = lookup_cmd_1 (&cmd_name, cmdlist, NULL, 1);
Thanks,
Simon
next prev parent reply other threads:[~2017-01-11 16:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-10 14:28 Jerome Guitton
2017-01-10 16:27 ` Simon Marchi
2017-01-11 16:05 ` Jerome Guitton
2017-01-11 16:14 ` Simon Marchi [this message]
2017-01-12 10:05 ` Jerome Guitton
2017-01-19 14:55 ` Pedro Alves
2017-01-31 14:29 ` Jerome Guitton
2017-01-31 15:10 ` Pedro Alves
2017-01-31 15:29 ` Jerome Guitton
2017-01-31 15:53 ` Pedro Alves
2017-01-31 16:04 ` Jerome Guitton
2017-01-31 16:05 ` Pedro Alves
2017-02-08 17:59 ` Jerome Guitton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=677c2a720f77b21fd672c24efc41c878@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=guitton@adacore.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox