[xserver-commit] xserver/dix main.c,3.42,3.43
Jaymz Julian
xserver-commit@pdx.freedesktop.org
- Previous message: [xserver-commit] xserver/hw/xnest Args.c,1.2,1.3 Color.c,1.5,1.6 Cursor.c,1.5,1.6 Display.c,3.6,3.7 Events.c,1.4,1.5 Font.c,3.8,3.9 GC.c,3.8,3.9 GCOps.c,3.7,3.8 GetTime.c,1.1.1.2,1.2 Handlers.c,1.4,1.5 Init.c,3.26,3.27 Keyboard.c,1.11,1.12 Pixmap.c,3.9,3.10 Pointer.c,1.3,1.4 Screen.c,3.13,3.14 TestExt.c,3.5,3.6 Visual.c,1.3,1.4 Window.c,3.9,3.10 os2Stub.c,3.1,3.2
- Next message: [xserver-commit] xserver ChangeLog,3.127,3.128
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Committed by: jaymz
Update of /cvs/xserver/xserver/dix
In directory pdx:/tmp/cvs-serv21951/dix
Modified Files:
main.c
Log Message:
I like cows. and NULL checks.
Index: main.c
===================================================================
RCS file: /cvs/xserver/xserver/dix/main.c,v
retrieving revision 3.42
retrieving revision 3.43
diff -u -d -r3.42 -r3.43
--- main.c 11 Sep 2003 05:12:50 -0000 3.42
+++ main.c 4 Feb 2004 15:56:07 -0000 3.43
@@ -561,6 +561,7 @@
ScreenPtr pScreen;
DepthPtr pDepth;
VisualPtr pVisual;
+ VisualPtr finalVisual;
pScreen = screenInfo.screens[i];
root.windowId = WindowTable[i]->drawable.id;
@@ -604,20 +605,28 @@
for(k = 0; k < pDepth->numVids; k++)
{
vid = pDepth->vids[k];
+ finalVisual=pScreen->visuals+pScreen->numVisuals;
for (pVisual = pScreen->visuals;
- pVisual->vid != vid;
+ (pVisual<finalVisual) && (pVisual->vid != vid);
pVisual++)
;
- visual.visualID = vid;
- visual.class = pVisual->class;
- visual.bitsPerRGB = pVisual->bitsPerRGBValue;
- visual.colormapEntries = pVisual->ColormapEntries;
- visual.redMask = pVisual->redMask;
- visual.greenMask = pVisual->greenMask;
- visual.blueMask = pVisual->blueMask;
- memmove(pBuf, (char *)&visual, sizeof(xVisualType));
- pBuf += sizeof(xVisualType);
- sizesofar += sizeof(xVisualType);
+ if(pVisual!=finalVisual)
+ {
+ visual.visualID = vid;
+ visual.class = pVisual->class;
+ visual.bitsPerRGB = pVisual->bitsPerRGBValue;
+ visual.colormapEntries = pVisual->ColormapEntries;
+ visual.redMask = pVisual->redMask;
+ visual.greenMask = pVisual->greenMask;
+ visual.blueMask = pVisual->blueMask;
+ memmove(pBuf, (char *)&visual, sizeof(xVisualType));
+ pBuf += sizeof(xVisualType);
+ sizesofar += sizeof(xVisualType);
+ }
+ else
+ {
+ FatalError("Visual specified by hardware layer, but not returned - this is a bug!");
+ }
}
}
}
@@ -664,6 +673,9 @@
void (**jNI) ();
#endif /* DEBUG */
+ if(!pfnInit)
+ FatalError("AddScreen called without pfnInit defined - this is a bug!");
+
i = screenInfo.numScreens;
if (i == MAXSCREENS)
return -1;
@@ -749,6 +761,7 @@
WindowTable[i] = NullWindow;
screenInfo.screens[i] = pScreen;
screenInfo.numScreens++;
+
if (!(*pfnInit)(i, pScreen, argc, argv))
{
FreeScreen(pScreen);
- Previous message: [xserver-commit] xserver/hw/xnest Args.c,1.2,1.3 Color.c,1.5,1.6 Cursor.c,1.5,1.6 Display.c,3.6,3.7 Events.c,1.4,1.5 Font.c,3.8,3.9 GC.c,3.8,3.9 GCOps.c,3.7,3.8 GetTime.c,1.1.1.2,1.2 Handlers.c,1.4,1.5 Init.c,3.26,3.27 Keyboard.c,1.11,1.12 Pixmap.c,3.9,3.10 Pointer.c,1.3,1.4 Screen.c,3.13,3.14 TestExt.c,3.5,3.6 Visual.c,1.3,1.4 Window.c,3.9,3.10 os2Stub.c,3.1,3.2
- Next message: [xserver-commit] xserver ChangeLog,3.127,3.128
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]