diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2018-02-16 13:55:37 +0100 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2018-02-20 09:36:20 +0100 |
commit | 3cdeaa5db76f5db7ce9482d3e067d3014076f8e4 (patch) | |
tree | c6847636a20cad493c9ad56574a5acb230cf1eef | |
parent | 4ea5c4d5fa1dcb125137bcb76b402490ac134b4f (diff) |
Fix a couple of shadowed declaration warnings
In some enviroments, "index", "y1" and "y2" are defined globally causing
warnings about shadowed declarations. Fix this.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
-rw-r--r-- | src/vmware.c | 8 | ||||
-rw-r--r-- | vmwgfx/vmwgfx_driver.c | 30 | ||||
-rw-r--r-- | vmwgfx/vmwgfx_tex_video.c | 26 |
3 files changed, 32 insertions, 32 deletions
diff --git a/src/vmware.c b/src/vmware.c index 211d69d..bd8ec37 100644 --- a/src/vmware.c +++ b/src/vmware.c @@ -125,7 +125,7 @@ VMWAREFreeRec(ScrnInfoPtr pScrn) } CARD32 -vmwareReadReg(VMWAREPtr pVMWARE, int index) +vmwareReadReg(VMWAREPtr pVMWARE, int rIndex) { /* * Block SIGIO for the duration, so we don't get interrupted after the @@ -139,7 +139,7 @@ vmwareReadReg(VMWAREPtr pVMWARE, int index) #else input_lock(); #endif - outl(pVMWARE->indexReg, index); + outl(pVMWARE->indexReg, rIndex); ret = inl(pVMWARE->valueReg); #if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 22) xf86UnblockSIGIO(oldsigio); @@ -150,7 +150,7 @@ vmwareReadReg(VMWAREPtr pVMWARE, int index) } void -vmwareWriteReg(VMWAREPtr pVMWARE, int index, CARD32 value) +vmwareWriteReg(VMWAREPtr pVMWARE, int wIndex, CARD32 value) { /* * Block SIGIO for the duration, so we don't get interrupted in between @@ -162,7 +162,7 @@ vmwareWriteReg(VMWAREPtr pVMWARE, int index, CARD32 value) #else input_lock(); #endif - outl(pVMWARE->indexReg, index); + outl(pVMWARE->indexReg, wIndex); outl(pVMWARE->valueReg, value); #if (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 22) xf86UnblockSIGIO(oldsigio); diff --git a/vmwgfx/vmwgfx_driver.c b/vmwgfx/vmwgfx_driver.c index 24313fa..665f620 100644 --- a/vmwgfx/vmwgfx_driver.c +++ b/vmwgfx/vmwgfx_driver.c @@ -180,7 +180,7 @@ drv_free_rec(ScrnInfoPtr pScrn) } static void -drv_probe_ddc(ScrnInfoPtr pScrn, int index) +drv_probe_ddc(ScrnInfoPtr pScrn, int _index) { ConfiguredMonitor = NULL; } @@ -919,42 +919,42 @@ static void drv_load_palette(ScrnInfoPtr pScrn, int numColors, { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); modesettingPtr ms = modesettingPTR(pScrn); - int index, j, i; + int _index, j, i; int c; switch(pScrn->depth) { case 15: for (i = 0; i < numColors; i++) { - index = indices[i]; + _index = indices[i]; for (j = 0; j < 8; j++) { - ms->lut_r[index * 8 + j] = colors[index].red << 8; - ms->lut_g[index * 8 + j] = colors[index].green << 8; - ms->lut_b[index * 8 + j] = colors[index].blue << 8; + ms->lut_r[_index * 8 + j] = colors[_index].red << 8; + ms->lut_g[_index * 8 + j] = colors[_index].green << 8; + ms->lut_b[_index * 8 + j] = colors[_index].blue << 8; } } break; case 16: for (i = 0; i < numColors; i++) { - index = indices[i]; + _index = indices[i]; - if (index < 32) { + if (_index < 32) { for (j = 0; j < 8; j++) { - ms->lut_r[index * 8 + j] = colors[index].red << 8; - ms->lut_b[index * 8 + j] = colors[index].blue << 8; + ms->lut_r[_index * 8 + j] = colors[_index].red << 8; + ms->lut_b[_index * 8 + j] = colors[_index].blue << 8; } } for (j = 0; j < 4; j++) { - ms->lut_g[index * 4 + j] = colors[index].green << 8; + ms->lut_g[_index * 4 + j] = colors[_index].green << 8; } } break; default: for (i = 0; i < numColors; i++) { - index = indices[i]; - ms->lut_r[index] = colors[index].red << 8; - ms->lut_g[index] = colors[index].green << 8; - ms->lut_b[index] = colors[index].blue << 8; + _index = indices[i]; + ms->lut_r[_index] = colors[_index].red << 8; + ms->lut_g[_index] = colors[_index].green << 8; + ms->lut_b[_index] = colors[_index].blue << 8; } break; } diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c index a767d89..e42a4c6 100644 --- a/vmwgfx/vmwgfx_tex_video.c +++ b/vmwgfx/vmwgfx_tex_video.c @@ -606,7 +606,7 @@ copy_packed_data(ScrnInfoPtr pScrn, int i; struct xa_surface **yuv = port->yuv[port->current_set]; char *ymap, *vmap, *umap; - unsigned char y1, y2, u, v; + unsigned char _y1, _y2, u, v; int yidx, uidx, vidx; int y_array_size = w * h; int ret = BadAlloc; @@ -643,13 +643,13 @@ copy_packed_data(ScrnInfoPtr pScrn, for (i = 0; i < y_array_size; i +=2 ) { /* extracting two pixels */ u = buf[0]; - y1 = buf[1]; + _y1 = buf[1]; v = buf[2]; - y2 = buf[3]; + _y2 = buf[3]; buf += 4; - ymap[yidx++] = y1; - ymap[yidx++] = y2; + ymap[yidx++] = _y1; + ymap[yidx++] = _y2; umap[uidx++] = u; vmap[vidx++] = v; } @@ -657,15 +657,15 @@ copy_packed_data(ScrnInfoPtr pScrn, case FOURCC_YUY2: for (i = 0; i < y_array_size; i +=2 ) { /* extracting two pixels */ - y1 = buf[0]; + _y1 = buf[0]; u = buf[1]; - y2 = buf[2]; + _y2 = buf[2]; v = buf[3]; buf += 4; - ymap[yidx++] = y1; - ymap[yidx++] = y2; + ymap[yidx++] = _y1; + ymap[yidx++] = _y2; umap[uidx++] = u; vmap[vidx++] = v; } @@ -829,22 +829,22 @@ put_image(ScrnInfoPtr pScrn, struct xorg_xv_port_priv *pPriv = (struct xorg_xv_port_priv *) data; ScreenPtr pScreen = xf86ScrnToScreen(pScrn); PixmapPtr pPixmap; - INT32 x1, x2, y1, y2; + INT32 x1, x2, _y1, _y2; BoxRec dstBox; int ret; /* Clip */ x1 = src_x; x2 = src_x + src_w; - y1 = src_y; - y2 = src_y + src_h; + _y1 = src_y; + _y2 = src_y + src_h; dstBox.x1 = drw_x; dstBox.x2 = drw_x + drw_w; dstBox.y1 = drw_y; dstBox.y2 = drw_y + drw_h; - if (!xf86XVClipVideoHelper(&dstBox, &x1, &x2, &y1, &y2, clipBoxes, + if (!xf86XVClipVideoHelper(&dstBox, &x1, &x2, &_y1, &_y2, clipBoxes, width, height)) return Success; |