* [PATCH xf86-video-nouveau 1/2] xv: Avoid shadowed declaration of 'int i' in NVPutImage
@ 2019-01-21 2:31 Rhys Kidd
[not found] ` <20190121023119.1012-1-rhyskidd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Rhys Kidd @ 2019-01-21 2:31 UTC (permalink / raw)
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH xf86-video-nouveau 2/2] xv: Avoid shadowed declaration of 'int ret' in NVPutImage
[not found] ` <20190121023119.1012-1-rhyskidd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2019-01-21 2:31 ` Rhys Kidd
[not found] ` <20190121023119.1012-2-rhyskidd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Rhys Kidd @ 2019-01-21 2:31 UTC (permalink / raw)
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Ben Skeggs
Warning reported by gcc 8.2:
nouveau_xv.c: In function ‘NVPutImage’:
nouveau_xv.c:1369:7: warning: declaration of ‘ret’ shadows a previous local [-Wshadow]
int ret = BadImplementation;
^~~
nouveau_xv.c:1073:6: note: shadowed declaration is here
int ret, i;
^~~
Fixes: a50bba6 ("xv: misc cleanups")
Cc: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
---
src/nouveau_xv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/nouveau_xv.c b/src/nouveau_xv.c
index 1afe2f1..9d955e0 100644
--- a/src/nouveau_xv.c
+++ b/src/nouveau_xv.c
@@ -1366,7 +1366,7 @@ CPU_copy:
pPriv->currentBuffer ^= 1;
} else
if (action_flags & USE_TEXTURE) {
- int ret = BadImplementation;
+ ret = BadImplementation;
if (pNv->Architecture == NV_ARCH_30) {
ret = NV30PutTextureImage(pScrn, pPriv->video_mem,
--
2.19.1
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH xf86-video-nouveau 2/2] xv: Avoid shadowed declaration of 'int ret' in NVPutImage
[not found] ` <20190121023119.1012-2-rhyskidd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2019-01-21 2:46 ` Ilia Mirkin
0 siblings, 0 replies; 3+ messages in thread
From: Ilia Mirkin @ 2019-01-21 2:46 UTC (permalink / raw)
To: Rhys Kidd; +Cc: nouveau, Ben Skeggs
Thanks, series pushed.
On Sun, Jan 20, 2019 at 9:31 PM Rhys Kidd <rhyskidd@gmail.com> wrote:
>
> Warning reported by gcc 8.2:
>
> nouveau_xv.c: In function ‘NVPutImage’:
> nouveau_xv.c:1369:7: warning: declaration of ‘ret’ shadows a previous local [-Wshadow]
> int ret = BadImplementation;
> ^~~
> nouveau_xv.c:1073:6: note: shadowed declaration is here
> int ret, i;
> ^~~
>
> Fixes: a50bba6 ("xv: misc cleanups")
> Cc: Ben Skeggs <bskeggs@redhat.com>
> Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
> ---
> src/nouveau_xv.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/nouveau_xv.c b/src/nouveau_xv.c
> index 1afe2f1..9d955e0 100644
> --- a/src/nouveau_xv.c
> +++ b/src/nouveau_xv.c
> @@ -1366,7 +1366,7 @@ CPU_copy:
> pPriv->currentBuffer ^= 1;
> } else
> if (action_flags & USE_TEXTURE) {
> - int ret = BadImplementation;
> + ret = BadImplementation;
>
> if (pNv->Architecture == NV_ARCH_30) {
> ret = NV30PutTextureImage(pScrn, pPriv->video_mem,
> --
> 2.19.1
>
> _______________________________________________
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/nouveau
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-01-21 2:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-21 2:31 [PATCH xf86-video-nouveau 1/2] xv: Avoid shadowed declaration of 'int i' in NVPutImage Rhys Kidd
[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' " Rhys Kidd
[not found] ` <20190121023119.1012-2-rhyskidd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-01-21 2:46 ` Ilia Mirkin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox