aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/mi
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/mi')
-rw-r--r--xorg-server/mi/mibitblt.c2
-rw-r--r--xorg-server/mi/miinitext.c48
2 files changed, 25 insertions, 25 deletions
diff --git a/xorg-server/mi/mibitblt.c b/xorg-server/mi/mibitblt.c
index b0d14ae55..3ed4ed1cc 100644
--- a/xorg-server/mi/mibitblt.c
+++ b/xorg-server/mi/mibitblt.c
@@ -730,7 +730,7 @@ miPutImage(DrawablePtr pDraw, GCPtr pGC, int depth,
ChangeGC(NullClient, pGC, GCForeground | GCBackground, gcv);
bytesPer = (long) h *BitmapBytePad(w + leftPad);
- for (i = 1 << (depth - 1); i != 0; i >>= 1, pImage += bytesPer) {
+ for (i = (unsigned long) 1 << (depth - 1); i != 0; i >>= 1, pImage += bytesPer) {
if (i & oldPlanemask) {
gcv[0].val = (XID) i;
ChangeGC(NullClient, pGC, GCPlaneMask, gcv);
diff --git a/xorg-server/mi/miinitext.c b/xorg-server/mi/miinitext.c
index 67511b8d0..5b45ab4c2 100644
--- a/xorg-server/mi/miinitext.c
+++ b/xorg-server/mi/miinitext.c
@@ -234,7 +234,7 @@ EnableDisableExtensionError(const char *name, Bool enable)
}
/* List of built-in (statically linked) extensions */
-static ExtensionModule staticExtensions[] = {
+static const ExtensionModule staticExtensions[] = {
{GEExtensionInit, "Generic Event Extension", &noGEExtension},
{ShapeExtensionInit, "SHAPE", NULL},
#ifdef MITSHM
@@ -312,15 +312,13 @@ static void
AddStaticExtensions(void)
{
static Bool listInitialised = FALSE;
- int i;
if (listInitialised)
return;
listInitialised = TRUE;
/* Add built-in extensions to the list. */
- for (i = 0; i < ARRAY_SIZE(staticExtensions); i++)
- LoadExtension(&staticExtensions[i], TRUE);
+ LoadExtensionList(staticExtensions, ARRAY_SIZE(staticExtensions), TRUE);
}
void
@@ -331,7 +329,7 @@ InitExtensions(int argc, char *argv[])
AddStaticExtensions();
- for (i = 0; ExtensionModuleList[i].name != NULL; i++) {
+ for (i = 0; i < numExtensionModules; i++) {
ext = &ExtensionModuleList[i];
if (ext->initFunc != NULL &&
(ext->disablePtr == NULL || !*ext->disablePtr)) {
@@ -341,50 +339,52 @@ InitExtensions(int argc, char *argv[])
}
static ExtensionModule *
-NewExtensionModule(void)
+NewExtensionModuleList(int size)
{
ExtensionModule *save = ExtensionModuleList;
int n;
- /* Make sure built-in extensions get added to the list before those
- * in modules. */
- AddStaticExtensions();
-
/* Sanity check */
if (!ExtensionModuleList)
numExtensionModules = 0;
- n = numExtensionModules + 1;
+ n = numExtensionModules + size;
ExtensionModuleList = realloc(ExtensionModuleList,
- (n + 1) * sizeof(ExtensionModule));
+ n * sizeof(ExtensionModule));
if (ExtensionModuleList == NULL) {
ExtensionModuleList = save;
return NULL;
}
else {
- numExtensionModules++;
- ExtensionModuleList[numExtensionModules].name = NULL;
- return ExtensionModuleList + (numExtensionModules - 1);
+ numExtensionModules += size;
+ return ExtensionModuleList + (numExtensionModules - size);
}
}
void
-LoadExtension(const ExtensionModule * e, Bool builtin)
+LoadExtensionList(const ExtensionModule ext[], int size, Bool builtin)
{
ExtensionModule *newext;
+ const char *msg;
+ int i;
- if (e == NULL || e->name == NULL)
- return;
+ /* Make sure built-in extensions get added to the list before those
+ * in modules. */
+ AddStaticExtensions();
- if (!(newext = NewExtensionModule()))
+ if (!(newext = NewExtensionModuleList(size)))
return;
if (builtin)
- ErrorF("Initializing built-in extension %s\n", e->name);
+ msg = "Initializing built-in";
else
- ErrorF("Loading extension %s\n", e->name);
+ msg = "Loading";
+
+ for (i = 0; i < size; i++, newext++) {
+ ErrorF("%s extension %s\n", msg, ext[i].name);
- newext->name = e->name;
- newext->initFunc = e->initFunc;
- newext->disablePtr = e->disablePtr;
+ newext->name = ext[i].name;
+ newext->initFunc = ext[i].initFunc;
+ newext->disablePtr = ext[i].disablePtr;
+ }
}