xv: Avoid shadowed declaration of 'int i' in NVPutImage
PATCH 1/2 xv: Avoid shadowed declaration of 'int i' in NVPutImage
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 scopeWarning 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;
^--- src/nouveau_xv.c | 1 - 1 file changed, 1 deletion(-)
src/nouveau_xv.c +0 -1
@@ -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);
Signature · 6 lines
2.19.1 _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
A message that is not in the archive (sent off-list or not yet received): 20190121023119.1012-1-rhyskidd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
PATCH 2/2 xv: Avoid shadowed declaration of 'int ret' in NVPutImage
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;
^~~--- src/nouveau_xv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/nouveau_xv.c +1 -1
@@ -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,
Signature · 6 lines
2.19.1 _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
A message that is not in the archive (sent off-list or not yet received): 20190121023119.1012-2-rhyskidd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Re: [PATCH xf86-video-nouveau 2/2] xv: Avoid shadowed declaration of 'int ret' in NVPutImage
Thanks, series pushed.
Quoted 34 lines · Rhys Kidd
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 <[email protected]>Signed-off-by Rhys Kidd <[email protected]>--- src/nouveau_xv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)src/nouveau_xv.c +1
-2@@ -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
Quoted 4 lines
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau