From 15bc8d6000508ad13e4242b3322c0ddde15d06e3 Mon Sep 17 00:00:00 2001 From: droste Date: Tue, 28 Sep 2010 04:12:09 +0200 Subject: [PATCH] set error numbers of resource types in RRExtenstionInit() --- randr/randr.c | 5 +++++ randr/rrcrtc.c | 11 ++++++++++- randr/rrmode.c | 14 +++++++++++++- randr/rroutput.c | 11 ++++++++++- 4 files changed, 38 insertions(+), 3 deletions(-) diff --git a/randr/randr.c b/randr/randr.c index f52a46a..6077705 100644 --- a/randr/randr.c +++ b/randr/randr.c @@ -354,6 +354,11 @@ RRExtensionInit (void) SRRScreenChangeNotifyEvent; EventSwapVector[RREventBase + RRNotify] = (EventSwapPtr) SRRNotifyEvent; + + RRModeInitErrorValue(); + RRCrtcInitErrorValue(); + RROutputInitErrorValue(); + #ifdef PANORAMIX RRXineramaExtensionInit(); #endif diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 14f6e45..839f3cd 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -631,10 +631,19 @@ RRCrtcInit (void) RRCrtcType = CreateNewResourceType (RRCrtcDestroyResource, "CRTC"); if (!RRCrtcType) return FALSE; - SetResourceTypeErrorValue(RRCrtcType, RRErrorBase + BadRRCrtc); + return TRUE; } +/* + * Initialize crtc type error value + */ +void +RRCrtcInitErrorValue() +{ + SetResourceTypeErrorValue(RRCrtcType, RRErrorBase + BadRRCrtc); +} + int ProcRRGetCrtcInfo (ClientPtr client) { diff --git a/randr/rrmode.c b/randr/rrmode.c index deddd3c..361d17d 100644 --- a/randr/rrmode.c +++ b/randr/rrmode.c @@ -260,6 +260,9 @@ RRModeDestroyResource (pointer value, XID pid) return 1; } +/* + * Initialize mode type + */ Bool RRModeInit (void) { @@ -268,10 +271,19 @@ RRModeInit (void) RRModeType = CreateNewResourceType (RRModeDestroyResource, "MODE"); if (!RRModeType) return FALSE; - SetResourceTypeErrorValue(RRModeType, RRErrorBase + BadRRMode); + return TRUE; } +/* + * Initialize mode type error value + */ +void +RRModeInitErrorValue() +{ + SetResourceTypeErrorValue(RRModeType, RRErrorBase + BadRRMode); +} + int ProcRRCreateMode (ClientPtr client) { diff --git a/randr/rroutput.c b/randr/rroutput.c index 937b14d..1d65c11 100644 --- a/randr/rroutput.c +++ b/randr/rroutput.c @@ -418,10 +418,19 @@ RROutputInit (void) RROutputType = CreateNewResourceType (RROutputDestroyResource, "OUTPUT"); if (!RROutputType) return FALSE; - SetResourceTypeErrorValue(RROutputType, RRErrorBase + BadRROutput); + return TRUE; } +/* + * Initialize output type error value + */ +void +RROutputInitErrorValue() +{ + SetResourceTypeErrorValue(RROutputType, RRErrorBase + BadRROutput); +} + #define OutputInfoExtra (SIZEOF(xRRGetOutputInfoReply) - 32) int -- 1.7.1