From: Thomas Huth <thuth@redhat.com>
To: qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: [PULL 3/7] tests/qtest/m48t59-test: Silence compiler warning with -Wshadow
Date: Mon, 25 Sep 2023 11:00:56 +0200 [thread overview]
Message-ID: <20230925090100.45632-4-thuth@redhat.com> (raw)
In-Reply-To: <20230925090100.45632-1-thuth@redhat.com>
When compiling this file with -Wshadow=local , we get:
../tests/qtest/m48t59-test.c: In function ‘bcd_check_time’:
../tests/qtest/m48t59-test.c:195:17: warning: declaration of ‘s’
shadows a previous local [-Wshadow=local]
195 | long t, s;
| ^
../tests/qtest/m48t59-test.c:158:17: note: shadowed declaration is here
158 | QTestState *s = m48t59_qtest_start();
| ^
Rename the QTestState variable to "qts" which is the common
naming for such a variable in other tests.
Reported-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20230922163742.149444-1-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: "Daniel P. Berrangé" <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
tests/qtest/m48t59-test.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tests/qtest/m48t59-test.c b/tests/qtest/m48t59-test.c
index 843d2ced8e..9487faff1a 100644
--- a/tests/qtest/m48t59-test.c
+++ b/tests/qtest/m48t59-test.c
@@ -155,7 +155,7 @@ static void bcd_check_time(void)
struct tm *datep;
time_t ts;
const int wiggle = 2;
- QTestState *s = m48t59_qtest_start();
+ QTestState *qts = m48t59_qtest_start();
/*
* This check assumes a few things. First, we cannot guarantee that we get
@@ -173,10 +173,10 @@ static void bcd_check_time(void)
ts = time(NULL);
gmtime_r(&ts, &start);
- cmos_get_date_time(s, &date[0]);
- cmos_get_date_time(s, &date[1]);
- cmos_get_date_time(s, &date[2]);
- cmos_get_date_time(s, &date[3]);
+ cmos_get_date_time(qts, &date[0]);
+ cmos_get_date_time(qts, &date[1]);
+ cmos_get_date_time(qts, &date[2]);
+ cmos_get_date_time(qts, &date[3]);
ts = time(NULL);
gmtime_r(&ts, &end);
@@ -207,7 +207,7 @@ static void bcd_check_time(void)
g_assert_cmpint(ABS(t - s), <=, wiggle);
}
- qtest_quit(s);
+ qtest_quit(qts);
}
/* success if no crash or abort */
--
2.41.0
next prev parent reply other threads:[~2023-09-25 9:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-25 9:00 [PULL 0/7] qtest and misc patches Thomas Huth
2023-09-25 9:00 ` [PULL 1/7] meson.build: Make keyutils independent from keyring Thomas Huth
2023-09-25 9:00 ` [PULL 2/7] tests/qtest/netdev-socket: Raise connection timeout to 120 seconds Thomas Huth
2023-09-25 9:00 ` Thomas Huth [this message]
2023-09-25 9:00 ` [PULL 4/7] tests/qtest/netdev-socket: Do not test multicast on Darwin Thomas Huth
2023-09-25 9:00 ` [PULL 5/7] hw/mips/jazz: Move the NIC init code into a separate function Thomas Huth
2023-09-25 9:00 ` [PULL 6/7] hw/mips/jazz: Simplify the NIC setup code Thomas Huth
2023-09-25 9:01 ` [PULL 7/7] tests/avocado: fix waiting for vm shutdown in replay_linux Thomas Huth
2023-09-25 15:36 ` [PULL 0/7] qtest and misc patches Stefan Hajnoczi
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=20230925090100.45632-4-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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;
as well as URLs for NNTP newsgroup(s).