aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/mi
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-03-28 17:43:20 +0100
committermarha <marha@users.sourceforge.net>2014-03-28 17:43:20 +0100
commitf0f09f4aa3cdd0267f58b362a7c9fc5ae0921afd (patch)
treeafbeb028495328a2817aedbac7aae484a2c71a83 /xorg-server/mi
parentbf0cbcc1d00962ef2221cb4ceae87cc5ae737454 (diff)
parentcbfb19790917d271b8ca6156554b16acc802719f (diff)
downloadvcxsrv-f0f09f4aa3cdd0267f58b362a7c9fc5ae0921afd.tar.gz
vcxsrv-f0f09f4aa3cdd0267f58b362a7c9fc5ae0921afd.tar.bz2
vcxsrv-f0f09f4aa3cdd0267f58b362a7c9fc5ae0921afd.zip
Merge remote-tracking branch 'origin/released'
Conflicts: X11/xtrans/Xtrans.c
Diffstat (limited to 'xorg-server/mi')
-rw-r--r--xorg-server/mi/mibitblt.c2
-rw-r--r--xorg-server/mi/miinitext.c46
2 files changed, 24 insertions, 24 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 e5648724c..5b45ab4c2 100644
--- a/xorg-server/mi/miinitext.c
+++ b/xorg-server/mi/miinitext.c
@@ -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;
+ }
}