[PATCH] hw/xfree86/vgahw: ANSI-ify some KNR functions.

Tiago Vignatti tiago.vignatti at nokia.com
Mon Jul 5 04:17:25 PDT 2010


On Mon, Jul 05, 2010 at 03:26:41AM +0200, ext Jesse Adkins wrote:
> On Sat, Jul 03, 2010 at 08:35:00PM -0700, Jesse Adkins wrote:
> 
> > I found this bit of K&R after wandering around xfree86 for a while. It's a step in the right direction.
> > 
> >  Signed-off-by: Jesse Adkins <jesse_adkins7 at yahoo.com>
> > 
> > ---
> >  hw/xfree86/vgahw/vgaCmap.c |   19 +++++--------------
> >  1 files changed, 5 insertions(+), 14 deletions(-)
> > 
> > diff --git a/hw/xfree86/vgahw/vgaCmap.c b/hw/xfree86/vgahw/vgaCmap.c
> > index 83c29c3..c504ebf 100644
> > --- a/hw/xfree86/vgahw/vgaCmap.c
> > +++ b/hw/xfree86/vgahw/vgaCmap.c
> > @@ -43,9 +43,7 @@
> >  #define NOMAPYET        (ColormapPtr) 0
> >  
> >  int
> > -vgaListInstalledColormaps(pScreen, pmaps)
> > -     ScreenPtr    pScreen;
> > -     Colormap    *pmaps;
> > +vgaListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
> >  {
> >    /* By the time we are processing requests, we can guarantee that there
> >     * is always a colormap installed */
> > @@ -55,9 +53,7 @@ vgaListInstalledColormaps(pScreen, pmaps)
> >  }
> >  
> >  int
> > -vgaGetInstalledColormaps(pScreen, pmaps)
> > -     ScreenPtr        pScreen;
> > -     ColormapPtr    *pmaps;
> > +vgaGetInstalledColormaps(ScreenPtr pScreen, ColormapPtr *pmaps)
> >  {
> >    /* By the time we are processing requests, we can guarantee that there
> >     * is always a colormap installed */
> > @@ -73,10 +69,7 @@ int vgaCheckColorMap(ColormapPtr pmap)
> >  
> >  
> >  void
> > -vgaStoreColors(pmap, ndef, pdefs)
> > -     ColormapPtr    pmap;
> > -     int        ndef;
> > -     xColorItem            *pdefs;
> > +vgaStoreColors(ColormapPtr pmap, int ndef, xColorItem *pdefs)
> >  {
> >      int        i;
> >      unsigned char *cmap, *tmp = NULL;
> > @@ -214,8 +207,7 @@ vgaStoreColors(pmap, ndef, pdefs)
> >  
> >  
> >  void
> > -vgaInstallColormap(pmap)
> > -     ColormapPtr    pmap;
> > +vgaInstallColormap(ColormapPtr pmap)
> >  {
> >    ColormapPtr oldmap = GetInstalledmiColormap(pmap->pScreen);
> >    int         entries;
> > @@ -267,8 +259,7 @@ vgaInstallColormap(pmap)
> >  
> >  
> >  void
> > -vgaUninstallColormap(pmap)
> > -     ColormapPtr pmap;
> > +vgaUninstallColormap(ColormapPtr pmap)
> >  {
> >  
> >    ColormapPtr defColormap;
> > -- 
> > 1.7.0.4
> >
> > Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
> > 
> > Is this code still in use though?
> > git grep seems awfully quiet about them. vgaGetInstalledColormaps seems
> > unused, the others could be made static.
> 
> On second look, I don't think they are used.
> vgaHW.h doesn't list anything in there as _X_EXPORT. I believe that means that nobody else can even access those symbols.
> Nothing else in vga actually references those functions, except for the functions themselves.
> Doing a grep through the drivers shows that none of them are even trying to load the colormap functions or use them directly.
> If I delete the file and run Make, the module still compiles file.
> I think it's safe to just get rid of vgaCmap.c

I ack in deleting vgaCmap.c. Note also there's a single "symbol" in
hw/xfree86/doc/sgml/DESIGN.xml that you might want to delete either.


Thanks,

             Tiago


More information about the xorg-devel mailing list