[PATCH 2/2] Add type name argument to CreateNewResourceType

Alan Coopersmith alan.coopersmith at sun.com
Thu Dec 10 22:53:49 PST 2009


Convert all calls of CreateNewResourceType to pass name argument

Breaks DIX ABI

Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>
---
 Xext/mbuf.c                           |   18 +++++++-----------
 Xext/panoramiX.c                      |   18 ++++++++----------
 Xext/saver.c                          |   12 +++++-------
 Xext/security.c                       |   10 +++++-----
 Xext/shape.c                          |    7 ++-----
 Xext/shm.c                            |    4 +---
 Xext/sleepuntil.c                     |    5 ++---
 Xext/sync.c                           |   16 +++++-----------
 Xext/xvdisp.c                         |    5 +----
 Xext/xvmain.c                         |   23 ++++++++++-------------
 Xext/xvmc.c                           |   13 ++++++-------
 Xi/extinit.c                          |    5 ++---
 composite/compext.c                   |   15 ++++++---------
 damageext/damageext.c                 |    7 ++-----
 dbe/dbe.c                             |    8 ++------
 dix/resource.c                        |    8 ++++++--
 glx/glxext.c                          |   14 ++++++--------
 hw/dmx/glxProxy/glxext.c              |   22 ++++++++++------------
 hw/kdrive/ephyr/ephyrdriext.c         |    4 +---
 hw/xfree86/dixmods/extmod/xf86vmode.c |    4 +---
 hw/xfree86/dri/dri.c                  |    9 ++++-----
 hw/xfree86/dri/xf86dri.c              |    6 +-----
 hw/xfree86/dri2/dri2ext.c             |    5 +----
 hw/xquartz/applewm.c                  |    7 ++-----
 hw/xquartz/xpr/dri.c                  |    7 ++-----
 hw/xwin/winwindowswm.c                |    7 ++-----
 include/resource.h                    |    2 +-
 mi/miarc.c                            |    4 +---
 randr/randr.c                         |    8 ++------
 randr/rrcrtc.c                        |    4 +---
 randr/rrmode.c                        |    4 +---
 randr/rroutput.c                      |    4 +---
 record/record.c                       |    4 +---
 render/picture.c                      |   10 +++-------
 render/render.c                       |    7 ++-----
 xfixes/cursor.c                       |   16 ++++++----------
 xfixes/region.c                       |    6 +-----
 xfixes/select.c                       |   12 ++++--------
 xkb/xkb.c                             |    4 +---
 39 files changed, 125 insertions(+), 219 deletions(-)

diff --git a/Xext/mbuf.c b/Xext/mbuf.c
index 51e927a..f56ee26 100644
--- a/Xext/mbuf.c
+++ b/Xext/mbuf.c
@@ -42,8 +42,6 @@ in this Software without prior written authorization from The Open Group.
 #include "opaque.h"
 #include "sleepuntil.h"
 #include "inputstr.h"
-#include "registry.h"
-
 #include <X11/extensions/multibufconst.h>
 #include <X11/extensions/multibufproto.h>
 
@@ -469,10 +467,13 @@ MultibufferExtensionInit()
      * create the resource types
      */
     MultibufferDrawableResType =
-	CreateNewResourceType(MultibufferDrawableDelete);
-    MultibufferResType = CreateNewResourceType(MultibufferDelete);
-    MultibuffersResType = CreateNewResourceType(MultibuffersDelete);
-    OtherClientResType = CreateNewResourceType(OtherClientDelete);
+	CreateNewResourceType(MultibufferDrawableDelete, "MultibufferDrawable");
+    MultibufferResType = CreateNewResourceType(MultibufferDelete,
+					       "MultibufferBuffer");
+    MultibuffersResType = CreateNewResourceType(MultibuffersDelete,
+						"MultibufferWindow");
+    OtherClientResType = CreateNewResourceType(OtherClientDelete,
+					       "MultibufferOtherClient");
     if (MultibufferDrawableResType && MultibufferResType &&
 	MultibuffersResType && 	OtherClientResType &&
 	(extEntry = AddExtension(MULTIBUFFER_PROTOCOL_NAME,
@@ -482,11 +483,6 @@ MultibufferExtensionInit()
 				 MultibufferResetProc, StandardMinorOpcode)))
     {
 	MultibufferDrawableResType |= RC_DRAWABLE;
-	RegisterResourceName(MultibufferDrawableResType,
-			     "MultibufferDrawable");
-	RegisterResourceName(MultibufferResType, "MultibufferBuffer");
-	RegisterResourceName(MultibuffersResType, "MultibufferWindow");
-	RegisterResourceName(OtherClientResType, "MultibufferOtherClient");
 	MultibufferEventBase = extEntry->eventBase;
 	MultibufferErrorBase = extEntry->errorBase;
 	EventSwapVector[MultibufferEventBase + MultibufferClobberNotify] = (EventSwapPtr) SClobberNotifyEvent;
diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index 507eec2..c44e945 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -52,7 +52,6 @@ Equipment Corporation.
 #include "globals.h"
 #include "servermd.h"
 #include "resource.h"
-#include "registry.h"
 #ifdef RENDER
 #include "picturestr.h"
 #endif
@@ -504,18 +503,17 @@ void PanoramiXExtensionInit(int argc, char *argv[])
 	}
 
 	XRC_DRAWABLE = CreateNewResourceClass();
-	XRT_WINDOW = CreateNewResourceType(XineramaDeleteResource);
-	XRT_PIXMAP = CreateNewResourceType(XineramaDeleteResource);
-	XRT_GC = CreateNewResourceType(XineramaDeleteResource);
-	XRT_COLORMAP = CreateNewResourceType(XineramaDeleteResource);
+	XRT_WINDOW = CreateNewResourceType(XineramaDeleteResource,
+					   "XineramaWindow");
+	XRT_PIXMAP = CreateNewResourceType(XineramaDeleteResource,
+					   "XineramaPixmap");
+	XRT_GC = CreateNewResourceType(XineramaDeleteResource,
+				       "XineramaGC");
+	XRT_COLORMAP = CreateNewResourceType(XineramaDeleteResource,
+					     "XineramaColormap");
 
 	panoramiXGeneration = serverGeneration;
 	if (XRT_WINDOW && XRT_PIXMAP && XRT_GC && XRT_COLORMAP) {
-	    RegisterResourceName(XRT_WINDOW, "XineramaWindow");
-	    RegisterResourceName(XRT_PIXMAP, "XineramaPixmap");
-	    RegisterResourceName(XRT_GC, "XineramaGC");
-	    RegisterResourceName(XRT_COLORMAP, "XineramaColormap");
-
 	    XRT_WINDOW |= XRC_DRAWABLE;
 	    XRT_PIXMAP |= XRC_DRAWABLE;
 	    success = TRUE;
diff --git a/Xext/saver.c b/Xext/saver.c
index 5757f85..2549e8a 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -47,7 +47,6 @@ in this Software without prior written authorization from the X Consortium.
 #include "cursorstr.h"
 #include "colormapst.h"
 #include "xace.h"
-#include "registry.h"
 #ifdef PANORAMIX
 #include "panoramiX.h"
 #include "panoramiXsrv.h"
@@ -253,9 +252,11 @@ ScreenSaverExtensionInit(INITARGS)
     int		    i;
     ScreenPtr	    pScreen;
 
-    AttrType = CreateNewResourceType(ScreenSaverFreeAttr);
-    SaverEventType = CreateNewResourceType(ScreenSaverFreeEvents);
-    SuspendType = CreateNewResourceType(ScreenSaverFreeSuspend);
+    AttrType = CreateNewResourceType(ScreenSaverFreeAttr, "SaverAttr");
+    SaverEventType = CreateNewResourceType(ScreenSaverFreeEvents,
+					   "SaverEvent");
+    SuspendType = CreateNewResourceType(ScreenSaverFreeSuspend,
+					"SaverSuspend");
 
     for (i = 0; i < screenInfo.numScreens; i++)
     {
@@ -267,9 +268,6 @@ ScreenSaverExtensionInit(INITARGS)
 				 ProcScreenSaverDispatch, SProcScreenSaverDispatch,
 				 NULL, StandardMinorOpcode)))
     {
-	RegisterResourceName(AttrType, "SaverAttr");
-	RegisterResourceName(SaverEventType, "SaverEvent");
-	RegisterResourceName(SuspendType, "SaverSuspend");
 	ScreenSaverEventBase = extEntry->eventBase;
 	EventSwapVector[ScreenSaverEventBase] = (EventSwapPtr) SScreenSaverNotifyEvent;
     }
diff --git a/Xext/security.c b/Xext/security.c
index 2cd0e17..af8d205 100644
--- a/Xext/security.c
+++ b/Xext/security.c
@@ -1105,17 +1105,17 @@ SecurityExtensionInit(INITARGS)
     int ret = TRUE;
 
     SecurityAuthorizationResType =
-	CreateNewResourceType(SecurityDeleteAuthorization);
+	CreateNewResourceType(SecurityDeleteAuthorization,
+			      "SecurityAuthorization");
 
-    RTEventClient = CreateNewResourceType(
-				SecurityDeleteAuthorizationEventClient);
+    RTEventClient =
+	CreateNewResourceType(SecurityDeleteAuthorizationEventClient,
+			      "SecurityEventClient");
 
     if (!SecurityAuthorizationResType || !RTEventClient)
 	return;
 
     RTEventClient |= RC_NEVERRETAIN;
-    RegisterResourceName(SecurityAuthorizationResType, "SecurityAuthorization");
-    RegisterResourceName(RTEventClient, "SecurityEventClient");
 
     /* Allocate the private storage */
     if (!dixRequestPrivate(stateKey, sizeof(SecurityStateRec)))
diff --git a/Xext/shape.c b/Xext/shape.c
index 247f21b..cb4126b 100644
--- a/Xext/shape.c
+++ b/Xext/shape.c
@@ -40,7 +40,6 @@ in this Software without prior written authorization from The Open Group.
 #include "extnsionst.h"
 #include "dixstruct.h"
 #include "resource.h"
-#include "registry.h"
 #include "opaque.h"
 #include <X11/extensions/shapeproto.h>
 #include "regionstr.h"
@@ -128,15 +127,13 @@ ShapeExtensionInit(void)
 {
     ExtensionEntry *extEntry;
 
-    ClientType = CreateNewResourceType(ShapeFreeClient);
-    ShapeEventType = CreateNewResourceType(ShapeFreeEvents);
+    ClientType = CreateNewResourceType(ShapeFreeClient, "ShapeClient");
+    ShapeEventType = CreateNewResourceType(ShapeFreeEvents, "ShapeEvent");
     if (ClientType && ShapeEventType &&
 	(extEntry = AddExtension(SHAPENAME, ShapeNumberEvents, 0,
 				 ProcShapeDispatch, SProcShapeDispatch,
 				 NULL, StandardMinorOpcode)))
     {
-	RegisterResourceName(ClientType, "ShapeClient");
-	RegisterResourceName(ShapeEventType, "ShapeEvent");
 	ShapeEventBase = extEntry->eventBase;
 	EventSwapVector[ShapeEventBase] = (EventSwapPtr) SShapeNotifyEvent;
     }
diff --git a/Xext/shm.c b/Xext/shm.c
index 589155d..ab58c27 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -52,7 +52,6 @@ in this Software without prior written authorization from The Open Group.
 #include "servermd.h"
 #include "shmint.h"
 #include "xace.h"
-#include "registry.h"
 #include <X11/extensions/shmproto.h>
 #include <X11/Xfuncproto.h>
 #include "protocol-versions.h"
@@ -278,13 +277,12 @@ ShmExtensionInit(INITARGS)
 	    screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap;
 	}
     }
-    ShmSegType = CreateNewResourceType(ShmDetachSegment);
+    ShmSegType = CreateNewResourceType(ShmDetachSegment, "ShmSeg");
     if (ShmSegType &&
 	(extEntry = AddExtension(SHMNAME, ShmNumberEvents, ShmNumberErrors,
 				 ProcShmDispatch, SProcShmDispatch,
 				 ShmResetProc, StandardMinorOpcode)))
     {
-	RegisterResourceName(ShmSegType, "ShmSeg");
 	ShmReqCode = (unsigned char)extEntry->base;
 	ShmCompletionCode = extEntry->eventBase;
 	BadShmSegCode = extEntry->errorBase;
diff --git a/Xext/sleepuntil.c b/Xext/sleepuntil.c
index 6b5964e..075f428 100644
--- a/Xext/sleepuntil.c
+++ b/Xext/sleepuntil.c
@@ -39,7 +39,6 @@ in this Software without prior written authorization from The Open Group.
 #include "dixstruct.h"
 #include "pixmapstr.h"
 #include "scrnintstr.h"
-#include "registry.h"
 
 typedef struct _Sertafied {
     struct _Sertafied	*next;
@@ -88,10 +87,10 @@ ClientSleepUntil (ClientPtr client,
 
     if (SertafiedGeneration != serverGeneration)
     {
-	SertafiedResType = CreateNewResourceType (SertafiedDelete);
+	SertafiedResType = CreateNewResourceType (SertafiedDelete,
+						  "ClientSleep");
 	if (!SertafiedResType)
 	    return FALSE;
-	RegisterResourceName(SertafiedResType, "ClientSleep");
 	SertafiedGeneration = serverGeneration;
 	BlockHandlerRegistered = FALSE;
     }
diff --git a/Xext/sync.c b/Xext/sync.c
index b1c8cb8..e479d5f 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -64,7 +64,6 @@ PERFORMANCE OF THIS SOFTWARE.
 #include "extnsionst.h"
 #include "dixstruct.h"
 #include "resource.h"
-#include "registry.h"
 #include "opaque.h"
 #include <X11/extensions/syncproto.h>
 #include "syncsrv.h"
@@ -874,12 +873,11 @@ SyncCreateSystemCounter(
      */
     if (RTCounter == 0)
     {
-	RTCounter = CreateNewResourceType(FreeCounter);
+	RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter");
 	if (RTCounter == 0)
 	{
 	    return NULL;
 	}
-	RegisterResourceName(RTCounter, "SyncCounter");
     }
 
     pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial);
@@ -2112,11 +2110,11 @@ SyncExtensionInit(void)
 
     if (RTCounter == 0)
     {
-	RTCounter = CreateNewResourceType(FreeCounter);
+	RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter");
     }
-    RTAlarm = CreateNewResourceType(FreeAlarm);
-    RTAwait = CreateNewResourceType(FreeAwait);
-    RTAlarmClient = CreateNewResourceType(FreeAlarmClient);
+    RTAlarm = CreateNewResourceType(FreeAlarm, "SyncAlarm");
+    RTAwait = CreateNewResourceType(FreeAwait, "SyncAwait");
+    RTAlarmClient = CreateNewResourceType(FreeAlarmClient, "SyncAlarmClient");
 
     if (RTCounter == 0 || RTAwait == 0 || RTAlarm == 0 ||
 	RTAlarmClient == 0 ||
@@ -2131,10 +2129,6 @@ SyncExtensionInit(void)
 	return;
     }
 
-    RegisterResourceName(RTCounter, "SyncCounter");
-    RegisterResourceName(RTAlarm, "SyncAlarm");
-    RegisterResourceName(RTAwait, "SyncAwait");
-    RegisterResourceName(RTAlarmClient, "SyncAlarmClient");
     RTAwait |= RC_NEVERRETAIN;
     RTAlarmClient |= RC_NEVERRETAIN;
     SyncEventBase = extEntry->eventBase;
diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c
index 4a38b82..1ce27a9 100644
--- a/Xext/xvdisp.c
+++ b/Xext/xvdisp.c
@@ -36,7 +36,6 @@ SOFTWARE.
 #include "gcstruct.h"
 #include "dixstruct.h"
 #include "resource.h"
-#include "registry.h"
 #include "opaque.h"
 
 #include <X11/extensions/Xv.h>
@@ -1864,11 +1863,9 @@ void XineramifyXv(void)
    XvAdaptorPtr MatchingAdaptors[MAXSCREENS];
    int i, j, k, l;
 
-   XvXRTPort = CreateNewResourceType(XineramaDeleteResource);
+   XvXRTPort = CreateNewResourceType(XineramaDeleteResource, "XvXRTPort");
 
    if (!xvsp0 || !XvXRTPort) return;
-
-   RegisterResourceName(XvXRTPort, "XvXRTPort");
    
    for(i = 0; i < xvsp0->nAdaptors; i++) {
       refAdapt = xvsp0->pAdaptors + i;
diff --git a/Xext/xvmain.c b/Xext/xvmain.c
index c33c209..05a6890 100644
--- a/Xext/xvmain.c
+++ b/Xext/xvmain.c
@@ -90,7 +90,6 @@ SOFTWARE.
 #include "extnsionst.h"
 #include "dixstruct.h"
 #include "resource.h"
-#include "registry.h"
 #include "opaque.h"
 #include "input.h"
 
@@ -209,47 +208,45 @@ CreateResourceTypes(void)
 
   XvResourceGeneration = serverGeneration;
 
-  if (!(XvRTPort = CreateNewResourceType(XvdiDestroyPort)))
+  if (!(XvRTPort = CreateNewResourceType(XvdiDestroyPort, "XvRTPort")))
     {
       ErrorF("CreateResourceTypes: failed to allocate port resource.\n");
       return FALSE;
     }
-  RegisterResourceName(XvRTPort, "XvRTPort");
 
-  if (!(XvRTGrab = CreateNewResourceType(XvdiDestroyGrab)))
+  if (!(XvRTGrab = CreateNewResourceType(XvdiDestroyGrab, "XvRTGrab")))
     {
       ErrorF("CreateResourceTypes: failed to allocate grab resource.\n");
       return FALSE;
     }
-  RegisterResourceName(XvRTGrab, "XvRTGrab");
 
-  if (!(XvRTEncoding = CreateNewResourceType(XvdiDestroyEncoding)))
+  if (!(XvRTEncoding = CreateNewResourceType(XvdiDestroyEncoding,
+					     "XvRTEncoding")))
     {
       ErrorF("CreateResourceTypes: failed to allocate encoding resource.\n");
       return FALSE;
     }
-  RegisterResourceName(XvRTEncoding, "XvRTEncoding");
 
-  if (!(XvRTVideoNotify = CreateNewResourceType(XvdiDestroyVideoNotify)))
+  if (!(XvRTVideoNotify = CreateNewResourceType(XvdiDestroyVideoNotify,
+						"XvRTVideoNotify")))
     {
       ErrorF("CreateResourceTypes: failed to allocate video notify resource.\n");
       return FALSE;
     }
-  RegisterResourceName(XvRTVideoNotify, "XvRTVideoNotify");
 
-  if (!(XvRTVideoNotifyList = CreateNewResourceType(XvdiDestroyVideoNotifyList)))
+  if (!(XvRTVideoNotifyList = CreateNewResourceType(XvdiDestroyVideoNotifyList,
+						    "XvRTVideoNotifyList")))
     {
       ErrorF("CreateResourceTypes: failed to allocate video notify list resource.\n");
       return FALSE;
     }
-  RegisterResourceName(XvRTVideoNotifyList, "XvRTVideoNotifyList");
 
-  if (!(XvRTPortNotify = CreateNewResourceType(XvdiDestroyPortNotify)))
+  if (!(XvRTPortNotify = CreateNewResourceType(XvdiDestroyPortNotify,
+					       "XvRTPortNotify")))
     {
       ErrorF("CreateResourceTypes: failed to allocate port notify resource.\n");
       return FALSE;
     }
-  RegisterResourceName(XvRTPortNotify, "XvRTPortNotify");
 
   return TRUE;
 
diff --git a/Xext/xvmc.c b/Xext/xvmc.c
index 0a233b1..c85f85e 100644
--- a/Xext/xvmc.c
+++ b/Xext/xvmc.c
@@ -11,7 +11,6 @@
 #include "os.h"
 #include "dixstruct.h"
 #include "resource.h"
-#include "registry.h"
 #include "scrnintstr.h"
 #include "extnsionst.h"
 #include "servermd.h"
@@ -675,17 +674,17 @@ XvMCExtensionInit(void)
    if(XvMCScreenKey == NULL) /* nobody supports it */
 	return; 
 
-   if(!(XvMCRTContext = CreateNewResourceType(XvMCDestroyContextRes)))
+   if(!(XvMCRTContext = CreateNewResourceType(XvMCDestroyContextRes,
+					      "XvMCRTContext")))
 	return;
-   RegisterResourceName(XvMCRTContext, "XvMCRTContext");
 
-   if(!(XvMCRTSurface = CreateNewResourceType(XvMCDestroySurfaceRes)))
+   if(!(XvMCRTSurface = CreateNewResourceType(XvMCDestroySurfaceRes,
+					      "XvMCRTSurface")))
 	return;
-   RegisterResourceName(XvMCRTSurface, "XvMCRTSurface");
 
-   if(!(XvMCRTSubpicture = CreateNewResourceType(XvMCDestroySubpictureRes)))
+   if(!(XvMCRTSubpicture = CreateNewResourceType(XvMCDestroySubpictureRes,
+						 "XvMCRTSubpicture")))
 	return;
-   RegisterResourceName(XvMCRTSubpicture, "XvMCRTSubpicture");
 
    extEntry = AddExtension(XvMCName, XvMCNumEvents, XvMCNumErrors, 
                               ProcXvMCDispatch, SProcXvMCDispatch,
diff --git a/Xi/extinit.c b/Xi/extinit.c
index 372f77f..b7910cd 100644
--- a/Xi/extinit.c
+++ b/Xi/extinit.c
@@ -70,7 +70,6 @@ SOFTWARE.
 #include "extinit.h"
 #include "exglobals.h"
 #include "swaprep.h"
-#include "registry.h"
 #include "privates.h"
 #include "protocol-versions.h"
 
@@ -1269,10 +1268,10 @@ XInputExtensionInit(void)
 	IEventBase = extEntry->eventBase;
 	XIVersion = thisversion;
 	MakeDeviceTypeAtoms();
-	RT_INPUTCLIENT = CreateNewResourceType((DeleteType) InputClientGone);
+	RT_INPUTCLIENT = CreateNewResourceType((DeleteType) InputClientGone,
+					       "INPUTCLIENT");
 	if (!RT_INPUTCLIENT)
 	    FatalError("Failed to add resource type for XI.\n");
-	RegisterResourceName(RT_INPUTCLIENT, "INPUTCLIENT");
 	FixExtensionEvents(extEntry);
 	ReplySwapVector[IReqCode] = (ReplySwapPtr) SReplyIDispatch;
 	EventSwapVector[DeviceValuator] = SEventIDispatch;
diff --git a/composite/compext.c b/composite/compext.c
index c63bd02..6833af7 100644
--- a/composite/compext.c
+++ b/composite/compext.c
@@ -53,7 +53,6 @@
 
 #include "compint.h"
 #include "xace.h"
-#include "registry.h"
 #include "protocol-versions.h"
 
 static CARD8	CompositeReqCode;
@@ -553,22 +552,20 @@ CompositeExtensionInit (void)
 	return;
 #endif
 
-    CompositeClientWindowType = CreateNewResourceType (FreeCompositeClientWindow);
+    CompositeClientWindowType = CreateNewResourceType
+	(FreeCompositeClientWindow, "CompositeClientWindow");
     if (!CompositeClientWindowType)
 	return;
-    RegisterResourceName(CompositeClientWindowType, "CompositeClientWindow");
 
-    CompositeClientSubwindowsType = CreateNewResourceType (FreeCompositeClientSubwindows);
+    CompositeClientSubwindowsType = CreateNewResourceType
+	(FreeCompositeClientSubwindows, "CompositeClientSubwindows");
     if (!CompositeClientSubwindowsType)
 	return;
-    RegisterResourceName(CompositeClientSubwindowsType,
-			 "CompositeClientSubwindows");
 
-    CompositeClientOverlayType = CreateNewResourceType (FreeCompositeClientOverlay);
+    CompositeClientOverlayType = CreateNewResourceType
+	(FreeCompositeClientOverlay, "CompositeClientOverlay");
     if (!CompositeClientOverlayType)
 	return;
-    RegisterResourceName(CompositeClientOverlayType,
-			 "CompositeClientOverlay");
 
     if (!dixRequestPrivate(CompositeClientPrivateKey,
 			   sizeof(CompositeClientRec)))
diff --git a/damageext/damageext.c b/damageext/damageext.c
index 044e8ef..462796e 100644
--- a/damageext/damageext.c
+++ b/damageext/damageext.c
@@ -24,7 +24,6 @@
 #include <dix-config.h>
 #endif
 
-#include "registry.h"
 #include "damageextint.h"
 #include "protocol-versions.h"
 
@@ -498,15 +497,13 @@ DamageExtensionInit(void)
     for (s = 0; s < screenInfo.numScreens; s++)
 	DamageSetup (screenInfo.screens[s]);
 
-    DamageExtType = CreateNewResourceType (FreeDamageExt);
+    DamageExtType = CreateNewResourceType (FreeDamageExt, "DamageExt");
     if (!DamageExtType)
 	return;
-    RegisterResourceName(DamageExtType, "DamageExt");
 
-    DamageExtWinType = CreateNewResourceType (FreeDamageExtWin);
+    DamageExtWinType = CreateNewResourceType (FreeDamageExtWin, "DamageExtWin");
     if (!DamageExtWinType)
 	return;
-    RegisterResourceName(DamageExtWinType, "DamageExtWin");
 
     if (!dixRequestPrivate(DamageClientPrivateKey, sizeof (DamageClientRec)))
 	return;
diff --git a/dbe/dbe.c b/dbe/dbe.c
index 78ce912..36935a7 100644
--- a/dbe/dbe.c
+++ b/dbe/dbe.c
@@ -54,7 +54,6 @@
 #include "dbestruct.h"
 #include "midbe.h"
 #include "xace.h"
-#include "registry.h"
 
 /* GLOBALS */
 
@@ -1574,14 +1573,11 @@ DbeExtensionInit(void)
 
     /* Create the resource types. */
     dbeDrawableResType =
-        CreateNewResourceType(DbeDrawableDelete);
+        CreateNewResourceType(DbeDrawableDelete, "dbeDrawable");
     dbeWindowPrivResType =
-        CreateNewResourceType(DbeWindowPrivDelete);
+        CreateNewResourceType(DbeWindowPrivDelete, "dbeWindow");
     if (!dbeDrawableResType || !dbeWindowPrivResType)
 	return;
-    RegisterResourceName(dbeDrawableResType, "dbeDrawable");
-    RegisterResourceName(dbeWindowPrivResType, "dbeWindow");
-
     dbeDrawableResType |= RC_DRAWABLE;
 
     if (!dixRegisterPrivateOffset(dbeDrawableResType,
diff --git a/dix/resource.c b/dix/resource.c
index d3641df..e7c078b 100644
--- a/dix/resource.c
+++ b/dix/resource.c
@@ -147,10 +147,10 @@ Equipment Corporation.
 #endif
 #include "xace.h"
 #include <assert.h>
+#include "registry.h"
 
 #ifdef XSERVER_DTRACE
 #include <sys/types.h>
-#include "registry.h"
 typedef const char *string;
 #include "Xserver-dtrace.h"
 
@@ -203,7 +203,7 @@ CallResourceStateCallback(ResourceState state, ResourceRec *res)
 }
 
 RESTYPE
-CreateNewResourceType(DeleteType deleteFunc)
+CreateNewResourceType(DeleteType deleteFunc, char *name)
 {
     RESTYPE next = lastResourceType + 1;
     DeleteType *funcs;
@@ -220,6 +220,10 @@ CreateNewResourceType(DeleteType deleteFunc)
     lastResourceType = next;
     DeleteFuncs = funcs;
     DeleteFuncs[next] = deleteFunc;
+
+    /* Called even if name is NULL, to remove any previous entry */
+    RegisterResourceName(next, name);
+
     return next;
 }
 
diff --git a/glx/glxext.c b/glx/glxext.c
index 546d968..751ea72 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -343,17 +343,15 @@ void GlxExtensionInit(void)
     __GLXprovider *p;
     Bool glx_provided = False;
 
-    __glXContextRes = CreateNewResourceType((DeleteType)ContextGone);
-    __glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone);
-    __glXSwapBarrierRes = CreateNewResourceType((DeleteType)SwapBarrierGone);
-
+    __glXContextRes = CreateNewResourceType((DeleteType)ContextGone,
+					    "GLXContext");
+    __glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone,
+					     "GLXDrawable");
+    __glXSwapBarrierRes = CreateNewResourceType((DeleteType)SwapBarrierGone,
+						"GLXSwapBarrier");
     if (!__glXContextRes || !__glXDrawableRes || !__glXSwapBarrierRes)
 	return;
 
-    RegisterResourceName(__glXContextRes, "GLXContext");
-    RegisterResourceName(__glXDrawableRes, "GLXDrawable");
-    RegisterResourceName(__glXSwapBarrierRes, "GLXSwapBarrier");
-
     if (!dixRequestPrivate(glxClientPrivateKey, sizeof (__GLXclientState)))
 	return;
     if (!AddCallback (&ClientStateCallback, glxClientCallback, 0))
diff --git a/hw/dmx/glxProxy/glxext.c b/hw/dmx/glxProxy/glxext.c
index c00ae6e..6cd8bb4 100644
--- a/hw/dmx/glxProxy/glxext.c
+++ b/hw/dmx/glxProxy/glxext.c
@@ -44,7 +44,6 @@
 #include "glxvisuals.h"
 #include "micmap.h"
 #include "glxswap.h"
-#include "registry.h"
 
 /*
 ** Stubs to satisfy miinitext.c references.
@@ -294,22 +293,21 @@ void GlxExtensionInit(void)
        return;
     }
     
-    __glXContextRes = CreateNewResourceType((DeleteType)ContextGone);
-    __glXClientRes = CreateNewResourceType((DeleteType)ClientGone);
-    __glXPixmapRes = CreateNewResourceType((DeleteType)PixmapGone);
-    __glXWindowRes = CreateNewResourceType((DeleteType)WindowGone);
-    __glXPbufferRes = CreateNewResourceType((DeleteType)PbufferGone);
+    __glXContextRes = CreateNewResourceType((DeleteType)ContextGone,
+					    "GLXContext");
+    __glXClientRes = CreateNewResourceType((DeleteType)ClientGone,
+					   "GLXClient");
+    __glXPixmapRes = CreateNewResourceType((DeleteType)PixmapGone,
+					   "GLXPixmap");
+    __glXWindowRes = CreateNewResourceType((DeleteType)WindowGone,
+					   "GLXWindow");
+    __glXPbufferRes = CreateNewResourceType((DeleteType)PbufferGone,
+					    "GLXPbuffer");
 
     if (!__glXContextRes || !__glXClientRes || !__glXPixmapRes ||
 	!__glXWindowRes || !__glXPbufferRes)
 	return;
 
-    RegisterResourceName(__glXContextRes, "GLXContext");
-    RegisterResourceName(__glXClientRes, "GLXClient");
-    RegisterResourceName(__glXPixmapRes, "GLXPixmap");
-    RegisterResourceName(__glXWindowRes, "GLXWindow");
-    RegisterResourceName(__glXPbufferRes, "GLXPbuffer");
-
     /*
     ** Add extension to server extensions.
     */
diff --git a/hw/kdrive/ephyr/ephyrdriext.c b/hw/kdrive/ephyr/ephyrdriext.c
index a2839ea..f741d74 100644
--- a/hw/kdrive/ephyr/ephyrdriext.c
+++ b/hw/kdrive/ephyr/ephyrdriext.c
@@ -43,7 +43,6 @@
 #include "privates.h"
 #include "dixstruct.h"
 #include "extnsionst.h"
-#include "registry.h"
 #include "colormapst.h"
 #include "cursorstr.h"
 #include "scrnintstr.h"
@@ -141,12 +140,11 @@ ephyrDRIExtensionInit (ScreenPtr a_screen)
     EPHYR_LOG ("host X does have XShape extension\n") ;
 
 #ifdef XF86DRI_EVENTS
-    EventType = CreateNewResourceType (XF86DRIFreeEvents);
+    EventType = CreateNewResourceType (XF86DRIFreeEvents, "DRIEvents");
     if (!EventType) {
         EPHYR_LOG_ERROR ("failed to register DRI event resource type\n") ;
         goto out ;
     }
-    RegisterResourceName(EventType, "DRIEvents");
 #endif
 
     if ((extEntry = AddExtension(XF86DRINAME,
diff --git a/hw/xfree86/dixmods/extmod/xf86vmode.c b/hw/xfree86/dixmods/extmod/xf86vmode.c
index c35a83f..a304a42 100644
--- a/hw/xfree86/dixmods/extmod/xf86vmode.c
+++ b/hw/xfree86/dixmods/extmod/xf86vmode.c
@@ -39,7 +39,6 @@ from Kaleb S. KEITHLEY
 #include "misc.h"
 #include "dixstruct.h"
 #include "extnsionst.h"
-#include "registry.h"
 #include "scrnintstr.h"
 #include "servermd.h"
 #include <X11/extensions/xf86vmproto.h>
@@ -171,7 +170,7 @@ XFree86VidModeExtensionInit(void)
     DEBUG_P("XFree86VidModeExtensionInit");
 
 #ifdef XF86VIDMODE_EVENTS
-    EventType = CreateNewResourceType(XF86VidModeFreeEvents);
+    EventType = CreateNewResourceType(XF86VidModeFreeEvents, "VidModeEvent");
 #endif
 
     for(i = 0; i < screenInfo.numScreens; i++) {
@@ -202,7 +201,6 @@ XFree86VidModeExtensionInit(void)
 #endif
 	VidModeErrorBase = extEntry->errorBase;
 #ifdef XF86VIDMODE_EVENTS
-	RegisterResourceName(EventType, "VidModeEvent");
 	XF86VidModeEventBase = extEntry->eventBase;
 	EventSwapVector[XF86VidModeEventBase] = (EventSwapPtr)SXF86VidModeNotifyEvent;
 #endif
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index be0604e..836967c 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -51,7 +51,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "misc.h"
 #include "dixstruct.h"
 #include "extnsionst.h"
-#include "registry.h"
 #include "colormapst.h"
 #include "cursorstr.h"
 #include "scrnintstr.h"
@@ -790,13 +789,13 @@ DRIExtensionInit(void)
 	return FALSE;
     }
 
-    DRIDrawablePrivResType = CreateNewResourceType(DRIDrawablePrivDelete);
-    DRIContextPrivResType = CreateNewResourceType(DRIContextPrivDelete);
+    DRIDrawablePrivResType = CreateNewResourceType(DRIDrawablePrivDelete,
+						   "DRIDrawable");
+    DRIContextPrivResType = CreateNewResourceType(DRIContextPrivDelete,
+						  "DRIContext");
 
     if (!DRIDrawablePrivResType || !DRIContextPrivResType)
 	return FALSE;
-    RegisterResourceName(DRIDrawablePrivResType, "DRIDrawable");
-    RegisterResourceName(DRIContextPrivResType, "DRIContext");
 
     RegisterBlockAndWakeupHandlers(DRIBlockHandler, DRIWakeupHandler, NULL);
 
diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c
index 2da9767..7800399 100644
--- a/hw/xfree86/dri/xf86dri.c
+++ b/hw/xfree86/dri/xf86dri.c
@@ -47,7 +47,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "misc.h"
 #include "dixstruct.h"
 #include "extnsionst.h"
-#include "registry.h"
 #include "colormapst.h"
 #include "cursorstr.h"
 #include "scrnintstr.h"
@@ -95,7 +94,7 @@ XFree86DRIExtensionInit(void)
     ExtensionEntry* extEntry;
 
 #ifdef XF86DRI_EVENTS
-    EventType = CreateNewResourceType(XF86DRIFreeEvents);
+    EventType = CreateNewResourceType(XF86DRIFreeEvents, "DRIEvent");
 #endif
 
     if (
@@ -112,9 +111,6 @@ XFree86DRIExtensionInit(void)
 				 StandardMinorOpcode))) {
 	DRIReqCode = (unsigned char)extEntry->base;
 	DRIErrorBase = extEntry->errorBase;
-#ifdef XF86DRI_EVENTS
-	RegisterResourceName(EventType, "DRIEvent");
-#endif
     }
 }
 
diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c
index 112e76c..7d6064a 100644
--- a/hw/xfree86/dri2/dri2ext.c
+++ b/hw/xfree86/dri2/dri2ext.c
@@ -42,7 +42,6 @@
 #include "scrnintstr.h"
 #include "pixmapstr.h"
 #include "extnsionst.h"
-#include "registry.h"
 #include "xf86drm.h"
 #include "xfixes.h"
 #include "dri2.h"
@@ -417,13 +416,11 @@ static int DRI2DrawableGone(pointer p, XID id)
 static void
 DRI2ExtensionInit(void)
 {
-    dri2DrawableRes = CreateNewResourceType(DRI2DrawableGone);
+    dri2DrawableRes = CreateNewResourceType(DRI2DrawableGone, "DRI2Drawable");
 
     if (!dri2DrawableRes)
 	return;
 
-    RegisterResourceName(dri2DrawableRes, "DRI2Drawable");
-
     dri2Extension = AddExtension(DRI2_NAME,
 				 DRI2NumberEvents,
 				 DRI2NumberErrors,
diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c
index 26cf5d2..15c86de 100644
--- a/hw/xquartz/applewm.c
+++ b/hw/xquartz/applewm.c
@@ -37,7 +37,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "dixstruct.h"
 #include "globals.h"
 #include "extnsionst.h"
-#include "registry.h"
 #include "colormapst.h"
 #include "cursorstr.h"
 #include "scrnintstr.h"
@@ -112,8 +111,8 @@ AppleWMExtensionInit(
 {
     ExtensionEntry* extEntry;
 
-    ClientType = CreateNewResourceType(WMFreeClient);
-    EventType = CreateNewResourceType(WMFreeEvents);
+    ClientType = CreateNewResourceType(WMFreeClient, "WMClient");
+    EventType = CreateNewResourceType(WMFreeEvents, "WMEvent");
     eventResource = FakeClientID(0);
 
     if (ClientType && EventType &&
@@ -130,8 +129,6 @@ AppleWMExtensionInit(
         WMEventBase = extEntry->eventBase;
         EventSwapVector[WMEventBase] = (EventSwapPtr) SNotifyEvent;
         appleWMProcs = procsPtr;
-	RegisterResourceName(ClientType, "WMClient");
-	RegisterResourceName(EventType, "WMEvent");
     }
 }
 
diff --git a/hw/xquartz/xpr/dri.c b/hw/xquartz/xpr/dri.c
index b59f5d3..0a58b29 100644
--- a/hw/xquartz/xpr/dri.c
+++ b/hw/xquartz/xpr/dri.c
@@ -55,7 +55,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "misc.h"
 #include "dixstruct.h"
 #include "extnsionst.h"
-#include "registry.h"
 #include "colormapst.h"
 #include "cursorstr.h"
 #include "scrnintstr.h"
@@ -278,10 +277,8 @@ DRICloseScreen(ScreenPtr pScreen)
 Bool
 DRIExtensionInit(void)
 {
-    DRIDrawablePrivResType = CreateNewResourceType(DRIDrawablePrivDelete);
-
-    if (DRIDrawablePrivResType != 0)
-	RegisterResourceName(DRIDrawablePrivResType, "DRIDrawable");
+    DRIDrawablePrivResType = CreateNewResourceType(DRIDrawablePrivDelete,
+						   "DRIDrawable");
 
     return (DRIDrawablePrivResType != 0);
 }
diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
index 2383c59..3436824 100755
--- a/hw/xwin/winwindowswm.c
+++ b/hw/xwin/winwindowswm.c
@@ -34,7 +34,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "misc.h"
 #include "dixstruct.h"
 #include "extnsionst.h"
-#include "registry.h"
 #include "colormapst.h"
 #include "cursorstr.h"
 #include "scrnintstr.h"
@@ -86,8 +85,8 @@ winWindowsWMExtensionInit ()
 {
   ExtensionEntry* extEntry;
 
-  ClientType = CreateNewResourceType(WMFreeClient);
-  eventResourceType = CreateNewResourceType(WMFreeEvents);
+  ClientType = CreateNewResourceType(WMFreeClient, "WMClient");
+  eventResourceType = CreateNewResourceType(WMFreeEvents, "WMEvent");
   eventResource = FakeClientID(0);
 
   if (ClientType && eventResourceType &&
@@ -103,8 +102,6 @@ winWindowsWMExtensionInit ()
       WMErrorBase = extEntry->errorBase;
       WMEventBase = extEntry->eventBase;
       EventSwapVector[WMEventBase] = (EventSwapPtr) SNotifyEvent;
-      RegisterResourceName(ClientType, "WMClient");
-      RegisterResourceName(eventResourceType, "WMEvent");
     }
 }
 
diff --git a/include/resource.h b/include/resource.h
index 8ed4e56..7948af5 100644
--- a/include/resource.h
+++ b/include/resource.h
@@ -155,7 +155,7 @@ typedef Bool (*FindComplexResType)(
     pointer /*cdata*/);
 
 extern _X_EXPORT RESTYPE CreateNewResourceType(
-    DeleteType /*deleteFunc*/);
+    DeleteType /*deleteFunc*/, char * /*name*/);
 
 extern _X_EXPORT RESTYPE CreateNewResourceClass(void);
 
diff --git a/mi/miarc.c b/mi/miarc.c
index b4b684b..5fd1a67 100644
--- a/mi/miarc.c
+++ b/mi/miarc.c
@@ -62,7 +62,6 @@ SOFTWARE.
 #include "mifpoly.h"
 #include "mi.h"
 #include "mifillarc.h"
-#include "registry.h"
 #include <X11/Xfuncproto.h>
 
 static double miDsin(double a);
@@ -867,8 +866,7 @@ miComputeWideEllipse(
 	}
 	if (!cacheType)
 	{
-	    cacheType = CreateNewResourceType(miFreeArcCache);
-	    RegisterResourceName(cacheType, "miArcCache");
+	    cacheType = CreateNewResourceType(miFreeArcCache, "miArcCache");
 	    (void) AddResource(FakeClientID(0), cacheType, NULL);
 	}
     } else {
diff --git a/randr/randr.c b/randr/randr.c
index 7d59a68..b63a7f2 100644
--- a/randr/randr.c
+++ b/randr/randr.c
@@ -29,8 +29,6 @@
 #include <dix-config.h>
 #endif
 
-#include "registry.h"
-
 #include "randrstr.h"
 
 /* From render.h */
@@ -338,14 +336,12 @@ RRExtensionInit (void)
     if (!AddCallback (&ClientStateCallback, RRClientCallback, 0))
 	return;
 
-    RRClientType = CreateNewResourceType(RRFreeClient);
+    RRClientType = CreateNewResourceType(RRFreeClient, "RandRClient");
     if (!RRClientType)
 	return;
-    RegisterResourceName(RRClientType, "RandRClient");
-    RREventType = CreateNewResourceType(RRFreeEvents);
+    RREventType = CreateNewResourceType(RRFreeEvents, "RandREvent");
     if (!RREventType)
 	return;
-    RegisterResourceName(RREventType, "RandREvent");
     extEntry = AddExtension (RANDR_NAME, RRNumberEvents, RRNumberErrors,
 			     ProcRRDispatch, SProcRRDispatch,
 			     NULL, StandardMinorOpcode);
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 0e14b36..a9eb2d2 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -22,7 +22,6 @@
 
 #include "randrstr.h"
 #include "swaprep.h"
-#include "registry.h"
 
 RESTYPE	RRCrtcType;
 
@@ -633,10 +632,9 @@ RRCrtcTransformSet (RRCrtcPtr		crtc,
 Bool
 RRCrtcInit (void)
 {
-    RRCrtcType = CreateNewResourceType (RRCrtcDestroyResource);
+    RRCrtcType = CreateNewResourceType (RRCrtcDestroyResource, "CRTC");
     if (!RRCrtcType)
 	return FALSE;
-    RegisterResourceName (RRCrtcType, "CRTC");
     return TRUE;
 }
 
diff --git a/randr/rrmode.c b/randr/rrmode.c
index 9642dda..1396193 100644
--- a/randr/rrmode.c
+++ b/randr/rrmode.c
@@ -21,7 +21,6 @@
  */
 
 #include "randrstr.h"
-#include "registry.h"
 
 RESTYPE	RRModeType;
 
@@ -266,10 +265,9 @@ RRModeInit (void)
 {
     assert (num_modes == 0);
     assert (modes == NULL);
-    RRModeType = CreateNewResourceType (RRModeDestroyResource);
+    RRModeType = CreateNewResourceType (RRModeDestroyResource, "MODE");
     if (!RRModeType)
 	return FALSE;
-    RegisterResourceName (RRModeType, "MODE");
     return TRUE;
 }
 
diff --git a/randr/rroutput.c b/randr/rroutput.c
index 2eff8c1..3a1b8bb 100644
--- a/randr/rroutput.c
+++ b/randr/rroutput.c
@@ -22,7 +22,6 @@
  */
 
 #include "randrstr.h"
-#include "registry.h"
 
 RESTYPE	RROutputType;
 
@@ -422,10 +421,9 @@ RROutputDestroyResource (pointer value, XID pid)
 Bool
 RROutputInit (void)
 {
-    RROutputType = CreateNewResourceType (RROutputDestroyResource);
+    RROutputType = CreateNewResourceType (RROutputDestroyResource, "OUTPUT");
     if (!RROutputType)
 	return FALSE;
-    RegisterResourceName (RROutputType, "OUTPUT");
     return TRUE;
 }
 
diff --git a/record/record.c b/record/record.c
index 649f4b2..242544f 100644
--- a/record/record.c
+++ b/record/record.c
@@ -42,7 +42,6 @@ and Jim Haggerty of Metheus.
 #include "set.h"
 #include "swaprep.h"
 #include "inputstr.h"
-#include "registry.h"
 
 #include <stdio.h>
 #include <assert.h>
@@ -2876,10 +2875,9 @@ RecordExtensionInit(void)
 #if 0
     ExtensionEntry *extentry;
 
-    RTContext = CreateNewResourceType(RecordDeleteContext);
+    RTContext = CreateNewResourceType(RecordDeleteContext, "RecordContext");
     if (!RTContext)
 	return;
-    RegisterResourceName(RTContext, "RecordContext");
 
     ppAllContexts = NULL;
     numContexts = numEnabledContexts = numEnabledRCAPs = 0;
diff --git a/render/picture.c b/render/picture.c
index e1a2972..18bfea2 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -41,7 +41,6 @@
 #include "servermd.h"
 #include "picturestr.h"
 #include "xace.h"
-#include "registry.h"
 
 static int PictureScreenPrivateKeyIndex;
 DevPrivateKey PictureScreenPrivateKey = &PictureScreenPrivateKeyIndex;
@@ -618,19 +617,16 @@ PictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
     
     if (PictureGeneration != serverGeneration)
     {
-	PictureType = CreateNewResourceType (FreePicture);
+	PictureType = CreateNewResourceType (FreePicture, "PICTURE");
 	if (!PictureType)
 	    return FALSE;
-	PictFormatType = CreateNewResourceType (FreePictFormat);
+	PictFormatType = CreateNewResourceType (FreePictFormat, "PICTFORMAT");
 	if (!PictFormatType)
 	    return FALSE;
-	GlyphSetType = CreateNewResourceType (FreeGlyphSet);
+	GlyphSetType = CreateNewResourceType (FreeGlyphSet, "GLYPHSET");
 	if (!GlyphSetType)
 	    return FALSE;
 	PictureGeneration = serverGeneration;
-	RegisterResourceName (PictureType, "PICTURE");
-	RegisterResourceName (PictFormatType, "PICTFORMAT");
-	RegisterResourceName (GlyphSetType, "GLYPHSET");
     }
     if (!formats)
     {
diff --git a/render/render.c b/render/render.c
index 53bb555..77e5e03 100644
--- a/render/render.c
+++ b/render/render.c
@@ -46,7 +46,6 @@
 #include "cursorstr.h"
 #include "xace.h"
 #include "protocol-versions.h"
-#include "registry.h"
 
 #if HAVE_STDINT_H
 #include <stdint.h>
@@ -3241,10 +3240,8 @@ PanoramiXRenderInit (void)
 {
     int	    i;
     
-    XRT_PICTURE = CreateNewResourceType (XineramaDeleteResource);
-    if (XRT_PICTURE)
-	RegisterResourceName(XRT_PICTURE, "XineramaPicture");
-
+    XRT_PICTURE = CreateNewResourceType (XineramaDeleteResource,
+					 "XineramaPicture");
     for (i = 0; i < RenderNumberRequests; i++)
 	PanoramiXSaveRenderVector[i] = ProcRenderVector[i];
     /*
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index ac8d75b..95ed096 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -59,7 +59,6 @@
 #include "inputstr.h"
 #include "windowstr.h"
 #include "xace.h"
-#include "registry.h"
 
 static RESTYPE		CursorClientType;
 static RESTYPE		CursorHideCountType;
@@ -1091,15 +1090,12 @@ XFixesCursorInit (void)
 	cs->pCursorHideCounts = NULL;
 	SetCursorScreen (pScreen, cs);
     }
-    CursorClientType = CreateNewResourceType(CursorFreeClient);
-    if (CursorClientType)
-	RegisterResourceName(CursorClientType, "XFixesCursorClient");
-    CursorHideCountType = CreateNewResourceType(CursorFreeHideCount);
-    if (CursorHideCountType)
-	RegisterResourceName(CursorClientType, "XFixesCursorClient");
-    CursorWindowType = CreateNewResourceType(CursorFreeWindow);
-    if (CursorWindowType)
-	RegisterResourceName(CursorWindowType, "XFixesCursorWindow");
+    CursorClientType = CreateNewResourceType(CursorFreeClient,
+					     "XFixesCursorClient");
+    CursorHideCountType = CreateNewResourceType(CursorFreeHideCount,
+						"XFixesCursorHideCount");
+    CursorWindowType = CreateNewResourceType(CursorFreeWindow,
+					     "XFixesCursorWindow");
 
     if (pInvisibleCursor == NULL) {
 	pInvisibleCursor = createInvisibleCursor();
diff --git a/xfixes/region.c b/xfixes/region.c
index b597cda..1e08a32 100644
--- a/xfixes/region.c
+++ b/xfixes/region.c
@@ -33,7 +33,6 @@ extern int RenderErrBase;
 #include <regionstr.h>
 #include <gcstruct.h>
 #include <window.h>
-#include "registry.h"
 
 RESTYPE RegionResType;
 
@@ -64,10 +63,7 @@ XFixesRegionCopy (RegionPtr pRegion)
 Bool
 XFixesRegionInit (void)
 {
-    RegionResType = CreateNewResourceType(RegionResFree);
-    if (RegionResType)
-	RegisterResourceName(RegionResType, "XFixesRegion");
-
+    RegionResType = CreateNewResourceType(RegionResFree, "XFixesRegion");
     return RegionResType;
 }
 
diff --git a/xfixes/select.c b/xfixes/select.c
index 5a00ea8..5ba7896 100644
--- a/xfixes/select.c
+++ b/xfixes/select.c
@@ -26,7 +26,6 @@
 
 #include "xfixesint.h"
 #include "xace.h"
-#include "registry.h"
 
 static RESTYPE		SelectionClientType, SelectionWindowType;
 static Bool		SelectionCallbackRegistered = FALSE;
@@ -285,12 +284,9 @@ SelectionFreeWindow (pointer data, XID id)
 Bool
 XFixesSelectionInit (void)
 {
-    SelectionClientType = CreateNewResourceType(SelectionFreeClient);
-    if (SelectionClientType)
-	RegisterResourceName(SelectionClientType, "XFixesSelectionClient");
-    SelectionWindowType = CreateNewResourceType(SelectionFreeWindow);
-    if (SelectionWindowType)
-	RegisterResourceName(SelectionWindowType, "XFixesSelectionWindow");
-
+    SelectionClientType = CreateNewResourceType(SelectionFreeClient,
+						"XFixesSelectionClient");
+    SelectionWindowType = CreateNewResourceType(SelectionFreeWindow,
+						"XFixesSelectionWindow");
     return SelectionClientType && SelectionWindowType;
 }
diff --git a/xkb/xkb.c b/xkb/xkb.c
index f5ccd16..bfed114 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -39,7 +39,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include "xace.h"
 #include "xkb.h"
 #include "protocol-versions.h"
-#include "registry.h"
 
 #include <X11/extensions/XI.h>
 #include <X11/extensions/XKMformat.h>
@@ -6705,10 +6704,9 @@ XkbExtensionInit(void)
 {
     ExtensionEntry *extEntry;
 
-    RT_XKBCLIENT = CreateNewResourceType(XkbClientGone);
+    RT_XKBCLIENT = CreateNewResourceType(XkbClientGone, "XkbClient");
     if (!RT_XKBCLIENT)
 	return;
-    RegisterResourceName(RT_XKBCLIENT, "XkbClient");
 
     if ((extEntry = AddExtension(XkbName, XkbNumberEvents, XkbNumberErrors,
 				 ProcXkbDispatch, SProcXkbDispatch,
-- 
1.5.6.5



More information about the xorg-devel mailing list