* [Qemu-devel] [PATCH] monitor: avoid declaring unused variables
@ 2012-08-18 20:14 Blue Swirl
2012-08-18 20:23 ` Stefan Weil
2012-08-20 15:08 ` Luiz Capitulino
0 siblings, 2 replies; 5+ messages in thread
From: Blue Swirl @ 2012-08-18 20:14 UTC (permalink / raw)
To: qemu-devel; +Cc: blauwirbel, Markus Armbruster, Luiz Capitulino
Some variables are only used on !win32, declare
them only when used.
This avoids a warning in mingw32 build:
CC i386-softmmu/monitor.o
/src/qemu/monitor.c: In function 'monitor_fdset_get_fd':
/src/qemu/monitor.c:2575: warning: unused variable 'mon_fd_flags'
/src/qemu/monitor.c:2574: warning: unused variable 'mon_fdset_fd'
/src/qemu/monitor.c:2573: warning: unused variable 'mon_fdset'
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
monitor.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/monitor.c b/monitor.c
index ce42466..480f583 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2570,11 +2570,11 @@ FdsetInfoList *qmp_query_fdsets(Error **errp)
int monitor_fdset_get_fd(int64_t fdset_id, int flags)
{
+#ifndef _WIN32
MonFdset *mon_fdset;
MonFdsetFd *mon_fdset_fd;
int mon_fd_flags;
-#ifndef _WIN32
QLIST_FOREACH(mon_fdset, &mon_fdsets, next) {
if (mon_fdset->id != fdset_id) {
continue;
--
1.7.2.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] monitor: avoid declaring unused variables
2012-08-18 20:14 [Qemu-devel] [PATCH] monitor: avoid declaring unused variables Blue Swirl
@ 2012-08-18 20:23 ` Stefan Weil
2012-08-20 15:08 ` Luiz Capitulino
1 sibling, 0 replies; 5+ messages in thread
From: Stefan Weil @ 2012-08-18 20:23 UTC (permalink / raw)
To: Blue Swirl; +Cc: Luiz Capitulino, qemu-devel, Markus Armbruster
Am 18.08.2012 22:14, schrieb Blue Swirl:
> Some variables are only used on !win32, declare
> them only when used.
>
> This avoids a warning in mingw32 build:
> CC i386-softmmu/monitor.o
> /src/qemu/monitor.c: In function 'monitor_fdset_get_fd':
> /src/qemu/monitor.c:2575: warning: unused variable 'mon_fd_flags'
> /src/qemu/monitor.c:2574: warning: unused variable 'mon_fdset_fd'
> /src/qemu/monitor.c:2573: warning: unused variable 'mon_fdset'
>
> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
> ---
> monitor.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/monitor.c b/monitor.c
> index ce42466..480f583 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -2570,11 +2570,11 @@ FdsetInfoList *qmp_query_fdsets(Error **errp)
>
> int monitor_fdset_get_fd(int64_t fdset_id, int flags)
> {
> +#ifndef _WIN32
> MonFdset *mon_fdset;
> MonFdsetFd *mon_fdset_fd;
> int mon_fd_flags;
>
> -#ifndef _WIN32
> QLIST_FOREACH(mon_fdset, &mon_fdsets, next) {
> if (mon_fdset->id != fdset_id) {
> continue;
Reviewed-by: Stefan Weil <sw@weilnetz.de>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] monitor: avoid declaring unused variables
2012-08-18 20:14 [Qemu-devel] [PATCH] monitor: avoid declaring unused variables Blue Swirl
2012-08-18 20:23 ` Stefan Weil
@ 2012-08-20 15:08 ` Luiz Capitulino
2012-08-20 19:55 ` Blue Swirl
1 sibling, 1 reply; 5+ messages in thread
From: Luiz Capitulino @ 2012-08-20 15:08 UTC (permalink / raw)
To: Blue Swirl; +Cc: qemu-devel, Markus Armbruster
On Sat, 18 Aug 2012 20:14:54 +0000
Blue Swirl <blauwirbel@gmail.com> wrote:
> Some variables are only used on !win32, declare
> them only when used.
>
> This avoids a warning in mingw32 build:
> CC i386-softmmu/monitor.o
> /src/qemu/monitor.c: In function 'monitor_fdset_get_fd':
> /src/qemu/monitor.c:2575: warning: unused variable 'mon_fd_flags'
> /src/qemu/monitor.c:2574: warning: unused variable 'mon_fdset_fd'
> /src/qemu/monitor.c:2573: warning: unused variable 'mon_fdset'
>
> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Do you want this to go through my tree or will you apply it directly?
> ---
> monitor.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/monitor.c b/monitor.c
> index ce42466..480f583 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -2570,11 +2570,11 @@ FdsetInfoList *qmp_query_fdsets(Error **errp)
>
> int monitor_fdset_get_fd(int64_t fdset_id, int flags)
> {
> +#ifndef _WIN32
> MonFdset *mon_fdset;
> MonFdsetFd *mon_fdset_fd;
> int mon_fd_flags;
>
> -#ifndef _WIN32
> QLIST_FOREACH(mon_fdset, &mon_fdsets, next) {
> if (mon_fdset->id != fdset_id) {
> continue;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] monitor: avoid declaring unused variables
2012-08-20 15:08 ` Luiz Capitulino
@ 2012-08-20 19:55 ` Blue Swirl
2012-08-20 20:03 ` Luiz Capitulino
0 siblings, 1 reply; 5+ messages in thread
From: Blue Swirl @ 2012-08-20 19:55 UTC (permalink / raw)
To: Luiz Capitulino; +Cc: qemu-devel, Markus Armbruster
On Mon, Aug 20, 2012 at 3:08 PM, Luiz Capitulino <lcapitulino@redhat.com> wrote:
> On Sat, 18 Aug 2012 20:14:54 +0000
> Blue Swirl <blauwirbel@gmail.com> wrote:
>
>> Some variables are only used on !win32, declare
>> them only when used.
>>
>> This avoids a warning in mingw32 build:
>> CC i386-softmmu/monitor.o
>> /src/qemu/monitor.c: In function 'monitor_fdset_get_fd':
>> /src/qemu/monitor.c:2575: warning: unused variable 'mon_fd_flags'
>> /src/qemu/monitor.c:2574: warning: unused variable 'mon_fdset_fd'
>> /src/qemu/monitor.c:2573: warning: unused variable 'mon_fdset'
>>
>> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
>
> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
>
> Do you want this to go through my tree or will you apply it directly?
I'd like to get this to 1.2, so if you don't have anything in queue, I
can apply directly.
>
>> ---
>> monitor.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/monitor.c b/monitor.c
>> index ce42466..480f583 100644
>> --- a/monitor.c
>> +++ b/monitor.c
>> @@ -2570,11 +2570,11 @@ FdsetInfoList *qmp_query_fdsets(Error **errp)
>>
>> int monitor_fdset_get_fd(int64_t fdset_id, int flags)
>> {
>> +#ifndef _WIN32
>> MonFdset *mon_fdset;
>> MonFdsetFd *mon_fdset_fd;
>> int mon_fd_flags;
>>
>> -#ifndef _WIN32
>> QLIST_FOREACH(mon_fdset, &mon_fdsets, next) {
>> if (mon_fdset->id != fdset_id) {
>> continue;
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [PATCH] monitor: avoid declaring unused variables
2012-08-20 19:55 ` Blue Swirl
@ 2012-08-20 20:03 ` Luiz Capitulino
0 siblings, 0 replies; 5+ messages in thread
From: Luiz Capitulino @ 2012-08-20 20:03 UTC (permalink / raw)
To: Blue Swirl; +Cc: qemu-devel, Markus Armbruster
On Mon, 20 Aug 2012 19:55:10 +0000
Blue Swirl <blauwirbel@gmail.com> wrote:
> On Mon, Aug 20, 2012 at 3:08 PM, Luiz Capitulino <lcapitulino@redhat.com> wrote:
> > On Sat, 18 Aug 2012 20:14:54 +0000
> > Blue Swirl <blauwirbel@gmail.com> wrote:
> >
> >> Some variables are only used on !win32, declare
> >> them only when used.
> >>
> >> This avoids a warning in mingw32 build:
> >> CC i386-softmmu/monitor.o
> >> /src/qemu/monitor.c: In function 'monitor_fdset_get_fd':
> >> /src/qemu/monitor.c:2575: warning: unused variable 'mon_fd_flags'
> >> /src/qemu/monitor.c:2574: warning: unused variable 'mon_fdset_fd'
> >> /src/qemu/monitor.c:2573: warning: unused variable 'mon_fdset'
> >>
> >> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
> >
> > Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
> >
> > Do you want this to go through my tree or will you apply it directly?
>
> I'd like to get this to 1.2, so if you don't have anything in queue, I
> can apply directly.
I have a queue, and will submit a pull request probably tomorrow.
>
> >
> >> ---
> >> monitor.c | 2 +-
> >> 1 files changed, 1 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/monitor.c b/monitor.c
> >> index ce42466..480f583 100644
> >> --- a/monitor.c
> >> +++ b/monitor.c
> >> @@ -2570,11 +2570,11 @@ FdsetInfoList *qmp_query_fdsets(Error **errp)
> >>
> >> int monitor_fdset_get_fd(int64_t fdset_id, int flags)
> >> {
> >> +#ifndef _WIN32
> >> MonFdset *mon_fdset;
> >> MonFdsetFd *mon_fdset_fd;
> >> int mon_fd_flags;
> >>
> >> -#ifndef _WIN32
> >> QLIST_FOREACH(mon_fdset, &mon_fdsets, next) {
> >> if (mon_fdset->id != fdset_id) {
> >> continue;
> >
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-08-20 20:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-18 20:14 [Qemu-devel] [PATCH] monitor: avoid declaring unused variables Blue Swirl
2012-08-18 20:23 ` Stefan Weil
2012-08-20 15:08 ` Luiz Capitulino
2012-08-20 19:55 ` Blue Swirl
2012-08-20 20:03 ` Luiz Capitulino
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).