From b2c17c1c5cdaa82c075eefa5329eb5defe217210 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Fri, 7 Mar 2008 18:45:40 -0300 Subject: [PATCH] Compile warning fixes. Cast types and removed/disable unused variables/functions. --- src/mga_bios.c | 2 +- src/mga_dac3026.c | 2 +- src/mga_dacG.c | 6 +++--- src/mga_driver.c | 6 +++--- src/mga_exa.c | 2 +- src/mga_vga.c | 2 ++ src/mga_video.c | 12 +++++++++--- 7 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/mga_bios.c b/src/mga_bios.c index 63c7b5e..5c5acbc 100644 --- a/src/mga_bios.c +++ b/src/mga_bios.c @@ -419,8 +419,8 @@ Bool mga_read_and_process_bios( ScrnInfoPtr pScrn ) MGAPtr pMga = MGAPTR(pScrn); #ifndef XSERVER_LIBPCIACCESS Bool pciBIOS = TRUE; -#endif int rlen; +#endif static const unsigned expected_length[] = { 0, 64, 64, 64, 128, 128 }; unsigned version; unsigned pins_len; diff --git a/src/mga_dac3026.c b/src/mga_dac3026.c index e33f914..4719fe5 100644 --- a/src/mga_dac3026.c +++ b/src/mga_dac3026.c @@ -872,7 +872,7 @@ MGA3026Save(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg, mgaReg->DacRegs[i] = inTi3026(MGADACregs[i]); #ifdef XSERVER_LIBPCIACCESS - pci_device_cfg_read_u32(pMga->PciInfo, & mgaReg->Option, + pci_device_cfg_read_u32(pMga->PciInfo, (uint32_t *)&mgaReg->Option, PCI_OPTION_REG); #else mgaReg->Option = pciReadLong(pMga->PciTag, PCI_OPTION_REG); diff --git a/src/mga_dacG.c b/src/mga_dacG.c index 1a6a565..7cff93e 100644 --- a/src/mga_dacG.c +++ b/src/mga_dacG.c @@ -961,9 +961,9 @@ MGAGSave(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg, mgaReg->PIXPLLCSaved = TRUE; #ifdef XSERVER_LIBPCIACCESS - pci_device_cfg_read_u32(pMga->PciInfo, & mgaReg->Option, + pci_device_cfg_read_u32(pMga->PciInfo, (uint32_t *)&mgaReg->Option, PCI_OPTION_REG); - pci_device_cfg_read_u32(pMga->PciInfo, & mgaReg->Option2, + pci_device_cfg_read_u32(pMga->PciInfo, (uint32_t *)&mgaReg->Option2, PCI_MGA_OPTION2); #else mgaReg->Option = pciReadLong(pMga->PciTag, PCI_OPTION_REG); @@ -972,7 +972,7 @@ MGAGSave(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg, #endif if (pMga->Chipset == PCI_CHIP_MGAG400 || pMga->Chipset == PCI_CHIP_MGAG550) #ifdef XSERVER_LIBPCIACCESS - pci_device_cfg_read_u32(pMga->PciInfo, & mgaReg->Option3, + pci_device_cfg_read_u32(pMga->PciInfo, (uint32_t *)&mgaReg->Option3, PCI_MGA_OPTION3); #else mgaReg->Option3 = pciReadLong(pMga->PciTag, PCI_MGA_OPTION3); diff --git a/src/mga_driver.c b/src/mga_driver.c index c5d27ef..6ec579d 100644 --- a/src/mga_driver.c +++ b/src/mga_driver.c @@ -138,7 +138,7 @@ static void MGAFreeScreen(int scrnIndex, int flags); static ModeStatus MGAValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags); -#if ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ >= 4) +#if defined(DEBUG) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ >= 4)) #define __must_check __attribute__((warn_unused_result)) #else #define __must_check /* */ @@ -2802,8 +2802,8 @@ MGAMapMem(ScrnInfoPtr pScrn) if (!pMga->FBDev) { #ifdef XSERVER_LIBPCIACCESS - memory[pMga->io_bar] = &pMga->IOBase; - memory[pMga->framebuffer_bar] = &pMga->FbBase; + memory[pMga->io_bar] = (void **)&pMga->IOBase; + memory[pMga->framebuffer_bar] = (void **)&pMga->FbBase; for (i = 0; i < 2; i++) { region = &dev->regions[i]; diff --git a/src/mga_exa.c b/src/mga_exa.c index 9321452..33b5005 100644 --- a/src/mga_exa.c +++ b/src/mga_exa.c @@ -860,7 +860,7 @@ mgaExaInit(ScreenPtr pScreen) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "X %d Y %d bpp %d\n", pScrn->virtualX, pScrn->virtualY, pScrn->bitsPerPixel); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Start at %p, size %x, osb %x\n", + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Start at %p, size %lx, osb %lx\n", pExa->memoryBase, pExa->memorySize, pExa->offScreenBase); /* In PW24 mode, we need to align to "3 64-bytes" */ diff --git a/src/mga_vga.c b/src/mga_vga.c index 9f00b3d..56b9fb9 100644 --- a/src/mga_vga.c +++ b/src/mga_vga.c @@ -11,6 +11,8 @@ #include "mga.h" #include "mga_reg.h" +#include "unistd.h" + #define TEXT_AMOUNT 16384 #define FONT_AMOUNT (8*8192) diff --git a/src/mga_video.c b/src/mga_video.c index a2d7979..afa93f0 100644 --- a/src/mga_video.c +++ b/src/mga_video.c @@ -1382,6 +1382,7 @@ static void CopyMungedScanline_AXP(CARD32 *fb_ptr, short src_w, } } +#if 0 static void CopyMungedScanline_AXP2(CARD32 *fb_ptr, short src_w, CARD32 *tsp, CARD32 *tpu, CARD32 *tpv) { @@ -1401,7 +1402,7 @@ static void CopyMungedScanline_AXP2(CARD32 *fb_ptr, short src_w, fb_ptr+=4; } } - +#endif static void CopyMungedScanlineFilter_AXP(CARD32 *fb_ptr, short src_w, CARD32 *tsp1, CARD32 *tpu1, CARD32 *tpv1, @@ -1474,13 +1475,14 @@ static void CopyMungedScanlineFilter_AXP(CARD32 *fb_ptr, short src_w, } } +#if 0 static void CopyMungedScanlineFilterDown_AXP(CARD32 *fb_ptr, short src_w, CARD32 *tsp1, CARD32 *tpu1, CARD32 *tpv1, CARD32 *tsp2, CARD32 *tpu2, CARD32 *tpv2, int beta , int xds) { unsigned int k,y0_1,y1_1,y0_2,y1_2,u,v; - int yf[8], uf[4], vf[4]; + int yf[8]; for(k=src_w/8;k;k--) { y0_1=*tsp1; @@ -1512,6 +1514,7 @@ static void CopyMungedScanlineFilterDown_AXP(CARD32 *fb_ptr, short src_w, fb_ptr+=4; } } +#endif static void MGACopyScaledILOAD( ScrnInfoPtr pScrn, @@ -1809,7 +1812,10 @@ static void MGACopyILOAD( CARD32 *fb_ptr; CARD8 *ubuf, *vbuf; CARD32 *pu, *pv; - int k,l; + int l; +#ifdef CUSTOM_MEMCOPY + int k; +#endif short clip_x1, clip_x2, tmp_w; #ifdef DEBUG_MGA2164 -- 1.5.4.3