diff options
-rw-r--r-- | Xext/mbuf.c | 4 | ||||
-rw-r--r-- | Xext/panoramiX.c | 16 | ||||
-rw-r--r-- | Xext/sync.c | 8 | ||||
-rw-r--r-- | Xext/xvdisp.c | 4 | ||||
-rw-r--r-- | Xi/extinit.c | 2 | ||||
-rw-r--r-- | dbe/dbe.c | 9 | ||||
-rw-r--r-- | glx/glxext.c | 3 | ||||
-rw-r--r-- | hw/dmx/glxProxy/glxext.c | 4 | ||||
-rw-r--r-- | hw/kdrive/ephyr/ephyrdriext.c | 4 | ||||
-rw-r--r-- | hw/xfree86/dri/dri.c | 3 | ||||
-rw-r--r-- | hw/xfree86/dri2/dri2ext.c | 6 | ||||
-rw-r--r-- | hw/xquartz/xpr/dri.c | 2 | ||||
-rw-r--r-- | xfixes/cursor.c | 2 | ||||
-rw-r--r-- | xfixes/region.c | 3 | ||||
-rw-r--r-- | xkb/xkb.c | 5 |
15 files changed, 58 insertions, 17 deletions
diff --git a/Xext/mbuf.c b/Xext/mbuf.c index 1f2497463..af312212f 100644 --- a/Xext/mbuf.c +++ b/Xext/mbuf.c @@ -467,7 +467,9 @@ MultibufferExtensionInit() * create the resource types */ MultibufferDrawableResType = - CreateNewResourceType(MultibufferDrawableDelete)|RC_DRAWABLE; + CreateNewResourceType(MultibufferDrawableDelete); + if (MultiBufferDrawableResType) + MultibufferDrawableResType |= RC_DRAWABLE; MultibufferResType = CreateNewResourceType(MultibufferDelete); MultibuffersResType = CreateNewResourceType(MultibuffersDelete); OtherClientResType = CreateNewResourceType(OtherClientDelete); diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index 4b7b07e1d..f48bd36a6 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -503,15 +503,19 @@ void PanoramiXExtensionInit(int argc, char *argv[]) } XRC_DRAWABLE = CreateNewResourceClass(); - XRT_WINDOW = CreateNewResourceType(XineramaDeleteResource) | - XRC_DRAWABLE; - XRT_PIXMAP = CreateNewResourceType(XineramaDeleteResource) | - XRC_DRAWABLE; + XRT_WINDOW = CreateNewResourceType(XineramaDeleteResource); + if (XRT_WINDOW) + XRT_WINDOW |= XRC_DRAWABLE; + XRT_PIXMAP = CreateNewResourceType(XineramaDeleteResource); + if (XRT_PIXMAP) + XRT_PIXMAP |= XRC_DRAWABLE; XRT_GC = CreateNewResourceType(XineramaDeleteResource); XRT_COLORMAP = CreateNewResourceType(XineramaDeleteResource); - panoramiXGeneration = serverGeneration; - success = TRUE; + if (XRT_WINDOW && XRT_PIXMAP && XRT_GC && XRT_COLORMAP) { + panoramiXGeneration = serverGeneration; + success = TRUE; + } } if (!success) { diff --git a/Xext/sync.c b/Xext/sync.c index 667f8ab78..d8a2b1535 100644 --- a/Xext/sync.c +++ b/Xext/sync.c @@ -2113,8 +2113,12 @@ SyncExtensionInit(void) RTCounter = CreateNewResourceType(FreeCounter); } RTAlarm = CreateNewResourceType(FreeAlarm); - RTAwait = CreateNewResourceType(FreeAwait)|RC_NEVERRETAIN; - RTAlarmClient = CreateNewResourceType(FreeAlarmClient)|RC_NEVERRETAIN; + RTAwait = CreateNewResourceType(FreeAwait); + if (RTAwait) + RTAwait |= RC_NEVERRETAIN; + RTAlarmClient = CreateNewResourceType(FreeAlarmClient); + if (RTAlarmClient) + RTAlarmClient |= RC_NEVERRETAIN; if (RTCounter == 0 || RTAwait == 0 || RTAlarm == 0 || RTAlarmClient == 0 || diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c index 5229916a9..1f3fc0f3d 100644 --- a/Xext/xvdisp.c +++ b/Xext/xvdisp.c @@ -1865,8 +1865,8 @@ void XineramifyXv(void) XvXRTPort = CreateNewResourceType(XineramaDeleteResource); - if(!xvsp0) return; - + if (!xvsp0 || !XvXRTPort) return; + for(i = 0; i < xvsp0->nAdaptors; i++) { refAdapt = xvsp0->pAdaptors + i; diff --git a/Xi/extinit.c b/Xi/extinit.c index 0c1291903..372f77f3b 100644 --- a/Xi/extinit.c +++ b/Xi/extinit.c @@ -1270,6 +1270,8 @@ XInputExtensionInit(void) XIVersion = thisversion; MakeDeviceTypeAtoms(); RT_INPUTCLIENT = CreateNewResourceType((DeleteType) InputClientGone); + if (!RT_INPUTCLIENT) + FatalError("Failed to add resource type for XI.\n"); RegisterResourceName(RT_INPUTCLIENT, "INPUTCLIENT"); FixExtensionEvents(extEntry); ReplySwapVector[IReqCode] = (ReplySwapPtr) SReplyIDispatch; @@ -1573,9 +1573,16 @@ DbeExtensionInit(void) /* Create the resource types. */ dbeDrawableResType = - CreateNewResourceType(DbeDrawableDelete) | RC_DRAWABLE; + CreateNewResourceType(DbeDrawableDelete); + if (!dbeDrawableResType) + return; + dbeDrawableResType |= RC_DRAWABLE; + dbeWindowPrivResType = CreateNewResourceType(DbeWindowPrivDelete); + if (!dbeWindowPrivResType) + return; + if (!dixRegisterPrivateOffset(dbeDrawableResType, offsetof(PixmapRec, devPrivates))) return; diff --git a/glx/glxext.c b/glx/glxext.c index 9f9c0ed1f..546d968fd 100644 --- a/glx/glxext.c +++ b/glx/glxext.c @@ -347,6 +347,9 @@ void GlxExtensionInit(void) __glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone); __glXSwapBarrierRes = CreateNewResourceType((DeleteType)SwapBarrierGone); + if (!__glXContextRes || !__glXDrawableRes || !__glXSwapBarrierRes) + return; + RegisterResourceName(__glXContextRes, "GLXContext"); RegisterResourceName(__glXDrawableRes, "GLXDrawable"); RegisterResourceName(__glXSwapBarrierRes, "GLXSwapBarrier"); diff --git a/hw/dmx/glxProxy/glxext.c b/hw/dmx/glxProxy/glxext.c index b30d144ee..0c3906897 100644 --- a/hw/dmx/glxProxy/glxext.c +++ b/hw/dmx/glxProxy/glxext.c @@ -299,6 +299,10 @@ void GlxExtensionInit(void) __glXWindowRes = CreateNewResourceType((DeleteType)WindowGone); __glXPbufferRes = CreateNewResourceType((DeleteType)PbufferGone); + if (!__glXContextRes || !__glXClientRes || !__glXPixmapRes || + !__glXWindowRes || !__glXPbufferRes) + return; + /* ** Add extension to server extensions. */ diff --git a/hw/kdrive/ephyr/ephyrdriext.c b/hw/kdrive/ephyr/ephyrdriext.c index 231b0985c..ba1733bdf 100644 --- a/hw/kdrive/ephyr/ephyrdriext.c +++ b/hw/kdrive/ephyr/ephyrdriext.c @@ -141,6 +141,10 @@ ephyrDRIExtensionInit (ScreenPtr a_screen) #ifdef XF86DRI_EVENTS EventType = CreateNewResourceType (XF86DRIFreeEvents); + if (!EventType) { + EPHYR_LOG_ERROR ("failed to register DRI event resource type\n") ; + goto out ; + } #endif if ((extEntry = AddExtension(XF86DRINAME, diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index 0de9be621..1a6cb4d83 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -792,6 +792,9 @@ DRIExtensionInit(void) DRIDrawablePrivResType = CreateNewResourceType(DRIDrawablePrivDelete); DRIContextPrivResType = CreateNewResourceType(DRIContextPrivDelete); + if (!DRIDrawablePrivResType || !DRIContextPrivResType) + return FALSE; + RegisterBlockAndWakeupHandlers(DRIBlockHandler, DRIWakeupHandler, NULL); return TRUE; diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c index dc07b47af..8acf26709 100644 --- a/hw/xfree86/dri2/dri2ext.c +++ b/hw/xfree86/dri2/dri2ext.c @@ -416,6 +416,11 @@ static int DRI2DrawableGone(pointer p, XID id) static void DRI2ExtensionInit(void) { + dri2DrawableRes = CreateNewResourceType(DRI2DrawableGone); + + if (!dri2DrawableRes) + return; + dri2Extension = AddExtension(DRI2_NAME, DRI2NumberEvents, DRI2NumberErrors, @@ -424,7 +429,6 @@ DRI2ExtensionInit(void) NULL, StandardMinorOpcode); - dri2DrawableRes = CreateNewResourceType(DRI2DrawableGone); } extern Bool noDRI2Extension; diff --git a/hw/xquartz/xpr/dri.c b/hw/xquartz/xpr/dri.c index f570bee5d..a9c0f2234 100644 --- a/hw/xquartz/xpr/dri.c +++ b/hw/xquartz/xpr/dri.c @@ -279,7 +279,7 @@ DRIExtensionInit(void) { DRIDrawablePrivResType = CreateNewResourceType(DRIDrawablePrivDelete); - return TRUE; + return (DRIDrawablePrivResType != 0); } void diff --git a/xfixes/cursor.c b/xfixes/cursor.c index 60d422296..c3e1e3534 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -1095,6 +1095,6 @@ XFixesCursorInit (void) } } - return CursorClientType && CursorWindowType; + return CursorClientType && CursorHideCountType && CursorWindowType; } diff --git a/xfixes/region.c b/xfixes/region.c index 966eda051..59d8cee54 100644 --- a/xfixes/region.c +++ b/xfixes/region.c @@ -64,7 +64,8 @@ Bool XFixesRegionInit (void) { RegionResType = CreateNewResourceType(RegionResFree); - return TRUE; + + return (RegionResType != 0); } int @@ -6704,6 +6704,10 @@ XkbExtensionInit(void) { ExtensionEntry *extEntry; + RT_XKBCLIENT = CreateNewResourceType(XkbClientGone); + if (!RT_XKBCLIENT) + return; + if ((extEntry = AddExtension(XkbName, XkbNumberEvents, XkbNumberErrors, ProcXkbDispatch, SProcXkbDispatch, NULL, StandardMinorOpcode))) { @@ -6711,7 +6715,6 @@ XkbExtensionInit(void) XkbEventBase = (unsigned char)extEntry->eventBase; XkbErrorBase = (unsigned char)extEntry->errorBase; XkbKeyboardErrorCode = XkbErrorBase+XkbKeyboard; - RT_XKBCLIENT = CreateNewResourceType(XkbClientGone); } return; } |