[PATCH 01/19] xserver: remove index from CloseScreen (API/ABI breakage)

Dave Airlie airlied at gmail.com
Mon May 14 09:40:54 PDT 2012


This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 Xext/panoramiX.c                       |    4 ++--
 Xext/shm.c                             |    4 ++--
 Xext/xvdix.h                           |    2 +-
 Xext/xvmain.c                          |    8 ++++----
 Xext/xvmc.c                            |    4 ++--
 composite/compinit.c                   |    4 ++--
 dix/main.c                             |    2 +-
 exa/exa.c                              |    4 ++--
 fb/fb.h                                |    2 +-
 fb/fboverlay.c                         |    2 +-
 fb/fboverlay.h                         |    2 +-
 fb/fbscreen.c                          |    2 +-
 glx/glxscreens.c                       |    4 ++--
 glx/glxscreens.h                       |    2 +-
 hw/dmx/dmxscrinit.c                    |   10 +++++-----
 hw/dmx/input/dmxconsole.c              |    4 ++--
 hw/kdrive/src/kdrive.c                 |    4 ++--
 hw/kdrive/src/kdrive.h                 |    2 +-
 hw/kdrive/src/kxv.c                    |    4 ++--
 hw/vfb/InitOutput.c                    |    6 +++---
 hw/xfree86/common/xf86DGA.c            |    6 +++---
 hw/xfree86/common/xf86DPMS.c           |   14 +++++++-------
 hw/xfree86/common/xf86RandR.c          |    4 ++--
 hw/xfree86/common/xf86VGAarbiter.c     |    8 ++++----
 hw/xfree86/common/xf86VGAarbiterPriv.h |    2 +-
 hw/xfree86/common/xf86VidMode.c        |    6 +++---
 hw/xfree86/common/xf86cmap.c           |    6 +++---
 hw/xfree86/common/xf86fbman.c          |    4 ++--
 hw/xfree86/common/xf86sbusBus.c        |    4 ++--
 hw/xfree86/common/xf86xv.c             |    4 ++--
 hw/xfree86/common/xf86xvmc.c           |    4 ++--
 hw/xfree86/doc/ddxDesign.xml           |    6 +++---
 hw/xfree86/exa/examodule.c             |    4 ++--
 hw/xfree86/modes/xf86Crtc.c            |    4 ++--
 hw/xfree86/ramdac/xf86Cursor.c         |    6 +++---
 hw/xfree86/shadowfb/shadow.c           |    6 +++---
 hw/xfree86/xaa/xaaInit.c               |    6 +++---
 hw/xnest/Screen.c                      |    2 +-
 hw/xnest/Screen.h                      |    2 +-
 hw/xwin/win.h                          |    2 +-
 hw/xwin/winnativegdi.c                 |    4 ++--
 hw/xwin/winpfbdd.c                     |    6 +++---
 hw/xwin/winscrinit.c                   |    2 +-
 hw/xwin/winshaddd.c                    |    6 +++---
 hw/xwin/winshadddnl.c                  |    6 +++---
 hw/xwin/winshadgdi.c                   |    6 +++---
 include/scrnintstr.h                   |    3 +--
 mi/midispcur.c                         |    6 +++---
 mi/mioverlay.c                         |    6 +++---
 mi/mipointer.c                         |    6 +++---
 mi/miscrinit.c                         |    2 +-
 mi/misprite.c                          |    6 +++---
 miext/cw/cw.c                          |    6 +++---
 miext/damage/damage.c                  |    4 ++--
 miext/rootless/rootlessScreen.c        |    4 ++--
 miext/shadow/shadow.c                  |    4 ++--
 miext/sync/misync.c                    |    4 ++--
 randr/randr.c                          |    4 ++--
 randr/randrstr.h                       |    2 +-
 render/animcur.c                       |    4 ++--
 render/picture.c                       |    4 ++--
 render/picturestr.h                    |    2 +-
 xfixes/cursor.c                        |    4 ++--
 63 files changed, 138 insertions(+), 139 deletions(-)

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index 98d327f..de62a35 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -150,7 +150,7 @@ static GCFuncs XineramaGCFuncs = {
     (pGC)->funcs = &XineramaGCFuncs;
 
 static Bool
-XineramaCloseScreen(int i, ScreenPtr pScreen)
+XineramaCloseScreen(ScreenPtr pScreen)
 {
     PanoramiXScreenPtr pScreenPriv = (PanoramiXScreenPtr)
         dixLookupPrivate(&pScreen->devPrivates, PanoramiXScreenKey);
@@ -163,7 +163,7 @@ XineramaCloseScreen(int i, ScreenPtr pScreen)
 
     free((pointer) pScreenPriv);
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 static Bool
diff --git a/Xext/shm.c b/Xext/shm.c
index de48020..e9c4a4e 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -202,14 +202,14 @@ CheckForShmSyscall(void)
 #endif
 
 static Bool
-ShmCloseScreen(int i, ScreenPtr pScreen)
+ShmCloseScreen(ScreenPtr pScreen)
 {
     ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen);
 
     pScreen->CloseScreen = screen_priv->CloseScreen;
     dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, NULL);
     free(screen_priv);
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 static ShmScrPrivateRec *
diff --git a/Xext/xvdix.h b/Xext/xvdix.h
index d226726..59fc1ff 100644
--- a/Xext/xvdix.h
+++ b/Xext/xvdix.h
@@ -215,7 +215,7 @@ typedef struct {
     DestroyWindowProcPtr DestroyWindow;
     DestroyPixmapProcPtr DestroyPixmap;
     CloseScreenProcPtr CloseScreen;
-    Bool (*ddCloseScreen) (int, ScreenPtr);
+    Bool (*ddCloseScreen) (ScreenPtr);
     int (*ddQueryAdaptors) (ScreenPtr, XvAdaptorPtr *, int *);
     DevUnion devPriv;
 } XvScreenRec, *XvScreenPtr;
diff --git a/Xext/xvmain.c b/Xext/xvmain.c
index 48061a2..736114b 100644
--- a/Xext/xvmain.c
+++ b/Xext/xvmain.c
@@ -129,7 +129,7 @@ static void WriteSwappedVideoNotifyEvent(xvEvent *, xvEvent *);
 static void WriteSwappedPortNotifyEvent(xvEvent *, xvEvent *);
 static Bool CreateResourceTypes(void);
 
-static Bool XvCloseScreen(int, ScreenPtr);
+static Bool XvCloseScreen(ScreenPtr);
 static Bool XvDestroyPixmap(PixmapPtr);
 static Bool XvDestroyWindow(WindowPtr);
 static void XvResetProc(ExtensionEntry *);
@@ -290,7 +290,7 @@ XvScreenInit(ScreenPtr pScreen)
 }
 
 static Bool
-XvCloseScreen(int ii, ScreenPtr pScreen)
+XvCloseScreen(ScreenPtr pScreen)
 {
 
     XvScreenPtr pxvs;
@@ -301,13 +301,13 @@ XvCloseScreen(int ii, ScreenPtr pScreen)
     pScreen->DestroyWindow = pxvs->DestroyWindow;
     pScreen->CloseScreen = pxvs->CloseScreen;
 
-    (*pxvs->ddCloseScreen) (ii, pScreen);
+    (*pxvs->ddCloseScreen) (pScreen);
 
     free(pxvs);
 
     dixSetPrivate(&pScreen->devPrivates, XvScreenKey, NULL);
 
-    return (*pScreen->CloseScreen) (ii, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 static void
diff --git a/Xext/xvmc.c b/Xext/xvmc.c
index 8a1d940..4aaff4d 100644
--- a/Xext/xvmc.c
+++ b/Xext/xvmc.c
@@ -709,7 +709,7 @@ XvMCExtensionInit(void)
 }
 
 static Bool
-XvMCCloseScreen(int i, ScreenPtr pScreen)
+XvMCCloseScreen(ScreenPtr pScreen)
 {
     XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pScreen);
 
@@ -717,7 +717,7 @@ XvMCCloseScreen(int i, ScreenPtr pScreen)
 
     free(pScreenPriv);
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 int
diff --git a/composite/compinit.c b/composite/compinit.c
index eaa1256..bc1130e 100644
--- a/composite/compinit.c
+++ b/composite/compinit.c
@@ -53,7 +53,7 @@ DevPrivateKeyRec CompWindowPrivateKeyRec;
 DevPrivateKeyRec CompSubwindowsPrivateKeyRec;
 
 static Bool
-compCloseScreen(int index, ScreenPtr pScreen)
+compCloseScreen(ScreenPtr pScreen)
 {
     CompScreenPtr cs = GetCompScreen(pScreen);
     Bool ret;
@@ -82,7 +82,7 @@ compCloseScreen(int index, ScreenPtr pScreen)
 
     free(cs);
     dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, NULL);
-    ret = (*pScreen->CloseScreen) (index, pScreen);
+    ret = (*pScreen->CloseScreen) (pScreen);
 
     return ret;
 }
diff --git a/dix/main.c b/dix/main.c
index 70dcc94..7837e9a 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -325,7 +325,7 @@ main(int argc, char *argv[], char *envp[])
             FreeScratchPixmapsForScreen(i);
             FreeGCperDepth(i);
             FreeDefaultStipple(i);
-            (*screenInfo.screens[i]->CloseScreen) (i, screenInfo.screens[i]);
+            (*screenInfo.screens[i]->CloseScreen) (screenInfo.screens[i]);
             dixFreePrivates(screenInfo.screens[i]->devPrivates, PRIVATE_SCREEN);
             free(screenInfo.screens[i]);
             screenInfo.numScreens = i;
diff --git a/exa/exa.c b/exa/exa.c
index 754c830..b5eb44e 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -765,7 +765,7 @@ ExaWakeupHandler(int screenNum, pointer wakeupData, unsigned long result,
  * screen private, before calling down to the next CloseSccreen.
  */
 static Bool
-exaCloseScreen(int i, ScreenPtr pScreen)
+exaCloseScreen(ScreenPtr pScreen)
 {
     ExaScreenPriv(pScreen);
     PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
@@ -800,7 +800,7 @@ exaCloseScreen(int i, ScreenPtr pScreen)
 
     free(pExaScr);
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 /**
diff --git a/fb/fb.h b/fb/fb.h
index b327ce6..cc3b6ee 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -1419,7 +1419,7 @@ fbPushPixels(GCPtr pGC,
  */
 
 extern _X_EXPORT Bool
- fbCloseScreen(int indx, ScreenPtr pScreen);
+ fbCloseScreen(ScreenPtr pScreen);
 
 extern _X_EXPORT Bool
  fbRealizeFont(ScreenPtr pScreen, FontPtr pFont);
diff --git a/fb/fboverlay.c b/fb/fboverlay.c
index 998be66..a882ffa 100644
--- a/fb/fboverlay.c
+++ b/fb/fboverlay.c
@@ -81,7 +81,7 @@ fbOverlayCreateWindow(WindowPtr pWin)
 }
 
 Bool
-fbOverlayCloseScreen(int iScreen, ScreenPtr pScreen)
+fbOverlayCloseScreen(ScreenPtr pScreen)
 {
     FbOverlayScrPrivPtr pScrPriv = fbOverlayGetScrPriv(pScreen);
     int i;
diff --git a/fb/fboverlay.h b/fb/fboverlay.h
index 76198cd..9a93457 100644
--- a/fb/fboverlay.h
+++ b/fb/fboverlay.h
@@ -63,7 +63,7 @@ extern _X_EXPORT Bool
  fbOverlayCreateWindow(WindowPtr pWin);
 
 extern _X_EXPORT Bool
- fbOverlayCloseScreen(int iScreen, ScreenPtr pScreen);
+ fbOverlayCloseScreen(ScreenPtr pScreen);
 
 extern _X_EXPORT int
  fbOverlayWindowLayer(WindowPtr pWin);
diff --git a/fb/fbscreen.c b/fb/fbscreen.c
index c0903ec..0833cd4 100644
--- a/fb/fbscreen.c
+++ b/fb/fbscreen.c
@@ -27,7 +27,7 @@
 #include "fb.h"
 
 Bool
-fbCloseScreen(int index, ScreenPtr pScreen)
+fbCloseScreen(ScreenPtr pScreen)
 {
     int d;
     DepthPtr depths = pScreen->allowedDepths;
diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index 74b4c42..386987e 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -177,7 +177,7 @@ static char GLXServerExtensions[] =
     "GLX_SGIX_pbuffer " "GLX_MESA_copy_sub_buffer " "GLX_INTEL_swap_event";
 
 static Bool
-glxCloseScreen(int index, ScreenPtr pScreen)
+glxCloseScreen(ScreenPtr pScreen)
 {
     __GLXscreen *pGlxScreen = glxGetScreen(pScreen);
 
@@ -185,7 +185,7 @@ glxCloseScreen(int index, ScreenPtr pScreen)
 
     pGlxScreen->destroy(pGlxScreen);
 
-    return pScreen->CloseScreen(index, pScreen);
+    return pScreen->CloseScreen(pScreen);
 }
 
 __GLXscreen *
diff --git a/glx/glxscreens.h b/glx/glxscreens.h
index d5420ee..172268b 100644
--- a/glx/glxscreens.h
+++ b/glx/glxscreens.h
@@ -153,7 +153,7 @@ struct __GLXscreen {
     unsigned GLXminor;
     /*@} */
 
-    Bool (*CloseScreen) (int index, ScreenPtr pScreen);
+    Bool (*CloseScreen) (ScreenPtr pScreen);
 };
 
 void __glXScreenInit(__GLXscreen * screen, ScreenPtr pScreen);
diff --git a/hw/dmx/dmxscrinit.c b/hw/dmx/dmxscrinit.c
index 37b3f3b..2a3a1ff 100644
--- a/hw/dmx/dmxscrinit.c
+++ b/hw/dmx/dmxscrinit.c
@@ -59,7 +59,7 @@
 #include "mipointer.h"
 #include "micmap.h"
 
-extern Bool dmxCloseScreen(int idx, ScreenPtr pScreen);
+extern Bool dmxCloseScreen(ScreenPtr pScreen);
 static Bool dmxSaveScreen(ScreenPtr pScreen, int what);
 
 static unsigned long dmxGeneration;
@@ -422,12 +422,12 @@ dmxBECloseScreen(ScreenPtr pScreen)
 
 /** Close screen number \a idx. */
 Bool
-dmxCloseScreen(int idx, ScreenPtr pScreen)
+dmxCloseScreen(ScreenPtr pScreen)
 {
-    DMXScreenInfo *dmxScreen = &dmxScreens[idx];
+    DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
 
     /* Reset the proc vectors */
-    if (idx == 0) {
+    if (pScreen->myNum == 0) {
         dmxResetRender();
         dmxResetFonts();
     }
@@ -498,7 +498,7 @@ dmxCloseScreen(int idx, ScreenPtr pScreen)
     }
 
     DMX_UNWRAP(CloseScreen, dmxScreen, pScreen);
-    return pScreen->CloseScreen(idx, pScreen);
+    return pScreen->CloseScreen(pScreen);
 }
 
 static Bool
diff --git a/hw/dmx/input/dmxconsole.c b/hw/dmx/input/dmxconsole.c
index f63772b..600a705 100644
--- a/hw/dmx/input/dmxconsole.c
+++ b/hw/dmx/input/dmxconsole.c
@@ -640,7 +640,7 @@ dmxCloseConsole(myPrivate * priv)
 }
 
 static Bool
-dmxCloseConsoleScreen(int idx, ScreenPtr pScreen)
+dmxCloseConsoleScreen(ScreenPtr pScreen)
 {
     myPrivate *priv, *last;
 
@@ -650,7 +650,7 @@ dmxCloseConsoleScreen(int idx, ScreenPtr pScreen)
         dmxCloseConsole(last = priv);
 
     DMX_UNWRAP(CloseScreen, last, pScreen);
-    return pScreen->CloseScreen(idx, pScreen);
+    return pScreen->CloseScreen(pScreen);
 }
 
 static Cursor
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index ecdae19..21715bb 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -606,7 +606,7 @@ KdCreateScreenResources(ScreenPtr pScreen)
 }
 
 Bool
-KdCloseScreen(int index, ScreenPtr pScreen)
+KdCloseScreen(ScreenPtr pScreen)
 {
     KdScreenPriv(pScreen);
     KdScreenInfo *screen = pScreenPriv->screen;
@@ -616,7 +616,7 @@ KdCloseScreen(int index, ScreenPtr pScreen)
     pScreenPriv->closed = TRUE;
     pScreen->CloseScreen = pScreenPriv->CloseScreen;
     if (pScreen->CloseScreen)
-        ret = (*pScreen->CloseScreen) (index, pScreen);
+        ret = (*pScreen->CloseScreen) (pScreen);
     else
         ret = TRUE;
 
diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h
index 6c2f293..04a1cf7 100644
--- a/hw/kdrive/src/kdrive.h
+++ b/hw/kdrive/src/kdrive.h
@@ -442,7 +442,7 @@ Bool
  KdCreateScreenResources(ScreenPtr pScreen);
 
 Bool
- KdCloseScreen(int index, ScreenPtr pScreen);
+ KdCloseScreen(ScreenPtr pScreen);
 
 Bool
  KdSaveScreen(ScreenPtr pScreen, int on);
diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c
index 7097aee..b02dd88 100644
--- a/hw/kdrive/src/kxv.c
+++ b/hw/kdrive/src/kxv.c
@@ -58,7 +58,7 @@ of the copyright holder.
 
 /* XvScreenRec fields */
 
-static Bool KdXVCloseScreen(int, ScreenPtr);
+static Bool KdXVCloseScreen(ScreenPtr);
 static int KdXVQueryAdaptors(ScreenPtr, XvAdaptorPtr *, int *);
 
 /* XvAdaptorRec fields */
@@ -1118,7 +1118,7 @@ KdXVClipNotify(WindowPtr pWin, int dx, int dy)
 /**** Required XvScreenRec fields ****/
 
 static Bool
-KdXVCloseScreen(int i, ScreenPtr pScreen)
+KdXVCloseScreen(ScreenPtr pScreen)
 {
     XvScreenPtr pxvs = GET_XV_SCREEN(pScreen);
     KdXVScreenPtr ScreenPriv = GET_KDXV_SCREEN(pScreen);
diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
index e2cd96c..55e554c 100644
--- a/hw/vfb/InitOutput.c
+++ b/hw/vfb/InitOutput.c
@@ -760,9 +760,9 @@ static miPointerScreenFuncRec vfbPointerCursorFuncs = {
 };
 
 static Bool
-vfbCloseScreen(int index, ScreenPtr pScreen)
+vfbCloseScreen(ScreenPtr pScreen)
 {
-    vfbScreenInfoPtr pvfb = &vfbScreens[index];
+    vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum];
     int i;
 
     pScreen->CloseScreen = pvfb->closeScreen;
@@ -774,7 +774,7 @@ vfbCloseScreen(int index, ScreenPtr pScreen)
     for (i = 0; i < screenInfo.numScreens; i++)
         SetInstalledColormap(screenInfo.screens[i], NULL);
 
-    return pScreen->CloseScreen(index, pScreen);
+    return pScreen->CloseScreen(pScreen);
 }
 
 static Bool
diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c
index e0314d8..66a148c 100644
--- a/hw/xfree86/common/xf86DGA.c
+++ b/hw/xfree86/common/xf86DGA.c
@@ -56,7 +56,7 @@ static DevPrivateKeyRec DGAScreenKeyRec;
 #define DGAScreenKeyRegistered dixPrivateKeyRegistered(&DGAScreenKeyRec)
 static Bool mieq_installed;
 
-static Bool DGACloseScreen(int i, ScreenPtr pScreen);
+static Bool DGACloseScreen(ScreenPtr pScreen);
 static void DGADestroyColormap(ColormapPtr pmap);
 static void DGAInstallColormap(ColormapPtr pmap);
 static void DGAUninstallColormap(ColormapPtr pmap);
@@ -235,7 +235,7 @@ FreeMarkedVisuals(ScreenPtr pScreen)
 }
 
 static Bool
-DGACloseScreen(int i, ScreenPtr pScreen)
+DGACloseScreen(ScreenPtr pScreen)
 {
     DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
 
@@ -256,7 +256,7 @@ DGACloseScreen(int i, ScreenPtr pScreen)
 
     free(pScreenPriv);
 
-    return ((*pScreen->CloseScreen) (i, pScreen));
+    return ((*pScreen->CloseScreen) (pScreen));
 }
 
 static void
diff --git a/hw/xfree86/common/xf86DPMS.c b/hw/xfree86/common/xf86DPMS.c
index 54ad842..ef4a2c1 100644
--- a/hw/xfree86/common/xf86DPMS.c
+++ b/hw/xfree86/common/xf86DPMS.c
@@ -49,7 +49,7 @@
 #ifdef DPMSExtension
 static DevPrivateKeyRec DPMSKeyRec;
 static DevPrivateKey DPMSKey;
-static Bool DPMSClose(int i, ScreenPtr pScreen);
+static Bool DPMSClose(ScreenPtr pScreen);
 static int DPMSCount = 0;
 #endif
 
@@ -99,10 +99,10 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags)
 #ifdef DPMSExtension
 
 static Bool
-DPMSClose(int i, ScreenPtr pScreen)
+DPMSClose(ScreenPtr pScreen)
 {
     DPMSPtr pDPMS;
-
+    ScrnInfoPtr pScrn;
     /* This shouldn't happen */
     if (DPMSKey == NULL)
         return FALSE;
@@ -114,20 +114,20 @@ DPMSClose(int i, ScreenPtr pScreen)
         return FALSE;
 
     pScreen->CloseScreen = pDPMS->CloseScreen;
-
+    pScrn = xf86ScreenToScrn(pScreen);
     /*
      * Turn on DPMS when shutting down. If this function can be used
      * depends on the order the driver wraps things. If this is called
      * after the driver has shut down everything the driver will have
      * to deal with this internally.
      */
-    if (xf86Screens[i]->vtSema && xf86Screens[i]->DPMSSet) {
-        xf86Screens[i]->DPMSSet(xf86Screens[i], DPMSModeOn, 0);
+    if (pScrn->vtSema && pScrn->DPMSSet) {
+        pScrn->DPMSSet(pScrn, DPMSModeOn, 0);
     }
 
     if (--DPMSCount == 0)
         DPMSKey = NULL;
-    return pScreen->CloseScreen(i, pScreen);
+    return pScreen->CloseScreen(pScreen);
 }
 
 /*
diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c
index b17f601..ec76fee 100644
--- a/hw/xfree86/common/xf86RandR.c
+++ b/hw/xfree86/common/xf86RandR.c
@@ -365,7 +365,7 @@ xf86RandRCreateScreenResources(ScreenPtr pScreen)
  * Reset size back to original
  */
 static Bool
-xf86RandRCloseScreen(int index, ScreenPtr pScreen)
+xf86RandRCloseScreen(ScreenPtr pScreen)
 {
     ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen);
     XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
@@ -376,7 +376,7 @@ xf86RandRCloseScreen(int index, ScreenPtr pScreen)
     pScreen->CloseScreen = randrp->CloseScreen;
     free(randrp);
     dixSetPrivate(&pScreen->devPrivates, xf86RandRKey, NULL);
-    return (*pScreen->CloseScreen) (index, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 Rotation
diff --git a/hw/xfree86/common/xf86VGAarbiter.c b/hw/xfree86/common/xf86VGAarbiter.c
index ec8d658..ea40cd8 100644
--- a/hw/xfree86/common/xf86VGAarbiter.c
+++ b/hw/xfree86/common/xf86VGAarbiter.c
@@ -221,7 +221,7 @@ xf86VGAarbiterWrapFunctions(void)
 
 /* Screen funcs */
 static Bool
-VGAarbiterCloseScreen(int i, ScreenPtr pScreen)
+VGAarbiterCloseScreen(ScreenPtr pScreen)
 {
     Bool val;
     ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
@@ -258,9 +258,9 @@ VGAarbiterCloseScreen(int i, ScreenPtr pScreen)
     UNWRAP_SPRITE;
 
     free((pointer) pScreenPriv);
-    xf86VGAarbiterLock(xf86Screens[i]);
-    val = (*pScreen->CloseScreen) (i, pScreen);
-    xf86VGAarbiterUnlock(xf86Screens[i]);
+    xf86VGAarbiterLock(xf86ScreenToScrn(pScreen));
+    val = (*pScreen->CloseScreen) (pScreen);
+    xf86VGAarbiterUnlock(xf86ScreenToScrn(pScreen));
     return val;
 }
 
diff --git a/hw/xfree86/common/xf86VGAarbiterPriv.h b/hw/xfree86/common/xf86VGAarbiterPriv.h
index ebc8854..92a0cb6 100644
--- a/hw/xfree86/common/xf86VGAarbiterPriv.h
+++ b/hw/xfree86/common/xf86VGAarbiterPriv.h
@@ -146,7 +146,7 @@ static void VGAarbiterBlockHandler(int i, pointer blockData, pointer pTimeout,
                                    pointer pReadmask);
 static void VGAarbiterWakeupHandler(int i, pointer blockData,
                                     unsigned long result, pointer pReadmask);
-static Bool VGAarbiterCloseScreen(int i, ScreenPtr pScreen);
+static Bool VGAarbiterCloseScreen(ScreenPtr pScreen);
 static void VGAarbiterGetImage(DrawablePtr pDrawable, int sx, int sy, int w,
                                int h, unsigned int format,
                                unsigned long planemask, char *pdstLine);
diff --git a/hw/xfree86/common/xf86VidMode.c b/hw/xfree86/common/xf86VidMode.c
index 13ffe06..0fc58e2 100644
--- a/hw/xfree86/common/xf86VidMode.c
+++ b/hw/xfree86/common/xf86VidMode.c
@@ -50,7 +50,7 @@
 static DevPrivateKeyRec VidModeKeyRec;
 static DevPrivateKey VidModeKey;
 static int VidModeCount = 0;
-static Bool VidModeClose(int i, ScreenPtr pScreen);
+static Bool VidModeClose(ScreenPtr pScreen);
 
 #define VMPTR(p) ((VidModePtr)dixLookupPrivate(&(p)->devPrivates, VidModeKey))
 
@@ -93,7 +93,7 @@ VidModeExtensionInit(ScreenPtr pScreen)
 #ifdef XF86VIDMODE
 
 static Bool
-VidModeClose(int i, ScreenPtr pScreen)
+VidModeClose(ScreenPtr pScreen)
 {
     VidModePtr pVidMode = VMPTR(pScreen);
 
@@ -108,7 +108,7 @@ VidModeClose(int i, ScreenPtr pScreen)
         dixSetPrivate(&pScreen->devPrivates, VidModeKey, NULL);
         VidModeKey = NULL;
     }
-    return pScreen->CloseScreen(i, pScreen);
+    return pScreen->CloseScreen(pScreen);
 }
 
 Bool
diff --git a/hw/xfree86/common/xf86cmap.c b/hw/xfree86/common/xf86cmap.c
index 460fafd..eacf714 100644
--- a/hw/xfree86/common/xf86cmap.c
+++ b/hw/xfree86/common/xf86cmap.c
@@ -111,7 +111,7 @@ static DevPrivateKeyRec CMapColormapKeyRec;
 
 static void CMapInstallColormap(ColormapPtr);
 static void CMapStoreColors(ColormapPtr, int, xColorItem *);
-static Bool CMapCloseScreen(int, ScreenPtr);
+static Bool CMapCloseScreen(ScreenPtr);
 static Bool CMapCreateColormap(ColormapPtr);
 static void CMapDestroyColormap(ColormapPtr);
 
@@ -241,11 +241,11 @@ xf86HandleColormaps(ScreenPtr pScreen,
 /**** Screen functions ****/
 
 static Bool
-CMapCloseScreen(int i, ScreenPtr pScreen)
+CMapCloseScreen(ScreenPtr pScreen)
 {
     CMapUnwrapScreen(pScreen);
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 static Bool
diff --git a/hw/xfree86/common/xf86fbman.c b/hw/xfree86/common/xf86fbman.c
index e2db1c3..c2e7bab 100644
--- a/hw/xfree86/common/xf86fbman.c
+++ b/hw/xfree86/common/xf86fbman.c
@@ -1149,7 +1149,7 @@ static FBManagerFuncs xf86FBManFuncs = {
 };
 
 static Bool
-xf86FBCloseScreen(int i, ScreenPtr pScreen)
+xf86FBCloseScreen(ScreenPtr pScreen)
 {
     FBLinkPtr pLink, tmp;
     FBLinearLinkPtr pLinearLink, tmp2;
@@ -1180,7 +1180,7 @@ xf86FBCloseScreen(int i, ScreenPtr pScreen)
     free(offman);
     dixSetPrivate(&pScreen->devPrivates, xf86FBScreenKey, NULL);
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 Bool
diff --git a/hw/xfree86/common/xf86sbusBus.c b/hw/xfree86/common/xf86sbusBus.c
index c993b60..52dcef1 100644
--- a/hw/xfree86/common/xf86sbusBus.c
+++ b/hw/xfree86/common/xf86sbusBus.c
@@ -666,7 +666,7 @@ xf86SbusCmapLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,
 }
 
 static Bool
-xf86SbusCmapCloseScreen(int i, ScreenPtr pScreen)
+xf86SbusCmapCloseScreen(ScreenPtr pScreen)
 {
     sbusCmapPtr cmap;
     struct fbcmap fbcmap;
@@ -682,7 +682,7 @@ xf86SbusCmapCloseScreen(int i, ScreenPtr pScreen)
     }
     pScreen->CloseScreen = cmap->CloseScreen;
     free(cmap);
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 Bool
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index 9f7f629..82ae320 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -57,7 +57,7 @@
 
 /* XvScreenRec fields */
 
-static Bool xf86XVCloseScreen(int, ScreenPtr);
+static Bool xf86XVCloseScreen(ScreenPtr);
 static int xf86XVQueryAdaptors(ScreenPtr, XvAdaptorPtr *, int *);
 
 /* XvAdaptorRec fields */
@@ -1256,7 +1256,7 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy)
 /**** Required XvScreenRec fields ****/
 
 static Bool
-xf86XVCloseScreen(int i, ScreenPtr pScreen)
+xf86XVCloseScreen(ScreenPtr pScreen)
 {
     ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     XvScreenPtr pxvs = GET_XV_SCREEN(pScreen);
diff --git a/hw/xfree86/common/xf86xvmc.c b/hw/xfree86/common/xf86xvmc.c
index 6407b05..3207e93 100644
--- a/hw/xfree86/common/xf86xvmc.c
+++ b/hw/xfree86/common/xf86xvmc.c
@@ -134,7 +134,7 @@ xf86XvMCDestroySubpicture(XvMCSubpicturePtr pSubpicture)
 }
 
 static Bool
-xf86XvMCCloseScreen(int i, ScreenPtr pScreen)
+xf86XvMCCloseScreen(ScreenPtr pScreen)
 {
     xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pScreen);
 
@@ -143,7 +143,7 @@ xf86XvMCCloseScreen(int i, ScreenPtr pScreen)
     free(pScreenPriv->dixinfo);
     free(pScreenPriv);
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 Bool
diff --git a/hw/xfree86/doc/ddxDesign.xml b/hw/xfree86/doc/ddxDesign.xml
index 1b0dbc4..0206833 100644
--- a/hw/xfree86/doc/ddxDesign.xml
+++ b/hw/xfree86/doc/ddxDesign.xml
@@ -9313,16 +9313,16 @@ ZZZLeaveVT(int scrnIndex, int flags)
 
 	<programlisting>
 static Bool
-ZZZCloseScreen(int scrnIndex, ScreenPtr pScreen)
+ZZZCloseScreen(ScreenPtr pScreen)
 {
-    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     if (pScrn-&gt;vtSema) {
         ZZZRestore(pScrn);
         ZZZUnmapMem(pScrn);
     }
     pScrn-&gt;vtSema = FALSE;
     pScreen-&gt;CloseScreen = ZZZPTR(pScrn)-&gt;CloseScreen;
-    return (*pScreen-&gt;CloseScreen)(scrnIndex, pScreen);
+    return (*pScreen-&gt;CloseScreen)(pScreen);
 }
 	</programlisting>
       </sect3>
diff --git a/hw/xfree86/exa/examodule.c b/hw/xfree86/exa/examodule.c
index 5092458..fc7bc7b 100644
--- a/hw/xfree86/exa/examodule.c
+++ b/hw/xfree86/exa/examodule.c
@@ -70,7 +70,7 @@ static const OptionInfoRec EXAOptions[] = {
 };
 
 static Bool
-exaXorgCloseScreen(int i, ScreenPtr pScreen)
+exaXorgCloseScreen(ScreenPtr pScreen)
 {
     ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     ExaXorgScreenPrivPtr pScreenPriv = (ExaXorgScreenPrivPtr)
@@ -83,7 +83,7 @@ exaXorgCloseScreen(int i, ScreenPtr pScreen)
     free(pScreenPriv->options);
     free(pScreenPriv);
 
-    return pScreen->CloseScreen(i, pScreen);
+    return pScreen->CloseScreen(pScreen);
 }
 
 static void
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index ab6ed5e..22a5675 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -716,7 +716,7 @@ xf86CrtcCreateScreenResources(ScreenPtr screen)
  * Clean up config on server reset
  */
 static Bool
-xf86CrtcCloseScreen(int index, ScreenPtr screen)
+xf86CrtcCloseScreen(ScreenPtr screen)
 {
     ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
     xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
@@ -738,7 +738,7 @@ xf86CrtcCloseScreen(int index, ScreenPtr screen)
     }
     xf86RandR12CloseScreen(screen);
 
-    return screen->CloseScreen(index, screen);
+    return screen->CloseScreen(screen);
 }
 
 /*
diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c
index 7fd70fc..1b7cdca 100644
--- a/hw/xfree86/ramdac/xf86Cursor.c
+++ b/hw/xfree86/ramdac/xf86Cursor.c
@@ -43,7 +43,7 @@ static miPointerSpriteFuncRec xf86CursorSpriteFuncs = {
 static void xf86CursorInstallColormap(ColormapPtr);
 static void xf86CursorRecolorCursor(DeviceIntPtr pDev, ScreenPtr, CursorPtr,
                                     Bool);
-static Bool xf86CursorCloseScreen(int, ScreenPtr);
+static Bool xf86CursorCloseScreen(ScreenPtr);
 static void xf86CursorQueryBestSize(int, unsigned short *, unsigned short *,
                                     ScreenPtr);
 
@@ -118,7 +118,7 @@ xf86InitCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr)
 /***** Screen functions *****/
 
 static Bool
-xf86CursorCloseScreen(int i, ScreenPtr pScreen)
+xf86CursorCloseScreen(ScreenPtr pScreen)
 {
     ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     miPointerScreenPtr PointPriv =
@@ -149,7 +149,7 @@ xf86CursorCloseScreen(int i, ScreenPtr pScreen)
     free(ScreenPriv->transparentData);
     free(ScreenPriv);
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 static void
diff --git a/hw/xfree86/shadowfb/shadow.c b/hw/xfree86/shadowfb/shadow.c
index 5aeee6c..a44a1d0 100644
--- a/hw/xfree86/shadowfb/shadow.c
+++ b/hw/xfree86/shadowfb/shadow.c
@@ -28,7 +28,7 @@
 
 #include "picturestr.h"
 
-static Bool ShadowCloseScreen(int i, ScreenPtr pScreen);
+static Bool ShadowCloseScreen(ScreenPtr pScreen);
 static void ShadowCopyWindow(WindowPtr pWin,
                              DDXPointRec ptOldOrg, RegionPtr prgn);
 static Bool ShadowCreateGC(GCPtr pGC);
@@ -227,7 +227,7 @@ ShadowLeaveVT(int index, int flags)
 /**********************************************************/
 
 static Bool
-ShadowCloseScreen(int i, ScreenPtr pScreen)
+ShadowCloseScreen(ScreenPtr pScreen)
 {
     ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen);
@@ -247,7 +247,7 @@ ShadowCloseScreen(int i, ScreenPtr pScreen)
 
     free((pointer) pPriv);
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 static void
diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c
index 48d0605..8f59453 100644
--- a/hw/xfree86/xaa/xaaInit.c
+++ b/hw/xfree86/xaa/xaaInit.c
@@ -27,7 +27,7 @@
 
 #define MIN_OFFPIX_SIZE		(320*200)
 
-static Bool XAACloseScreen(int i, ScreenPtr pScreen);
+static Bool XAACloseScreen(ScreenPtr pScreen);
 static void XAAGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
                         unsigned int format, unsigned long planemask,
                         char *pdstLine);
@@ -214,7 +214,7 @@ XAAInit(ScreenPtr pScreen, XAAInfoRecPtr infoRec)
 }
 
 static Bool
-XAACloseScreen(int i, ScreenPtr pScreen)
+XAACloseScreen(ScreenPtr pScreen)
 {
     ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     XAAScreenPtr pScreenPriv =
@@ -238,7 +238,7 @@ XAACloseScreen(int i, ScreenPtr pScreen)
 
     free((pointer) pScreenPriv);
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 static void
diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c
index dd76cb8..fb58c88 100644
--- a/hw/xnest/Screen.c
+++ b/hw/xnest/Screen.c
@@ -409,7 +409,7 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[])
 }
 
 Bool
-xnestCloseScreen(int index, ScreenPtr pScreen)
+xnestCloseScreen(ScreenPtr pScreen)
 {
     int i;
 
diff --git a/hw/xnest/Screen.h b/hw/xnest/Screen.h
index 1d255d7..5e58a1d 100644
--- a/hw/xnest/Screen.h
+++ b/hw/xnest/Screen.h
@@ -20,6 +20,6 @@ extern Window xnestScreenSaverWindows[MAXSCREENS];
 
 ScreenPtr xnestScreen(Window window);
 Bool xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]);
-Bool xnestCloseScreen(int index, ScreenPtr pScreen);
+Bool xnestCloseScreen(ScreenPtr pScreen);
 
 #endif                          /* XNESTSCREEN_H */
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index ce90d05..8d17128 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -275,7 +275,7 @@ typedef void (*winShadowUpdateProcPtr) (ScreenPtr, shadowBufPtr);
 
 typedef Bool (*winInitScreenProcPtr) (ScreenPtr);
 
-typedef Bool (*winCloseScreenProcPtr) (int, ScreenPtr);
+typedef Bool (*winCloseScreenProcPtr) (ScreenPtr);
 
 typedef Bool (*winInitVisualsProcPtr) (ScreenPtr);
 
diff --git a/hw/xwin/winnativegdi.c b/hw/xwin/winnativegdi.c
index 8a1455b..a2a5123 100644
--- a/hw/xwin/winnativegdi.c
+++ b/hw/xwin/winnativegdi.c
@@ -44,7 +44,7 @@ static void
  winShadowUpdateNativeGDI(ScreenPtr pScreen, shadowBufPtr pBuf);
 
 static Bool
- winCloseScreenNativeGDI(int nIndex, ScreenPtr pScreen);
+ winCloseScreenNativeGDI(ScreenPtr pScreen);
 
 static Bool
  winInitVisualsNativeGDI(ScreenPtr pScreen);
@@ -104,7 +104,7 @@ winInitScreenNativeGDI(ScreenPtr pScreen)
  */
 
 static Bool
-winCloseScreenNativeGDI(int nIndex, ScreenPtr pScreen)
+winCloseScreenNativeGDI(ScreenPtr pScreen)
 {
     winScreenPriv(pScreen);
     winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
diff --git a/hw/xwin/winpfbdd.c b/hw/xwin/winpfbdd.c
index 3fddd85..0fd0efe 100644
--- a/hw/xwin/winpfbdd.c
+++ b/hw/xwin/winpfbdd.c
@@ -44,7 +44,7 @@ static Bool
  winAllocateFBPrimaryDD(ScreenPtr pScreen);
 
 static Bool
- winCloseScreenPrimaryDD(int nIndex, ScreenPtr pScreen);
+ winCloseScreenPrimaryDD(ScreenPtr pScreen);
 
 static Bool
  winInitVisualsPrimaryDD(ScreenPtr pScreen);
@@ -264,7 +264,7 @@ winInitScreenPrimaryDD(ScreenPtr pScreen)
  */
 
 static Bool
-winCloseScreenPrimaryDD(int nIndex, ScreenPtr pScreen)
+winCloseScreenPrimaryDD(ScreenPtr pScreen)
 {
     winScreenPriv(pScreen);
     winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
@@ -279,7 +279,7 @@ winCloseScreenPrimaryDD(int nIndex, ScreenPtr pScreen)
     /* Call the wrapped CloseScreen procedure */
     WIN_UNWRAP(CloseScreen);
     if (pScreen->CloseScreen)
-        fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
+        fReturn = (*pScreen->CloseScreen) (pScreen);
 
     /* Delete the window property */
     RemoveProp(pScreenPriv->hwndScreen, WIN_SCR_PROP);
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index cf7d2c0..42891c2 100644
--- a/hw/xwin/winscrinit.c
+++ b/hw/xwin/winscrinit.c
@@ -206,7 +206,7 @@ winScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
         ErrorF("winScreenInit - winFinishScreenInit () failed\n");
 
         /* call the engine dependent screen close procedure to clean up from a failure */
-        pScreenPriv->pwinCloseScreen(index, pScreen);
+        pScreenPriv->pwinCloseScreen(pScreen);
 
         return FALSE;
     }
diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c
index a2aaa39..4c77cc0 100644
--- a/hw/xwin/winshaddd.c
+++ b/hw/xwin/winshaddd.c
@@ -65,7 +65,7 @@ static void
  winShadowUpdateDD(ScreenPtr pScreen, shadowBufPtr pBuf);
 
 static Bool
- winCloseScreenShadowDD(int nIndex, ScreenPtr pScreen);
+ winCloseScreenShadowDD(ScreenPtr pScreen);
 
 static Bool
  winInitVisualsShadowDD(ScreenPtr pScreen);
@@ -648,7 +648,7 @@ winInitScreenShadowDD(ScreenPtr pScreen)
  */
 
 static Bool
-winCloseScreenShadowDD(int nIndex, ScreenPtr pScreen)
+winCloseScreenShadowDD(ScreenPtr pScreen)
 {
     winScreenPriv(pScreen);
     winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
@@ -665,7 +665,7 @@ winCloseScreenShadowDD(int nIndex, ScreenPtr pScreen)
     /* Call the wrapped CloseScreen procedure */
     WIN_UNWRAP(CloseScreen);
     if (pScreen->CloseScreen)
-        fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
+        fReturn = (*pScreen->CloseScreen) (pScreen);
 
     winFreeFBShadowDD(pScreen);
 
diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c
index 6e71dd2..c087975 100644
--- a/hw/xwin/winshadddnl.c
+++ b/hw/xwin/winshadddnl.c
@@ -67,7 +67,7 @@ static void
  winShadowUpdateDDNL(ScreenPtr pScreen, shadowBufPtr pBuf);
 
 static Bool
- winCloseScreenShadowDDNL(int nIndex, ScreenPtr pScreen);
+ winCloseScreenShadowDDNL(ScreenPtr pScreen);
 
 static Bool
  winInitVisualsShadowDDNL(ScreenPtr pScreen);
@@ -719,7 +719,7 @@ winInitScreenShadowDDNL(ScreenPtr pScreen)
  */
 
 static Bool
-winCloseScreenShadowDDNL(int nIndex, ScreenPtr pScreen)
+winCloseScreenShadowDDNL(ScreenPtr pScreen)
 {
     winScreenPriv(pScreen);
     winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
@@ -736,7 +736,7 @@ winCloseScreenShadowDDNL(int nIndex, ScreenPtr pScreen)
     /* Call the wrapped CloseScreen procedure */
     WIN_UNWRAP(CloseScreen);
     if (pScreen->CloseScreen)
-        fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
+        fReturn = (*pScreen->CloseScreen) (pScreen);
 
     winFreeFBShadowDDNL(pScreen);
 
diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c
index 3b7b8b5..cdbb46b 100644
--- a/hw/xwin/winshadgdi.c
+++ b/hw/xwin/winshadgdi.c
@@ -50,7 +50,7 @@ static void
  winShadowUpdateGDI(ScreenPtr pScreen, shadowBufPtr pBuf);
 
 static Bool
- winCloseScreenShadowGDI(int nIndex, ScreenPtr pScreen);
+ winCloseScreenShadowGDI(ScreenPtr pScreen);
 
 static Bool
  winInitVisualsShadowGDI(ScreenPtr pScreen);
@@ -579,7 +579,7 @@ winInitScreenShadowGDI(ScreenPtr pScreen)
  */
 
 static Bool
-winCloseScreenShadowGDI(int nIndex, ScreenPtr pScreen)
+winCloseScreenShadowGDI(ScreenPtr pScreen)
 {
     winScreenPriv(pScreen);
     winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
@@ -596,7 +596,7 @@ winCloseScreenShadowGDI(int nIndex, ScreenPtr pScreen)
     /* Call the wrapped CloseScreen procedure */
     WIN_UNWRAP(CloseScreen);
     if (pScreen->CloseScreen)
-        fReturn = (*pScreen->CloseScreen) (nIndex, pScreen);
+        fReturn = (*pScreen->CloseScreen) (pScreen);
 
     /* Delete the window property */
     RemoveProp(pScreenPriv->hwndScreen, WIN_SCR_PROP);
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index 0ae9377..f77ace7 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -95,8 +95,7 @@ typedef struct _ScreenSaverStuff {
  *  or as a local variable) can easily do so and retain full type checking.
  */
 
-typedef Bool (*CloseScreenProcPtr) (int /*index */ ,
-                                    ScreenPtr /*pScreen */ );
+typedef Bool (*CloseScreenProcPtr) (ScreenPtr /*pScreen */ );
 
 typedef void (*QueryBestSizeProcPtr) (int /*class */ ,
                                       unsigned short * /*pwidth */ ,
diff --git a/mi/midispcur.c b/mi/midispcur.c
index 24b9a70..9ee8242 100644
--- a/mi/midispcur.c
+++ b/mi/midispcur.c
@@ -63,7 +63,7 @@ static DevScreenPrivateKeyRec miDCDeviceKeyRec;
 
 #define miDCDeviceKey (&miDCDeviceKeyRec)
 
-static Bool miDCCloseScreen(int index, ScreenPtr pScreen);
+static Bool miDCCloseScreen(ScreenPtr pScreen);
 
 /* per device private data */
 typedef struct {
@@ -128,7 +128,7 @@ miDCInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs)
 }
 
 static Bool
-miDCCloseScreen(int index, ScreenPtr pScreen)
+miDCCloseScreen(ScreenPtr pScreen)
 {
     miDCScreenPtr pScreenPriv;
 
@@ -136,7 +136,7 @@ miDCCloseScreen(int index, ScreenPtr pScreen)
                                                    miDCScreenKey);
     pScreen->CloseScreen = pScreenPriv->CloseScreen;
     free((pointer) pScreenPriv);
-    return (*pScreen->CloseScreen) (index, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 Bool
diff --git a/mi/mioverlay.c b/mi/mioverlay.c
index f72159e..2bfd5e4 100644
--- a/mi/mioverlay.c
+++ b/mi/mioverlay.c
@@ -66,7 +66,7 @@ static Bool HasUnderlayChildren(WindowPtr);
 static void MarkUnderlayWindow(WindowPtr);
 static Bool CollectUnderlayChildrenRegions(WindowPtr, RegionPtr);
 
-static Bool miOverlayCloseScreen(int, ScreenPtr);
+static Bool miOverlayCloseScreen(ScreenPtr);
 static Bool miOverlayCreateWindow(WindowPtr);
 static Bool miOverlayDestroyWindow(WindowPtr);
 static Bool miOverlayUnrealizeWindow(WindowPtr);
@@ -160,7 +160,7 @@ miInitOverlay(ScreenPtr pScreen,
 }
 
 static Bool
-miOverlayCloseScreen(int i, ScreenPtr pScreen)
+miOverlayCloseScreen(ScreenPtr pScreen)
 {
     miOverlayScreenPtr pScreenPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen);
 
@@ -172,7 +172,7 @@ miOverlayCloseScreen(int i, ScreenPtr pScreen)
 
     free(pScreenPriv);
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 static Bool
diff --git a/mi/mipointer.c b/mi/mipointer.c
index de6698a..a56838e 100644
--- a/mi/mipointer.c
+++ b/mi/mipointer.c
@@ -91,7 +91,7 @@ static void miPointerCursorLimits(DeviceIntPtr pDev, ScreenPtr pScreen,
                                   BoxPtr pTopLeftBox);
 static Bool miPointerSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen,
                                        int x, int y, Bool generateEvent);
-static Bool miPointerCloseScreen(int index, ScreenPtr pScreen);
+static Bool miPointerCloseScreen(ScreenPtr pScreen);
 static void miPointerMove(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y);
 static Bool miPointerDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen);
 static void miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen);
@@ -154,7 +154,7 @@ miPointerInitialize(ScreenPtr pScreen,
  * @param pScreen The actual screen pointer
  */
 static Bool
-miPointerCloseScreen(int index, ScreenPtr pScreen)
+miPointerCloseScreen(ScreenPtr pScreen)
 {
     SetupScreen(pScreen);
 
@@ -162,7 +162,7 @@ miPointerCloseScreen(int index, ScreenPtr pScreen)
     free((pointer) pScreenPriv);
     FreeEventList(events, GetMaximumEventsNum());
     events = NULL;
-    return (*pScreen->CloseScreen) (index, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 /*
diff --git a/mi/miscrinit.c b/mi/miscrinit.c
index 2850c8d..8dddc2c 100644
--- a/mi/miscrinit.c
+++ b/mi/miscrinit.c
@@ -119,7 +119,7 @@ miModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth,
 }
 
 static Bool
-miCloseScreen(int iScreen, ScreenPtr pScreen)
+miCloseScreen(ScreenPtr pScreen)
 {
     return ((*pScreen->DestroyPixmap) ((PixmapPtr) pScreen->devPrivate));
 }
diff --git a/mi/misprite.c b/mi/misprite.c
index c9fcabc..92fbe97 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -191,7 +191,7 @@ static DevPrivateKeyRec miSpriteDevPrivatesKeyRec;
 
 #define miSpriteDevPrivatesKey (&miSpriteDevPrivatesKeyRec)
 
-static Bool miSpriteCloseScreen(int i, ScreenPtr pScreen);
+static Bool miSpriteCloseScreen(ScreenPtr pScreen);
 static void miSpriteGetImage(DrawablePtr pDrawable, int sx, int sy,
                              int w, int h, unsigned int format,
                              unsigned long planemask, char *pdstLine);
@@ -367,7 +367,7 @@ miSpriteInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs)
  */
 
 static Bool
-miSpriteCloseScreen(int i, ScreenPtr pScreen)
+miSpriteCloseScreen(ScreenPtr pScreen)
 {
     miSpriteScreenPtr pScreenPriv = GetSpriteScreen(pScreen);
 
@@ -382,7 +382,7 @@ miSpriteCloseScreen(int i, ScreenPtr pScreen)
 
     free(pScreenPriv);
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 static void
diff --git a/miext/cw/cw.c b/miext/cw/cw.c
index 87ced2f..7543aff 100644
--- a/miext/cw/cw.c
+++ b/miext/cw/cw.c
@@ -51,7 +51,7 @@ DevPrivateKeyRec cwPictureKeyRec;
 extern GCOps cwGCOps;
 
 static Bool
- cwCloseScreen(int i, ScreenPtr pScreen);
+ cwCloseScreen(ScreenPtr pScreen);
 
 static void
  cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable);
@@ -502,7 +502,7 @@ miInitializeCompositeWrapper(ScreenPtr pScreen)
 }
 
 static Bool
-cwCloseScreen(int i, ScreenPtr pScreen)
+cwCloseScreen(ScreenPtr pScreen)
 {
     cwScreenPtr pScreenPriv;
     PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
@@ -520,5 +520,5 @@ cwCloseScreen(int i, ScreenPtr pScreen)
 
     free((pointer) pScreenPriv);
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index 72ed659..85b54fc 100644
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -1646,7 +1646,7 @@ damageDestroyWindow(WindowPtr pWindow)
 }
 
 static Bool
-damageCloseScreen(int i, ScreenPtr pScreen)
+damageCloseScreen(ScreenPtr pScreen)
 {
     damageScrPriv(pScreen);
 
@@ -1655,7 +1655,7 @@ damageCloseScreen(int i, ScreenPtr pScreen)
     unwrap(pScrPriv, pScreen, CopyWindow);
     unwrap(pScrPriv, pScreen, CloseScreen);
     free(pScrPriv);
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 /**
diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c
index ecc72ea..a1af3e7 100644
--- a/miext/rootless/rootlessScreen.c
+++ b/miext/rootless/rootlessScreen.c
@@ -138,7 +138,7 @@ RootlessCreateScreenResources(ScreenPtr pScreen)
 }
 
 static Bool
-RootlessCloseScreen(int i, ScreenPtr pScreen)
+RootlessCloseScreen(ScreenPtr pScreen)
 {
     RootlessScreenRec *s;
 
@@ -154,7 +154,7 @@ RootlessCloseScreen(int i, ScreenPtr pScreen)
     }
 
     free(s);
-    return pScreen->CloseScreen(i, pScreen);
+    return pScreen->CloseScreen(pScreen);
 }
 
 static void
diff --git a/miext/shadow/shadow.c b/miext/shadow/shadow.c
index d2ba684..2d869e5 100644
--- a/miext/shadow/shadow.c
+++ b/miext/shadow/shadow.c
@@ -96,7 +96,7 @@ shadowGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h,
 #define BACKWARDS_COMPATIBILITY
 
 static Bool
-shadowCloseScreen(int i, ScreenPtr pScreen)
+shadowCloseScreen(ScreenPtr pScreen)
 {
     shadowBuf(pScreen);
 
@@ -110,7 +110,7 @@ shadowCloseScreen(int i, ScreenPtr pScreen)
     if (pBuf->pPixmap)
         pScreen->DestroyPixmap(pBuf->pPixmap);
     free(pBuf);
-    return pScreen->CloseScreen(i, pScreen);
+    return pScreen->CloseScreen(pScreen);
 }
 
 #ifdef BACKWARDS_COMPATIBILITY
diff --git a/miext/sync/misync.c b/miext/sync/misync.c
index b1e2a36..d24921a 100644
--- a/miext/sync/misync.c
+++ b/miext/sync/misync.c
@@ -163,13 +163,13 @@ miSyncGetScreenFuncs(ScreenPtr pScreen)
 }
 
 static Bool
-SyncCloseScreen(int i, ScreenPtr pScreen)
+SyncCloseScreen(ScreenPtr pScreen)
 {
     SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen);
 
     pScreen->CloseScreen = pScreenPriv->CloseScreen;
 
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 Bool
diff --git a/randr/randr.c b/randr/randr.c
index 9f3df5f..a64aae3 100644
--- a/randr/randr.c
+++ b/randr/randr.c
@@ -83,7 +83,7 @@ RRClientCallback(CallbackListPtr *list, pointer closure, pointer data)
 }
 
 static Bool
-RRCloseScreen(int i, ScreenPtr pScreen)
+RRCloseScreen(ScreenPtr pScreen)
 {
     rrScrPriv(pScreen);
     int j;
@@ -98,7 +98,7 @@ RRCloseScreen(int i, ScreenPtr pScreen)
     free(pScrPriv->outputs);
     free(pScrPriv);
     RRNScreens -= 1;            /* ok, one fewer screen with RandR running */
-    return (*pScreen->CloseScreen) (i, pScreen);
+    return (*pScreen->CloseScreen) (pScreen);
 }
 
 static void
diff --git a/randr/randrstr.h b/randr/randrstr.h
index 273885d..f75fe44 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -198,7 +198,7 @@ typedef Bool (*RRSetPanningProcPtr) (ScreenPtr pScrn,
 #endif                          /* RANDR_13_INTERFACE */
 
 typedef Bool (*RRGetInfoProcPtr) (ScreenPtr pScreen, Rotation * rotations);
-typedef Bool (*RRCloseScreenProcPtr) (int i, ScreenPtr pscreen);
+typedef Bool (*RRCloseScreenProcPtr) (ScreenPtr pscreen);
 
 /* These are for 1.0 compatibility */
 
diff --git a/render/animcur.c b/render/animcur.c
index 485c068..b664b07 100644
--- a/render/animcur.c
+++ b/render/animcur.c
@@ -89,7 +89,7 @@ static DevPrivateKeyRec AnimCurScreenPrivateKeyRec;
 #define Unwrap(as,s,elt)    ((s)->elt = (as)->elt)
 
 static Bool
-AnimCurCloseScreen(int index, ScreenPtr pScreen)
+AnimCurCloseScreen(ScreenPtr pScreen)
 {
     AnimCurScreenPtr as = GetAnimCurScreen(pScreen);
     Bool ret;
@@ -103,7 +103,7 @@ AnimCurCloseScreen(int index, ScreenPtr pScreen)
     Unwrap(as, pScreen, UnrealizeCursor);
     Unwrap(as, pScreen, RecolorCursor);
     SetAnimCurScreen(pScreen, 0);
-    ret = (*pScreen->CloseScreen) (index, pScreen);
+    ret = (*pScreen->CloseScreen) (pScreen);
     free(as);
     return ret;
 }
diff --git a/render/picture.c b/render/picture.c
index da3e499..7887853 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -72,14 +72,14 @@ PictureDestroyWindow(WindowPtr pWindow)
 }
 
 Bool
-PictureCloseScreen(int index, ScreenPtr pScreen)
+PictureCloseScreen(ScreenPtr pScreen)
 {
     PictureScreenPtr ps = GetPictureScreen(pScreen);
     Bool ret;
     int n;
 
     pScreen->CloseScreen = ps->CloseScreen;
-    ret = (*pScreen->CloseScreen) (index, pScreen);
+    ret = (*pScreen->CloseScreen) (pScreen);
     PictureResetFilters(pScreen);
     for (n = 0; n < ps->nformats; n++)
         if (ps->formats[n].type == PictTypeIndexed)
diff --git a/render/picturestr.h b/render/picturestr.h
index cd4ec49..6da5656 100644
--- a/render/picturestr.h
+++ b/render/picturestr.h
@@ -381,7 +381,7 @@ extern _X_EXPORT Bool
  PictureDestroyWindow(WindowPtr pWindow);
 
 extern _X_EXPORT Bool
- PictureCloseScreen(int Index, ScreenPtr pScreen);
+ PictureCloseScreen(ScreenPtr pScreen);
 
 extern _X_EXPORT void
  PictureStoreColors(ColormapPtr pColormap, int ndef, xColorItem * pdef);
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index 602b906..467529a 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -190,7 +190,7 @@ CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
 }
 
 static Bool
-CursorCloseScreen(int index, ScreenPtr pScreen)
+CursorCloseScreen(ScreenPtr pScreen)
 {
     CursorScreenPtr cs = GetCursorScreen(pScreen);
     Bool ret;
@@ -202,7 +202,7 @@ CursorCloseScreen(int index, ScreenPtr pScreen)
     Unwrap(cs, pScreen, DisplayCursor, display_proc);
     Unwrap(cs, pScreen, ConstrainCursorHarder, constrain_proc);
     deleteCursorHideCountsForScreen(pScreen);
-    ret = (*pScreen->CloseScreen) (index, pScreen);
+    ret = (*pScreen->CloseScreen) (pScreen);
     free(cs);
     return ret;
 }
-- 
1.7.6



More information about the xorg-devel mailing list