From: Rhys Kidd <rhyskidd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [PATCH xf86-video-nouveau 1/2] xv: Avoid shadowed declaration of 'int i' in NVPutImage
Date: Sun, 20 Jan 2019 21:31:18 -0500 [thread overview]
Message-ID: <20190121023119.1012-1-rhyskidd@gmail.com> (raw)
int i is accessed outside immediate scope so leave declaration at
the highest common scope level:
1073: int ret, i;
...
// Highest common scope
...
1193: if (newTTSize <= destination_buffer->size) {
...
// Used in this scope
...
1248: } else {
...
// Used in this scope
...
1316: }
// Not used in this scope
Warning reported by gcc 8.2:
nouveau_xv.c: In function ‘NVPutImage’:
nouveau_xv.c:1195:7: warning: declaration of ‘i’ shadows a previous local [-Wshadow]
int i = 0;
^
nouveau_xv.c:1073:11: note: shadowed declaration is here
int ret, i;
^
Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
---
src/nouveau_xv.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/nouveau_xv.c b/src/nouveau_xv.c
index a7ec21a..1afe2f1 100644
--- a/src/nouveau_xv.c
+++ b/src/nouveau_xv.c
@@ -1192,7 +1192,6 @@ NVPutImage(ScrnInfoPtr pScrn, short src_x, short src_y, short drw_x,
if (newTTSize <= destination_buffer->size) {
unsigned char *dst;
- int i = 0;
/* Upload to GART */
nouveau_bo_map(destination_buffer, NOUVEAU_BO_WR, pNv->client);
--
2.19.1
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
next reply other threads:[~2019-01-21 2:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-21 2:31 Rhys Kidd [this message]
[not found] ` <20190121023119.1012-1-rhyskidd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-01-21 2:31 ` [PATCH xf86-video-nouveau 2/2] xv: Avoid shadowed declaration of 'int ret' in NVPutImage Rhys Kidd
[not found] ` <20190121023119.1012-2-rhyskidd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-01-21 2:46 ` Ilia Mirkin
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=20190121023119.1012-1-rhyskidd@gmail.com \
--to=rhyskidd-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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