qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
To: Eric Blake <eblake@redhat.com>
Cc: pbonzini@redhat.com, lcapitulino@redhat.com,
	qemu-devel@nongnu.org, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH V3 1/7] monitor: discard global variable *cur_mon in completion functions
Date: Fri, 28 Jun 2013 10:25:58 +0800	[thread overview]
Message-ID: <51CCF436.1010904@linux.vnet.ibm.com> (raw)
In-Reply-To: <51CCADFF.4040805@redhat.com>

于 2013-6-28 5:26, Eric Blake 写道:
> On 06/26/2013 09:27 PM, Wenchao Xia wrote:
>> Parameter *mon is added to replace *cur_mon, and readline_completion()
>> pass rs->mon as value, which should be initialized in readline_init()
>> called by monitor_init(). In short, structure ReadLineState controls
>> where the action would be taken now.
>>
>> Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
>> ---
>
>> @@ -4075,20 +4075,27 @@ static void file_completion(const char *input)
>>               if (stat(file, &sb) == 0 && S_ISDIR(sb.st_mode)) {
>>                   pstrcat(file, sizeof(file), "/");
>>               }
>> -            readline_add_completion(cur_mon->rs, file);
>> +            readline_add_completion(mon->rs, file);
>>           }
>>       }
>>       closedir(ffs);
>
> Oops, I started reviewing that before noticing you posted a v3.  At any
> rate, my review of v2 still stands on this patch.  Meanwhile, I just
> barely noticed that this pre-existing code might cause a -Wshadow
> warning in the future if <strings.h> is ever included.  I'm not sure
> what qemu's policy is on being clean against -Wshadow warnings, but I
> personally tend to avoid local variables whose name might conflict with
> global functions.
>
   Thanks for reviewing. I'll fix what you mentioned in v2.

   For the -Wshadow warning, I guess you mean "file" right? It would
be a bit hard to check this warning for new patch, since this warning
now exist in many code. In my opinion, it would be better to have a
separate series to clean up this warnings first, then check new patches
for this issue.

-- 
Best Regards

Wenchao Xia

  reply	other threads:[~2013-06-28  2:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-27  3:27 [Qemu-devel] [PATCH V3 0/7] monitor: support sub command group in auto completion and help Wenchao Xia
2013-06-27  3:27 ` [Qemu-devel] [PATCH V3 1/7] monitor: discard global variable *cur_mon in completion functions Wenchao Xia
2013-06-27 21:26   ` Eric Blake
2013-06-28  2:25     ` Wenchao Xia [this message]
2013-06-28 13:42       ` Eric Blake
2013-06-27  3:27 ` [Qemu-devel] [PATCH V3 2/7] monitor: discard global variable *mon_cmds Wenchao Xia
2013-06-27  3:27 ` [Qemu-devel] [PATCH V3 3/7] monitor: discard global variable *info_cmds in help functions Wenchao Xia
2013-06-27  3:27 ` [Qemu-devel] [PATCH V3 4/7] monitor: code move for parse_cmdline() Wenchao Xia
2013-06-27  3:27 ` [Qemu-devel] [PATCH V3 5/7] monitor: support sub commands in auto completion Wenchao Xia
2013-06-27  3:27 ` [Qemu-devel] [PATCH V3 6/7] monitor: improve "help" in auto completion for sub command Wenchao Xia
2013-06-27  3:27 ` [Qemu-devel] [PATCH V3 7/7] monitor: improve "help" to allow show tip of single command in sub group Wenchao Xia

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=51CCF436.1010904@linux.vnet.ibm.com \
    --to=xiawenc@linux.vnet.ibm.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).