From c381a3bb9bfb4950398af67ce97b02f5428671de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C3=85strand?= Date: Wed, 25 Sep 2002 11:07:12 +0000 Subject: [PATCH] Indent fixes. git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@195 423420c4-83ab-492f-b58f-81f9feb106b5 --- xwin.c | 55 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/xwin.c b/xwin.c index 549f857..e0011b1 100644 --- a/xwin.c +++ b/xwin.c @@ -278,7 +278,8 @@ ui_init(void) if (ownbackstore) { - backstore = XCreatePixmap(display, RootWindowOfScreen(screen), width, height, depth); + backstore = + XCreatePixmap(display, RootWindowOfScreen(screen), width, height, depth); /* clear to prevent rubbish being exposed at startup */ XSetForeground(display, gc, BlackPixelOfScreen(screen)); @@ -316,7 +317,7 @@ ui_create_window(void) long input_mask, ic_input_mask; XEvent xevent; - wndwidth = fullscreen ? WidthOfScreen(screen) : width; + wndwidth = fullscreen ? WidthOfScreen(screen) : width; wndheight = fullscreen ? HeightOfScreen(screen) : height; attribs.background_pixel = BlackPixelOfScreen(screen); @@ -360,7 +361,8 @@ ui_create_window(void) IC = XCreateIC(IM, XNInputStyle, (XIMPreeditNothing | XIMStatusNothing), XNClientWindow, wnd, XNFocusWindow, wnd, NULL); - if ((IC != NULL) && (XGetICValues(IC, XNFilterEvents, &ic_input_mask, NULL) == NULL)) + if ((IC != NULL) + && (XGetICValues(IC, XNFilterEvents, &ic_input_mask, NULL) == NULL)) input_mask |= ic_input_mask; } @@ -368,9 +370,11 @@ ui_create_window(void) XMapWindow(display, wnd); /* wait for MapNotify */ - do { + do + { XMaskEvent(display, StructureNotifyMask, &xevent); - } while (xevent.type != MapNotify); + } + while (xevent.type != MapNotify); if (fullscreen) XSetInputFocus(display, wnd, RevertToPointerRoot, CurrentTime); @@ -779,26 +783,38 @@ ui_create_colourmap(COLOURMAP * colours) long nDist = nMinDist; /* only get the colors once */ - while( colLookup-- ){ + while (colLookup--) + { xc_cache[colLookup].pixel = colLookup; - xc_cache[colLookup].red = xc_cache[colLookup].green = xc_cache[colLookup].blue = 0; + xc_cache[colLookup].red = xc_cache[colLookup].green = + xc_cache[colLookup].blue = 0; xc_cache[colLookup].flags = 0; - XQueryColor(display, DefaultColormap(display, DefaultScreen(display)), &xc_cache[colLookup]); + XQueryColor(display, + DefaultColormap(display, DefaultScreen(display)), + &xc_cache[colLookup]); } colLookup = 0; /* approximate the pixel */ - while( j-- ){ - if( xc_cache[j].flags ){ - nDist = - ((long) (xc_cache[j].red >> 8) - (long) (xentry.red >> 8)) * - ((long) (xc_cache[j].red >> 8) - (long) (xentry.red >> 8)) + - ((long) (xc_cache[j].green >> 8) - (long) (xentry.green >> 8)) * - ((long) (xc_cache[j].green >> 8) - (long) (xentry.green >> 8)) + - ((long) (xc_cache[j].blue >> 8) - (long) (xentry.blue >> 8)) * - ((long) (xc_cache[j].blue >> 8) - (long) (xentry.blue >> 8)); + while (j--) + { + if (xc_cache[j].flags) + { + nDist = ((long) (xc_cache[j].red >> 8) - + (long) (xentry.red >> 8)) * + ((long) (xc_cache[j].red >> 8) - + (long) (xentry.red >> 8)) + + ((long) (xc_cache[j].green >> 8) - + (long) (xentry.green >> 8)) * + ((long) (xc_cache[j].green >> 8) - + (long) (xentry.green >> 8)) + + ((long) (xc_cache[j].blue >> 8) - + (long) (xentry.blue >> 8)) * + ((long) (xc_cache[j].blue >> 8) - + (long) (xentry.blue >> 8)); } - if( nDist < nMinDist ){ + if (nDist < nMinDist) + { nMinDist = nDist; xentry.pixel = j; } @@ -807,7 +823,8 @@ ui_create_colourmap(COLOURMAP * colours) colour = xentry.pixel; /* update our cache */ - if( xentry.pixel < 256 ){ + if (xentry.pixel < 256) + { xc_cache[xentry.pixel].red = xentry.red; xc_cache[xentry.pixel].green = xentry.green; xc_cache[xentry.pixel].blue = xentry.blue;