Introduce a consistent coding style

This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:

	-bap
	-psl
	-T PrivatePtr
	-T pmWait
	-T _XFUNCPROTOBEGIN
	-T _XFUNCPROTOEND
	-T _X_EXPORT

The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.

The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.

The comparison was done with this script:

dir1=$1
dir2=$2

for dir in $dir1 $dir2; do
	(cd $dir && find . -name '*.o' | while read file; do
		dir=`dirname $file`
		base=`basename $file .o`
		dump=$dir/$base.dump
		objdump -d $file > $dump
	done)
done

find $dir1 -name '*.dump' | while read dump; do
	otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
	diff -u $dump $otherdump
done

Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This commit is contained in:
Keith Packard 2012-03-21 12:55:09 -07:00
commit 9838b7032e
1258 changed files with 264655 additions and 259938 deletions

View file

@ -36,101 +36,101 @@ DevPrivateKeyRec xnestPixmapPrivateKeyRec;
PixmapPtr
xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth,
unsigned usage_hint)
unsigned usage_hint)
{
PixmapPtr pPixmap;
PixmapPtr pPixmap;
pPixmap = AllocatePixmap(pScreen, 0);
if (!pPixmap)
return NullPixmap;
pPixmap->drawable.type = DRAWABLE_PIXMAP;
pPixmap->drawable.class = 0;
pPixmap->drawable.depth = depth;
pPixmap->drawable.bitsPerPixel = depth;
pPixmap->drawable.id = 0;
pPixmap->drawable.x = 0;
pPixmap->drawable.y = 0;
pPixmap->drawable.width = width;
pPixmap->drawable.height = height;
pPixmap->drawable.pScreen = pScreen;
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
pPixmap->refcnt = 1;
pPixmap->devKind = PixmapBytePad(width, depth);
pPixmap->usage_hint = usage_hint;
if (width && height)
xnestPixmapPriv(pPixmap)->pixmap =
XCreatePixmap(xnestDisplay,
xnestDefaultWindows[pScreen->myNum],
width, height, depth);
else
xnestPixmapPriv(pPixmap)->pixmap = 0;
return pPixmap;
pPixmap = AllocatePixmap(pScreen, 0);
if (!pPixmap)
return NullPixmap;
pPixmap->drawable.type = DRAWABLE_PIXMAP;
pPixmap->drawable.class = 0;
pPixmap->drawable.depth = depth;
pPixmap->drawable.bitsPerPixel = depth;
pPixmap->drawable.id = 0;
pPixmap->drawable.x = 0;
pPixmap->drawable.y = 0;
pPixmap->drawable.width = width;
pPixmap->drawable.height = height;
pPixmap->drawable.pScreen = pScreen;
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
pPixmap->refcnt = 1;
pPixmap->devKind = PixmapBytePad(width, depth);
pPixmap->usage_hint = usage_hint;
if (width && height)
xnestPixmapPriv(pPixmap)->pixmap =
XCreatePixmap(xnestDisplay,
xnestDefaultWindows[pScreen->myNum],
width, height, depth);
else
xnestPixmapPriv(pPixmap)->pixmap = 0;
return pPixmap;
}
Bool
xnestDestroyPixmap(PixmapPtr pPixmap)
{
if(--pPixmap->refcnt)
if (--pPixmap->refcnt)
return TRUE;
XFreePixmap(xnestDisplay, xnestPixmap(pPixmap));
FreePixmap(pPixmap);
return TRUE;
XFreePixmap(xnestDisplay, xnestPixmap(pPixmap));
FreePixmap(pPixmap);
return TRUE;
}
RegionPtr
xnestPixmapToRegion(PixmapPtr pPixmap)
{
XImage *ximage;
register RegionPtr pReg, pTmpReg;
register int x, y;
unsigned long previousPixel, currentPixel;
BoxRec Box = { 0, 0, 0, 0 };
Bool overlap;
ximage = XGetImage(xnestDisplay, xnestPixmap(pPixmap), 0, 0,
pPixmap->drawable.width, pPixmap->drawable.height,
1, XYPixmap);
pReg = RegionCreate(NULL, 1);
pTmpReg = RegionCreate(NULL, 1);
if(!pReg || !pTmpReg) {
XDestroyImage(ximage);
return NullRegion;
}
for (y = 0; y < pPixmap->drawable.height; y++) {
Box.y1 = y;
Box.y2 = y + 1;
previousPixel = 0L;
for (x = 0; x < pPixmap->drawable.width; x++) {
currentPixel = XGetPixel(ximage, x, y);
if (previousPixel != currentPixel) {
if (previousPixel == 0L) {
/* left edge */
Box.x1 = x;
}
else if (currentPixel == 0L) {
/* right edge */
Box.x2 = x;
RegionReset(pTmpReg, &Box);
RegionAppend(pReg, pTmpReg);
}
previousPixel = currentPixel;
}
}
if (previousPixel != 0L) {
/* right edge because of the end of pixmap */
Box.x2 = pPixmap->drawable.width;
RegionReset(pTmpReg, &Box);
RegionAppend(pReg, pTmpReg);
}
}
RegionDestroy(pTmpReg);
XDestroyImage(ximage);
XImage *ximage;
register RegionPtr pReg, pTmpReg;
register int x, y;
unsigned long previousPixel, currentPixel;
BoxRec Box = { 0, 0, 0, 0 };
Bool overlap;
RegionValidate(pReg, &overlap);
ximage = XGetImage(xnestDisplay, xnestPixmap(pPixmap), 0, 0,
pPixmap->drawable.width, pPixmap->drawable.height,
1, XYPixmap);
return pReg;
pReg = RegionCreate(NULL, 1);
pTmpReg = RegionCreate(NULL, 1);
if (!pReg || !pTmpReg) {
XDestroyImage(ximage);
return NullRegion;
}
for (y = 0; y < pPixmap->drawable.height; y++) {
Box.y1 = y;
Box.y2 = y + 1;
previousPixel = 0L;
for (x = 0; x < pPixmap->drawable.width; x++) {
currentPixel = XGetPixel(ximage, x, y);
if (previousPixel != currentPixel) {
if (previousPixel == 0L) {
/* left edge */
Box.x1 = x;
}
else if (currentPixel == 0L) {
/* right edge */
Box.x2 = x;
RegionReset(pTmpReg, &Box);
RegionAppend(pReg, pTmpReg);
}
previousPixel = currentPixel;
}
}
if (previousPixel != 0L) {
/* right edge because of the end of pixmap */
Box.x2 = pPixmap->drawable.width;
RegionReset(pTmpReg, &Box);
RegionAppend(pReg, pTmpReg);
}
}
RegionDestroy(pTmpReg);
XDestroyImage(ximage);
RegionValidate(pReg, &overlap);
return pReg;
}