From 7f2b9f3790456044d01bf8e6404f9a1239b41da6 Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Sat, 3 Mar 2007 19:27:53 -0800 Subject: [PATCH 01/39] autoconf fixes for XDarwin (created DARWIN_LIBS) --- configure.ac | 2 ++ hw/darwin/Makefile.am | 50 ++++--------------------------------------- 2 files changed, 6 insertions(+), 46 deletions(-) diff --git a/configure.ac b/configure.ac index 9386d8738..fe7770986 100644 --- a/configure.ac +++ b/configure.ac @@ -1298,6 +1298,8 @@ return 0;} # LDFLAGS=$save_LDFLAGS # ]) xorg_cv_AGL_framework=no + DARWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $OS_LIB" + AC_SUBST([DARWIN_LIBS]) AC_CHECK_LIB([Xplugin],[xp_init],[:]) AC_SUBST([APPLE_APPLICATIONS_DIR]) CFLAGS="${CFLAGS} -D__DARWIN__" diff --git a/hw/darwin/Makefile.am b/hw/darwin/Makefile.am index 9b4628e39..46642cdb6 100644 --- a/hw/darwin/Makefile.am +++ b/hw/darwin/Makefile.am @@ -17,7 +17,6 @@ SUBDIRS = \ utils \ . - darwinappdir = @APPLE_APPLICATIONS_DIR@/XDarwin.app libdarwinShared_a_SOURCES = darwin.c \ @@ -62,25 +61,11 @@ XDarwin_LDADD = \ $(top_builddir)/dix/dixfonts.lo \ $(top_builddir)/dix/libdix.la \ $(top_builddir)/config/libconfig.a \ - $(top_builddir)/os/libos.la \ ./libdarwinShared.a \ ./iokit/libiokit.a \ - $(top_builddir)/dix/libxpstubs.la \ $(top_builddir)/miext/shadow/libshadow.la \ - $(top_builddir)/fb/libfb.la \ - $(top_builddir)/composite/libcomposite.la \ - $(top_builddir)/damageext/libdamageext.la \ - $(top_builddir)/miext/damage/libdamage.la \ - $(top_builddir)/xfixes/libxfixes.la \ $(top_builddir)/miext/cw/libcw.la \ - $(top_builddir)/Xext/libXext.la \ - $(top_builddir)/xkb/libxkb.la \ - $(top_builddir)/xkb/libxkbstubs.la \ - $(top_builddir)/Xi/libXi.la \ - $(top_builddir)/dbe/libdbe.la \ - $(top_builddir)/record/librecord.la \ - $(top_builddir)/XTrap/libxtrap.la \ - $(XGLX_LIBS) \ + $(DARWIN_LIBS) \ $(top_builddir)/miext/rootless/librootless.la \ $(top_builddir)/miext/rootless/safeAlpha/libsafeAlpha.la \ $(top_builddir)/miext/rootless/accel/librlAccel.la \ @@ -91,23 +76,10 @@ Xquartz_LDADD = \ $(top_builddir)/dix/dixfonts.lo \ $(top_builddir)/dix/libdix.la \ $(top_builddir)/config/libconfig.a \ - $(top_builddir)/os/libos.la \ ./libdarwinShared.a \ - $(top_builddir)/dix/libxpstubs.la \ $(top_builddir)/miext/shadow/libshadow.la \ - $(top_builddir)/fb/libfb.la \ - $(top_builddir)/composite/libcomposite.la \ - $(top_builddir)/damageext/libdamageext.la \ - $(top_builddir)/miext/damage/libdamage.la \ - $(top_builddir)/xfixes/libxfixes.la \ $(top_builddir)/miext/cw/libcw.la \ - $(top_builddir)/Xext/libXext.la \ - $(top_builddir)/xkb/libxkb.la \ - $(top_builddir)/xkb/libxkbstubs.la \ - $(top_builddir)/Xi/libXi.la \ - $(top_builddir)/dbe/libdbe.la \ - $(top_builddir)/record/librecord.la \ - $(top_builddir)/XTrap/libxtrap.la \ + $(DARWIN_LIBS) \ $(top_builddir)/miext/rootless/librootless.la \ $(top_builddir)/miext/rootless/safeAlpha/libsafeAlpha.la \ $(top_builddir)/miext/rootless/accel/librlAccel.la \ @@ -155,28 +127,14 @@ XDarwinApp_LDADD = \ ./quartz/XApplication.o \ ./libdarwinShared.a \ ./quartz/libXQuartz.a \ - $(top_builddir)/dix/libxpstubs.la \ $(top_builddir)/miext/shadow/libshadow.la \ - $(top_builddir)/fb/libfb.la \ - $(top_builddir)/composite/libcomposite.la \ - $(top_builddir)/damageext/libdamageext.la \ - $(top_builddir)/miext/damage/libdamage.la \ - $(top_builddir)/xfixes/libxfixes.la \ $(top_builddir)/miext/cw/libcw.la \ - $(top_builddir)/Xext/libXext.la \ - $(top_builddir)/xkb/libxkb.la \ - $(top_builddir)/xkb/libxkbstubs.la \ - $(top_builddir)/Xi/libXi.la \ - $(top_builddir)/dbe/libdbe.la \ - $(top_builddir)/record/librecord.la \ - $(top_builddir)/XTrap/libxtrap.la \ - $(XGLX_LIBS) \ + $(DARWIN_LIBS) \ $(top_builddir)/miext/rootless/librootless.la \ $(top_builddir)/miext/rootless/safeAlpha/libsafeAlpha.la \ $(top_builddir)/miext/rootless/accel/librlAccel.la \ @XORG_LIBS@ \ - $(XSERVER_LIBS) \ - $(top_builddir)/fb/libfb.la + $(XSERVER_LIBS) XDarwinApp_LDFLAGS = \ -XCClinker -Objc \ From 18508212599bf0964c450c69b9790208e5d428be Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Sat, 3 Mar 2007 21:41:33 -0800 Subject: [PATCH 02/39] fixed X11.xcodeproj to get CFLAGS and LDFLAGS from autoconf script --- hw/darwin/apple/X11.xcodeproj/project.pbxproj | 33 +++++++------------ 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/hw/darwin/apple/X11.xcodeproj/project.pbxproj b/hw/darwin/apple/X11.xcodeproj/project.pbxproj index 7ca75d498..2fef99ba0 100644 --- a/hw/darwin/apple/X11.xcodeproj/project.pbxproj +++ b/hw/darwin/apple/X11.xcodeproj/project.pbxproj @@ -224,15 +224,12 @@ DSTROOT = "$(DSTROOT)"; FRAMEWORK_SEARCH_PATHS = ""; GCC_SYMBOLS_PRIVATE_EXTERN = NO; - HEADER_SEARCH_PATHS = /usr/X11/include; + HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = Info.plist; INSTALL_PATH = $DSTROOT/Applications/Utilties; - LIBRARY_SEARCH_PATHS = /usr/X11/lib; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ( - "-lXau", - "-lX11", - ); + LIBRARY_SEARCH_PATHS = ""; + OTHER_CFLAGS = "$(CFLAGS)"; + OTHER_LDFLAGS = "$(LDFLAGS)"; OTHER_REZFLAGS = ""; PRODUCT_NAME = X11; SECTORDER_FLAGS = ""; @@ -252,15 +249,12 @@ DSTROOT = "$(DSTROOT)"; FRAMEWORK_SEARCH_PATHS = ""; GCC_SYMBOLS_PRIVATE_EXTERN = NO; - HEADER_SEARCH_PATHS = /usr/X11/include; + HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = Info.plist; INSTALL_PATH = $DSTROOT/Applications/Utilties; - LIBRARY_SEARCH_PATHS = /usr/X11/lib; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ( - "-lXau", - "-lX11", - ); + LIBRARY_SEARCH_PATHS = ""; + OTHER_CFLAGS = "$(CFLAGS)"; + OTHER_LDFLAGS = "$(LDFLAGS)"; OTHER_REZFLAGS = ""; PRODUCT_NAME = X11; SECTORDER_FLAGS = ""; @@ -279,15 +273,12 @@ DSTROOT = "$(DSTROOT)"; FRAMEWORK_SEARCH_PATHS = ""; GCC_SYMBOLS_PRIVATE_EXTERN = NO; - HEADER_SEARCH_PATHS = /usr/X11/include; + HEADER_SEARCH_PATHS = ""; INFOPLIST_FILE = Info.plist; INSTALL_PATH = $DSTROOT/Applications/Utilties; - LIBRARY_SEARCH_PATHS = /usr/X11/lib; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ( - "-lXau", - "-lX11", - ); + LIBRARY_SEARCH_PATHS = ""; + OTHER_CFLAGS = "$(CFLAGS)"; + OTHER_LDFLAGS = "$(LDFLAGS)"; OTHER_REZFLAGS = ""; PRODUCT_NAME = X11; SECTORDER_FLAGS = ""; From ea8dcc458ea8870126cf8d3e21cab9d63d094c5e Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Sat, 3 Mar 2007 21:51:20 -0800 Subject: [PATCH 03/39] Makefile fix for X11.app --- hw/darwin/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/darwin/Makefile.am b/hw/darwin/Makefile.am index 46642cdb6..75d028ea5 100644 --- a/hw/darwin/Makefile.am +++ b/hw/darwin/Makefile.am @@ -275,7 +275,7 @@ install-data-hook: $(HOOK_TARGETS) xquartz-install-hook: mv $(DESTDIR)$(macosdir)/XDarwinApp $(DESTDIR)$(macosdir)/XDarwin - cd apple && xcodebuild install + cd apple && xcodebuild CFLAGS="$(XSERVERCFLAGS_CFLAGS)" LDFLAGS="$(XSERVERCFLAGS_LIBS)" EXTRA_DIST = \ darwin.c \ From 215e3691b76a63e6af19865790193b20b105ec5a Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Sat, 3 Mar 2007 21:52:56 -0800 Subject: [PATCH 04/39] stopped using XTrans internals in X11.app because they're apparently no longer public --- hw/darwin/apple/bundle-main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/darwin/apple/bundle-main.c b/hw/darwin/apple/bundle-main.c index 12fb1bf54..a35e1e37f 100644 --- a/hw/darwin/apple/bundle-main.c +++ b/hw/darwin/apple/bundle-main.c @@ -601,10 +601,10 @@ display_exists_p (int number) int idisplay, iscreen; char *conn_auth_name, *conn_auth_data; int conn_auth_namelen, conn_auth_datalen; - +#ifdef USE_XTRANS_INTERNALS extern void *_X11TransConnectDisplay (); extern void _XDisconnectDisplay (); - +#endif /* Since connecting to the display waits for a few seconds if the display doesn't exist, check for trivial non-existence - if the socket in /tmp exists or not.. (note: if the socket exists, the @@ -613,7 +613,7 @@ display_exists_p (int number) sprintf (buf, "/tmp/.X11-unix/X%d", number); if (access (buf, F_OK) != 0) return FALSE; - +#ifdef USE_XTRANS_INTERNALS /* This is a private function that we shouldn't really be calling, but it's the best way to see if the server exists (without needing to hold the necessary authentication to use it) */ @@ -626,6 +626,7 @@ display_exists_p (int number) return FALSE; _XDisconnectDisplay (conn); +#endif return TRUE; } From 97978b515b7af5fbaaa32b1729e835f3bfb9f5c6 Mon Sep 17 00:00:00 2001 From: Drew Parsons Date: Sun, 4 Mar 2007 16:28:54 +1100 Subject: [PATCH 05/39] Xprint: fix font symlinks Change symlinks to Xprint base fonts in model/PSdefault using local relative links. This facilitates moving the Xprint config files, for instance for FHS compliance placing data files in /usr/share rather than /usr/lib. Also ensures NewCenturySchlbk-BoldItalic.pmf is installed. --- hw/xprint/config/C/print/models/CANONC3200-PS/fonts/Makefile.am | 2 +- hw/xprint/config/C/print/models/HPLJ4050-PS/fonts/Makefile.am | 2 +- hw/xprint/config/C/print/models/PSdefault/fonts/Makefile.am | 1 + hw/xprint/config/C/print/models/SPSPARC2/fonts/Makefile.am | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/xprint/config/C/print/models/CANONC3200-PS/fonts/Makefile.am b/hw/xprint/config/C/print/models/CANONC3200-PS/fonts/Makefile.am index 5be5419ba..c574c5cde 100644 --- a/hw/xprint/config/C/print/models/CANONC3200-PS/fonts/Makefile.am +++ b/hw/xprint/config/C/print/models/CANONC3200-PS/fonts/Makefile.am @@ -1,6 +1,6 @@ xpcdir = @xpconfigdir@/C/print/models/CANONC3200-PS/fonts -parentdir = @xpconfigdir@/C/print/models/PSdefault/fonts +parentdir = ../../PSdefault/fonts XPFONTS = \ AvantGarde-Book.pmf \ diff --git a/hw/xprint/config/C/print/models/HPLJ4050-PS/fonts/Makefile.am b/hw/xprint/config/C/print/models/HPLJ4050-PS/fonts/Makefile.am index 2ff9ab7e7..634db1f39 100644 --- a/hw/xprint/config/C/print/models/HPLJ4050-PS/fonts/Makefile.am +++ b/hw/xprint/config/C/print/models/HPLJ4050-PS/fonts/Makefile.am @@ -1,6 +1,6 @@ xpcdir = @xpconfigdir@/C/print/models/HPLJ4050-PS/fonts -parentdir = @xpconfigdir@/C/print/models/PSdefault/fonts +parentdir = ../../PSdefault/fonts XPFONTS = \ AvantGarde-Book.pmf \ diff --git a/hw/xprint/config/C/print/models/PSdefault/fonts/Makefile.am b/hw/xprint/config/C/print/models/PSdefault/fonts/Makefile.am index e7ddb6c0f..1e8c8a781 100644 --- a/hw/xprint/config/C/print/models/PSdefault/fonts/Makefile.am +++ b/hw/xprint/config/C/print/models/PSdefault/fonts/Makefile.am @@ -18,6 +18,7 @@ dist_xpc_DATA = \ LubalinGraph-DemiOblique.pmf \ LubalinGraph-Demi.pmf \ NewCenturySchlbk-Bold.pmf \ + NewCenturySchlbk-BoldItalic.pmf \ NewCenturySchlbk-Italic.pmf \ NewCenturySchlbk-Roman.pmf \ Souvenir-DemiItalic.pmf \ diff --git a/hw/xprint/config/C/print/models/SPSPARC2/fonts/Makefile.am b/hw/xprint/config/C/print/models/SPSPARC2/fonts/Makefile.am index 8cc269459..d1ee6cf42 100644 --- a/hw/xprint/config/C/print/models/SPSPARC2/fonts/Makefile.am +++ b/hw/xprint/config/C/print/models/SPSPARC2/fonts/Makefile.am @@ -1,6 +1,6 @@ xpcdir = @xpconfigdir@/C/print/models/SPSPARC2/fonts -parentdir = @xpconfigdir@/C/print/models/PSdefault/fonts +parentdir = ../../PSdefault/fonts XPFONTS = \ Courier-Bold.pmf \ From c14507b6837387d867792a24778786311b2b38d5 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 4 Mar 2007 17:06:37 -0800 Subject: [PATCH 06/39] Handle non-zero origin rotated crtc. Damage crtc area on re-rotate. Box transformation from source to dest area was broken, leaving the wrong areas painted when the crtc origin was non-zero. When rotating from left to right, the pixmap doesn't get reallocated, and so no damage was left in the pixmap from xf86RotatePrepare. Separately damage the whole crtc area when this occurs to repaint the area. (cherry picked from commit 2a50ca2160bc05af1c24421ec079e902ff730277) --- hw/xfree86/modes/xf86Rotate.c | 88 ++++++++++++++++++++++++----------- 1 file changed, 60 insertions(+), 28 deletions(-) diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index 7b20498cc..ef637eea0 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -69,31 +69,44 @@ compWindowFormat (WindowPtr pWin) } static void -xf86RotateBox (BoxPtr dst, BoxPtr src, Rotation rotation, - int dest_width, int dest_height) +xf86TranslateBox (BoxPtr b, int dx, int dy) { + b->x1 += dx; + b->y1 += dy; + b->x2 += dx; + b->y2 += dy; +} + +static void +xf86TransformBox (BoxPtr dst, BoxPtr src, Rotation rotation, + int xoff, int yoff, + int dest_width, int dest_height) +{ + BoxRec stmp = *src; + + xf86TranslateBox (&stmp, -xoff, -yoff); switch (rotation & 0xf) { default: case RR_Rotate_0: - *dst = *src; + *dst = stmp; break; case RR_Rotate_90: - dst->x1 = src->y1; - dst->y1 = dest_height - src->x2; - dst->x2 = src->y2; - dst->y2 = dest_height - src->x1; + dst->x1 = stmp.y1; + dst->y1 = dest_height - stmp.x2; + dst->x2 = stmp.y2; + dst->y2 = dest_height - stmp.x1; break; case RR_Rotate_180: - dst->x1 = dest_width - src->x2; - dst->y1 = dest_height - src->y2; - dst->x2 = dest_width - src->x1; - dst->y2 = dest_height - src->y1; + dst->x1 = dest_width - stmp.x2; + dst->y1 = dest_height - stmp.y2; + dst->x2 = dest_width - stmp.x1; + dst->y2 = dest_height - stmp.y1; break; case RR_Rotate_270: - dst->x1 = dest_width - src->y2; - dst->y1 = src->x1; - dst->y2 = src->x2; - dst->x2 = dest_width - src->y1; + dst->x1 = dest_width - stmp.y2; + dst->y1 = stmp.x1; + dst->y2 = stmp.x2; + dst->x2 = dest_width - stmp.y1; break; } if (rotation & RR_Reflect_X) { @@ -194,8 +207,11 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crtc, RegionPtr region) { BoxRec dst_box; - xf86RotateBox (&dst_box, b, crtc->rotation, - crtc->mode.HDisplay, crtc->mode.VDisplay); + ErrorF ("painting %d,%d - %d,%d\n", + b->x1, b->y1, b->x2, b->y2); + xf86TransformBox (&dst_box, b, crtc->rotation, + crtc->x, crtc->y, + crtc->mode.HDisplay, crtc->mode.VDisplay); CompositePicture (PictOpSrc, src, NULL, dst, dst_box.x1, dst_box.y1, 0, 0, dst_box.x1, dst_box.y1, @@ -207,6 +223,26 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crtc, RegionPtr region) FreePicture (dst, None); } +static void +xf86CrtcDamageShadow (xf86CrtcPtr crtc) +{ + ScrnInfoPtr pScrn = crtc->scrn; + BoxRec damage_box; + RegionRec damage_region; + ScreenPtr pScreen = pScrn->pScreen; + + damage_box.x1 = crtc->x; + damage_box.x2 = crtc->x + xf86ModeWidth (&crtc->mode, crtc->rotation); + damage_box.y1 = crtc->y; + damage_box.y2 = crtc->y + xf86ModeHeight (&crtc->mode, crtc->rotation); + ErrorF ("damaged %d,%d - %d,%d\n", + damage_box.x1, damage_box.y1, damage_box.x2, damage_box.y2); + REGION_INIT (pScreen, &damage_region, &damage_box, 1); + DamageDamageRegion (&(*pScreen->GetScreenPixmap)(pScreen)->drawable, + &damage_region); + REGION_UNINIT (pScreen, &damage_region); +} + static void xf86RotatePrepare (ScreenPtr pScreen) { @@ -220,9 +256,6 @@ xf86RotatePrepare (ScreenPtr pScreen) if (crtc->rotatedData && !crtc->rotatedPixmap) { - BoxRec damage_box; - RegionRec damage_region; - crtc->rotatedPixmap = crtc->funcs->shadow_create (crtc, crtc->rotatedData, crtc->mode.HDisplay, @@ -231,14 +264,7 @@ xf86RotatePrepare (ScreenPtr pScreen) DamageRegister (&(*pScreen->GetScreenPixmap)(pScreen)->drawable, xf86_config->rotationDamage); - damage_box.x1 = 0; - damage_box.y1 = 0; - damage_box.x2 = xf86ModeWidth (&crtc->mode, crtc->rotation); - damage_box.y2 = xf86ModeHeight (&crtc->mode, crtc->rotation); - REGION_INIT (pScreen, &damage_region, &damage_box, 1); - DamageDamageRegion (&(*pScreen->GetScreenPixmap)(pScreen)->drawable, - &damage_region); - REGION_UNINIT (pScreen, &damage_region); + xf86CrtcDamageShadow (crtc); } } } @@ -357,6 +383,12 @@ xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation) if (!shadowData) goto bail1; crtc->rotatedData = shadowData; + /* shadow will be damaged in xf86RotatePrepare */ + } + else + { + /* mark shadowed area as damaged so it will be repainted */ + xf86CrtcDamageShadow (crtc); } if (!xf86_config->rotationDamage) From 06b01186f6ae17aafdd1f628c306466ddea9e065 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 4 Mar 2007 17:15:24 -0800 Subject: [PATCH 07/39] Remove debugging ErrorF from rotation code. (cherry picked from commit e6af7569f201842b4754aec6e72b30dc2daefdfb) --- hw/xfree86/modes/xf86Rotate.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index ef637eea0..6826b6277 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -143,10 +143,9 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crtc, RegionPtr region) &include_inferiors, serverClient, &error); - if (!src) { - ErrorF("couldn't create src pict\n"); + if (!src) return; - } + dst = CreatePicture (None, &dst_pixmap->drawable, format, @@ -154,10 +153,8 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crtc, RegionPtr region) NULL, serverClient, &error); - if (!dst) { - ErrorF("couldn't create src pict\n"); + if (!dst) return; - } memset (&transform, '\0', sizeof (transform)); transform.matrix[2][2] = IntToxFixed(1); @@ -198,17 +195,13 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crtc, RegionPtr region) } error = SetPictureTransform (src, &transform); - if (error) { - ErrorF("Couldn't set transform\n"); + if (error) return; - } while (n--) { BoxRec dst_box; - ErrorF ("painting %d,%d - %d,%d\n", - b->x1, b->y1, b->x2, b->y2); xf86TransformBox (&dst_box, b, crtc->rotation, crtc->x, crtc->y, crtc->mode.HDisplay, crtc->mode.VDisplay); @@ -235,8 +228,6 @@ xf86CrtcDamageShadow (xf86CrtcPtr crtc) damage_box.x2 = crtc->x + xf86ModeWidth (&crtc->mode, crtc->rotation); damage_box.y1 = crtc->y; damage_box.y2 = crtc->y + xf86ModeHeight (&crtc->mode, crtc->rotation); - ErrorF ("damaged %d,%d - %d,%d\n", - damage_box.x1, damage_box.y1, damage_box.x2, damage_box.y2); REGION_INIT (pScreen, &damage_region, &damage_box, 1); DamageDamageRegion (&(*pScreen->GetScreenPixmap)(pScreen)->drawable, &damage_region); From 2e31872e05c2408d53ba0182bcddc5dabb3615fe Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 26 Feb 2007 09:40:00 +1100 Subject: [PATCH 08/39] modes: add commit/prepare hooks --- hw/xfree86/modes/xf86Crtc.c | 10 +++++----- hw/xfree86/modes/xf86Crtc.h | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index c53d2a87b..8b13e2bdb 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -282,7 +282,7 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, goto done; } - /* Disable the outputs and CRTCs before setting the mode. */ + /* Prepare the outputs and CRTCs before setting the mode. */ for (i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr output = xf86_config->output[i]; @@ -290,10 +290,10 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, continue; /* Disable the output as the first thing we do. */ - output->funcs->dpms(output, DPMSModeOff); + output->funcs->prepare(output); } - crtc->funcs->dpms(crtc, DPMSModeOff); + crtc->funcs->prepare(crtc); /* Set up the DPLL and any output state that needs to adjust or depend * on the DPLL. @@ -307,12 +307,12 @@ xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, } /* Now, enable the clocks, plane, pipe, and outputs that we set up. */ - crtc->funcs->dpms(crtc, DPMSModeOn); + crtc->funcs->commit(crtc); for (i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr output = xf86_config->output[i]; if (output->crtc == crtc) - output->funcs->dpms(output, DPMSModeOn); + output->funcs->commit(output); } /* XXX free adjustedmode */ diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index b04f7f3f1..c8aafc1ea 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -96,6 +96,12 @@ typedef struct _xf86CrtcFuncs { DisplayModePtr mode, DisplayModePtr adjusted_mode); + /** + * Prepare CRTC for an upcoming mode set. + */ + void + (*prepare)(xf86CrtcPtr crtc); + /** * Callback for setting up a video mode after fixups have been made. */ @@ -105,6 +111,12 @@ typedef struct _xf86CrtcFuncs { DisplayModePtr adjusted_mode, int x, int y); + /** + * Commit mode changes to a CRTC + */ + void + (*commit)(xf86CrtcPtr crtc); + /* Set the color ramps for the CRTC to the given values. */ void (*gamma_set)(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue, @@ -263,6 +275,18 @@ typedef struct _xf86OutputFuncs { DisplayModePtr mode, DisplayModePtr adjusted_mode); + /** + * Callback for preparing mode changes on an output + */ + void + (*prepare)(xf86OutputPtr output); + + /** + * Callback for committing mode changes on an output + */ + void + (*commit)(xf86OutputPtr output); + /** * Callback for setting up a video mode after fixups have been made. * From 8ba5e8d82014b774a52f3e050ddbbb8bde4e0933 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 5 Mar 2007 13:46:41 +1100 Subject: [PATCH 09/39] add a standard connector type and name for us as an output property --- hw/xfree86/modes/xf86Crtc.c | 9 +++++++++ hw/xfree86/modes/xf86Crtc.h | 20 ++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 8b13e2bdb..2ffa9567c 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -1738,3 +1738,12 @@ xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus) return xf86DoEDID_DDC2 (scrn->scrnIndex, pDDCBus); } + +static char *_xf86ConnectorNames[] = { "None", "VGA", "DVI-I", "DVI-D", + "DVI-A", "Composite", "S-Video", + "Component", "LFP", "Proprietary" }; +char * +xf86ConnectorGetName(xf86ConnectorType connector) +{ + return _xf86ConnectorNames[connector]; +} diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index c8aafc1ea..537df3a3b 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -41,6 +41,20 @@ typedef struct _xf86Crtc xf86CrtcRec, *xf86CrtcPtr; typedef struct _xf86Output xf86OutputRec, *xf86OutputPtr; +/* define a standard for connector types */ +typedef enum _xf86ConnectorType { + XF86ConnectorNone, + XF86ConnectorVGA, + XF86ConnectorDVI_I, + XF86ConnectorDVI_D, + XF86ConnectorDVI_A, + XF86ConnectorComposite, + XF86ConnectorSvideo, + XF86ConnectorComponent, + XF86ConnectorLFP, + XF86ConnectorProprietary, +} xf86ConnectorType; + typedef enum _xf86OutputStatus { XF86OutputStatusConnected, XF86OutputStatusDisconnected, @@ -618,4 +632,10 @@ xf86DiDGAReInit (ScreenPtr pScreen); void xf86CrtcSetScreenSubpixelOrder (ScreenPtr pScreen); +/* + * Get a standard string name for a connector type + */ +char * +xf86ConnectorGetName(xf86ConnectorType connector); + #endif /* _XF86CRTC_H_ */ From 537dc5ecde46d0525c503d1d2b39b6eb89a1298e Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Mon, 5 Mar 2007 02:30:56 -0800 Subject: [PATCH 10/39] started moving new input code into darwinEvents.c so that it may be shared by the three servers --- hw/darwin/apple/X11Application.m | 19 +++++++++---------- hw/darwin/darwinEvents.c | 2 ++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/hw/darwin/apple/X11Application.m b/hw/darwin/apple/X11Application.m index 0be1e40b5..c50f70482 100644 --- a/hw/darwin/apple/X11Application.m +++ b/hw/darwin/apple/X11Application.m @@ -56,7 +56,7 @@ extern int darwinFakeButtons, input_check_flag; // extern Bool enable_stereo; Bool enable_stereo; //<-- this needs to go back to being an extern once glxCGL is fixed -static xEvent *quartzEvents; +extern xEvent *darwinEvents; X11Application *X11App; @@ -805,7 +805,6 @@ void X11ApplicationMain (int argc, const char *argv[], pool = [[NSAutoreleasePool alloc] init]; X11App = (X11Application *) [X11Application sharedApplication]; - quartzEvents = (xEvent *)malloc(sizeof(xEvent) * GetMaximumEventsNum()); init_ports (); @@ -914,33 +913,33 @@ static void send_nsevent (NSEventType type, NSEvent *e) { button_state |= (1 << ev_button); } else if (ev_type==ButtonRelease && (button_state & (1 << ev_button)) == 0) break; - num_events = GetPointerEvents(quartzEvents, darwinPointer, ev_type, ev_button, + num_events = GetPointerEvents(darwinEvents, darwinPointer, ev_type, ev_button, POINTER_ABSOLUTE, 0, 2, valuators); for(i=0; i 0.0f ? 4 : 5; for (count = fabs(count); count > 0.0; count = count - 1.0f) { - num_events = GetPointerEvents(quartzEvents, darwinPointer, ButtonPress, ev_button, + num_events = GetPointerEvents(darwinEvents, darwinPointer, ButtonPress, ev_button, POINTER_ABSOLUTE, 0, 2, valuators); for(i=0; i Date: Mon, 5 Mar 2007 03:48:27 -0800 Subject: [PATCH 11/39] began to factor out code to move to darwinEvents.c --- hw/darwin/apple/X11Application.m | 94 +++++++++++++++++++------------- hw/darwin/darwin.h | 4 ++ hw/darwin/darwinEvents.c | 6 +- 3 files changed, 63 insertions(+), 41 deletions(-) diff --git a/hw/darwin/apple/X11Application.m b/hw/darwin/apple/X11Application.m index c50f70482..cfc975037 100644 --- a/hw/darwin/apple/X11Application.m +++ b/hw/darwin/apple/X11Application.m @@ -855,21 +855,58 @@ convert_flags (unsigned int nsflags) { return xflags; } +/* Sends a null byte down darwinEventWriteFD, which will cause the + Dispatch() event loop to check out event queue */ +void DarwinPokeEQ(void) { + char nullbyte=0; + input_check_flag++; + // bushing: oh, i ... er ... christ. + write(darwinEventWriteFD, &nullbyte, 1); +} + +void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int pointer_y) { + int i; + int valuators[2] = {pointer_x, pointer_y}; + int num_events = GetPointerEvents(darwinEvents, darwinPointer, ev_type, ev_button, + POINTER_ABSOLUTE, 0, 2, valuators); + + for(i=0; i 0.0f ? 4 : 5; + int valuators[2] = {pointer_x, pointer_y}; + + for (count = fabs(count); count > 0.0; count = count - 1.0f) { + int num_events = GetPointerEvents(darwinEvents, darwinPointer, ButtonPress, ev_button, + POINTER_ABSOLUTE, 0, 2, valuators); + for(i=0; iIsX11Window([e window], [e windowNumber])) { fprintf(stderr, "Dropping event because it's not a window\n"); break; } button_state |= (1 << ev_button); + DarwinSendPointerEvents(ev_type, ev_button, pointer_x, pointer_y); } else if (ev_type==ButtonRelease && (button_state & (1 << ev_button)) == 0) break; - - num_events = GetPointerEvents(darwinEvents, darwinPointer, ev_type, ev_button, - POINTER_ABSOLUTE, 0, 2, valuators); - - for(i=0; i 0.0f ? 4 : 5; - for (count = fabs(count); count > 0.0; count = count - 1.0f) { - num_events = GetPointerEvents(darwinEvents, darwinPointer, ButtonPress, ev_button, - POINTER_ABSOLUTE, 0, 2, valuators); - for(i=0; i bushing: oh, i ... er ... christ. - write(darwinEventWriteFD, &nullbyte, 1); } diff --git a/hw/darwin/darwin.h b/hw/darwin/darwin.h index 48a2224f1..fc4a58a95 100644 --- a/hw/darwin/darwin.h +++ b/hw/darwin/darwin.h @@ -58,6 +58,10 @@ Bool DarwinEQInit(DevicePtr pKbd, DevicePtr pPtr); void DarwinEQEnqueue(const xEvent *e); void DarwinEQPointerPost(xEvent *e); void DarwinEQSwitchScreen(ScreenPtr pScreen, Bool fromDIX); +void DarwinPokeEQ(void); +void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int pointer_y); +void DarwinSendKeyboardEvents(int ev_type, int keycode); +void DarwinSendScrollEvents(float count, int pointer_x, int pointer_y); // From darwinKeyboard.c int DarwinModifierNXKeyToNXKeycode(int key, int side); diff --git a/hw/darwin/darwinEvents.c b/hw/darwin/darwinEvents.c index 1eb2336fd..ac03e5a70 100644 --- a/hw/darwin/darwinEvents.c +++ b/hw/darwin/darwinEvents.c @@ -269,7 +269,7 @@ void ProcessInputEvents(void) { static int darwinFakeMouseButtonMask = 0; input_check_flag=0; - ErrorF("calling mieqProcessInputEvents\n"); + // ErrorF("calling mieqProcessInputEvents\n"); mieqProcessInputEvents(); // Empty the signaling pipe @@ -292,12 +292,12 @@ void ProcessInputEvents(void) { xe.u.keyButtonPointer.rootY -= darwinMainScreenY + dixScreenOrigins[miPointerCurrentScreen()->myNum].y; - ErrorF("old rootX = (%d,%d) darwinMainScreen = (%d,%d) dixScreenOrigins[%d]=(%d,%d)\n", + /* ErrorF("old rootX = (%d,%d) darwinMainScreen = (%d,%d) dixScreenOrigins[%d]=(%d,%d)\n", xe.u.keyButtonPointer.rootX, xe.u.keyButtonPointer.rootY, darwinMainScreenX, darwinMainScreenY, miPointerCurrentScreen()->myNum, dixScreenOrigins[miPointerCurrentScreen()->myNum].x, - dixScreenOrigins[miPointerCurrentScreen()->myNum].y); + dixScreenOrigins[miPointerCurrentScreen()->myNum].y); */ //Assumption - screen switching can only occur on motion events From 689d52b6242434507a64a8fff27b01607628c393 Mon Sep 17 00:00:00 2001 From: Jens Granseuer Date: Mon, 5 Mar 2007 15:31:44 -0800 Subject: [PATCH 12/39] Bugzilla #7145: fix build with gcc 2.95 Bugzilla #7145: Patch #8987: --- GL/glx/glxcmdsswap.c | 4 ++-- randr/rrcrtc.c | 2 +- randr/rroutput.c | 2 +- randr/rrpointer.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/GL/glx/glxcmdsswap.c b/GL/glx/glxcmdsswap.c index d59dfdb4c..1857bc1eb 100644 --- a/GL/glx/glxcmdsswap.c +++ b/GL/glx/glxcmdsswap.c @@ -496,11 +496,11 @@ int __glXDispSwap_CopySubBufferMESA(__GLXclientState *cl, GLbyte *pc) GLXDrawable *drawId; int *buffer; + __GLX_DECLARE_SWAP_VARIABLES; + (void) drawId; (void) buffer; - __GLX_DECLARE_SWAP_VARIABLES; - pc += __GLX_VENDPRIV_HDR_SIZE; __GLX_SWAP_SHORT(&req->length); diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index 1f7462f28..db506f4b0 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -490,7 +490,7 @@ RRCrtcInit (void) int ProcRRGetCrtcInfo (ClientPtr client) { - REQUEST(xRRGetCrtcInfoReq);; + REQUEST(xRRGetCrtcInfoReq); xRRGetCrtcInfoReply rep; RRCrtcPtr crtc; CARD8 *extra; diff --git a/randr/rroutput.c b/randr/rroutput.c index a66433015..df1741f5c 100644 --- a/randr/rroutput.c +++ b/randr/rroutput.c @@ -366,7 +366,7 @@ RROutputInit (void) int ProcRRGetOutputInfo (ClientPtr client) { - REQUEST(xRRGetOutputInfoReq);; + REQUEST(xRRGetOutputInfoReq); xRRGetOutputInfoReply rep; RROutputPtr output; CARD8 *extra; diff --git a/randr/rrpointer.c b/randr/rrpointer.c index 802dcb2c4..c88a0f83e 100644 --- a/randr/rrpointer.c +++ b/randr/rrpointer.c @@ -103,7 +103,7 @@ void RRPointerMoved (ScreenPtr pScreen, int x, int y) { rrScrPriv (pScreen); - RRCrtcPtr pointerCrtc = pScrPriv->pointerCrtc;; + RRCrtcPtr pointerCrtc = pScrPriv->pointerCrtc; int c; /* Check last known CRTC */ From 33d2cf93fb50464941e74efe246b10aee212223a Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sat, 3 Mar 2007 23:10:31 -0800 Subject: [PATCH 13/39] Move xf86SetSingleMode into X server from intel driver. This function applies a single mode to the screen (as from RandR 1.1, XFree86-VidModeExtension or XFree86-DGA) using a policy that selects one output to reconfigure to the requested mode and then makes all other outputs fit within that size. (cherry picked from commit 5a595c1f767a8d666348b845d18934aee0cfe38f) --- hw/xfree86/modes/xf86Crtc.c | 126 ++++++++++++++++++++++++++++++++++++ hw/xfree86/modes/xf86Crtc.h | 6 ++ 2 files changed, 132 insertions(+) diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 2ffa9567c..3d28293c8 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -1542,6 +1542,132 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) return TRUE; } +/** + * In the current world order, there are lists of modes per output, which may + * or may not include the mode that was asked to be set by XFree86's mode + * selection. Find the closest one, in the following preference order: + * + * - Equality + * - Closer in size to the requested mode, but no larger + * - Closer in refresh rate to the requested mode. + */ + +DisplayModePtr +xf86OutputFindClosestMode (xf86OutputPtr output, DisplayModePtr desired) +{ + DisplayModePtr best = NULL, scan = NULL; + + for (scan = output->probed_modes; scan != NULL; scan = scan->next) + { + /* If there's an exact match, we're done. */ + if (xf86ModesEqual(scan, desired)) { + best = desired; + break; + } + + /* Reject if it's larger than the desired mode. */ + if (scan->HDisplay > desired->HDisplay || + scan->VDisplay > desired->VDisplay) + { + continue; + } + + /* + * If we haven't picked a best mode yet, use the first + * one in the size range + */ + if (best == NULL) + { + best = scan; + continue; + } + + /* Find if it's closer to the right size than the current best + * option. + */ + if ((scan->HDisplay > best->HDisplay && + scan->VDisplay >= best->VDisplay) || + (scan->HDisplay >= best->HDisplay && + scan->VDisplay > best->VDisplay)) + { + best = scan; + continue; + } + + /* Find if it's still closer to the right refresh than the current + * best resolution. + */ + if (scan->HDisplay == best->HDisplay && + scan->VDisplay == best->VDisplay && + (fabs(scan->VRefresh - desired->VRefresh) < + fabs(best->VRefresh - desired->VRefresh))) { + best = scan; + } + } + return best; +} + +/** + * When setting a mode through XFree86-VidModeExtension or XFree86-DGA, + * take the specified mode and apply it to the crtc connected to the compat + * output. Then, find similar modes for the other outputs, as with the + * InitialConfiguration code above. The goal is to clone the desired + * mode across all outputs that are currently active. + */ + +Bool +xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + Bool ok = TRUE; + xf86OutputPtr compat_output = config->output[config->compat_output]; + DisplayModePtr compat_mode; + int c; + + /* + * Let the compat output drive the final mode selection + */ + compat_mode = xf86OutputFindClosestMode (compat_output, desired); + if (compat_mode) + desired = compat_mode; + + for (c = 0; c < config->num_crtc; c++) + { + xf86CrtcPtr crtc = config->crtc[c]; + DisplayModePtr crtc_mode = NULL; + int o; + + if (!crtc->enabled) + continue; + + for (o = 0; o < config->num_output; o++) + { + xf86OutputPtr output = config->output[o]; + DisplayModePtr output_mode; + + /* skip outputs not on this crtc */ + if (output->crtc != crtc) + continue; + + if (crtc_mode) + { + output_mode = xf86OutputFindClosestMode (output, crtc_mode); + if (output_mode != crtc_mode) + output->crtc = NULL; + } + else + crtc_mode = xf86OutputFindClosestMode (output, desired); + } + if (!xf86CrtcSetMode (crtc, crtc_mode, rotation, 0, 0)) + ok = FALSE; + else + crtc->desiredMode = *crtc_mode; + } + xf86DisableUnusedFunctions(pScrn); + return ok; +} + + /** * Set the DPMS power mode of all outputs and CRTCs. * diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index 537df3a3b..56c7769cf 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -594,6 +594,12 @@ xf86SaveScreen(ScreenPtr pScreen, int mode); void xf86DisableUnusedFunctions(ScrnInfoPtr pScrn); +DisplayModePtr +xf86OutputFindClosestMode (xf86OutputPtr output, DisplayModePtr desired); + +Bool +xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation); + /** * Set the EDID information for the specified output */ From 47f8361c3a64834587e54507653d8d5b258c2530 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 5 Mar 2007 22:07:01 -0800 Subject: [PATCH 14/39] Add xf86SetDesiredModes to apply desired modes to crtcs. xf86SetDesiredModes applies the desired modes to each crtc (as selected by xf86InitialConfiguration initially and modified by successful mode settings afterwards). For crtcs without a desired mode, pScrn->currentMode is used to select something workable. (cherry picked from commit bcade98ccaa18298d844a606cb44271f0254c185) --- hw/xfree86/modes/xf86Crtc.c | 57 +++++++++++++++++++++++++++++++++++ hw/xfree86/modes/xf86Crtc.h | 8 +++++ hw/xfree86/modes/xf86Rename.h | 3 ++ 3 files changed, 68 insertions(+) diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 3d28293c8..c38da62ce 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -1542,6 +1542,63 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) return TRUE; } +/* + * Using the desired mode information in each crtc, set + * modes (used in EnterVT functions, or at server startup) + */ + +Bool +xf86SetDesiredModes (ScrnInfoPtr scrn) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + int c; + + for (c = 0; c < config->num_crtc; c++) + { + xf86CrtcPtr crtc = config->crtc[c]; + xf86OutputPtr output = NULL; + int o; + + if (config->output[config->compat_output]->crtc == crtc) + output = config->output[config->compat_output]; + else + { + for (o = 0; o < config->num_output; o++) + if (config->output[o]->crtc == crtc) + { + output = config->output[o]; + break; + } + } + /* + * Skip disabled crtcs + */ + if (!output) + continue; + + /* Mark that we'll need to re-set the mode for sure */ + memset(&crtc->mode, 0, sizeof(crtc->mode)); + if (!crtc->desiredMode.CrtcHDisplay) + { + DisplayModePtr mode = xf86OutputFindClosestMode (output, scrn->currentMode); + + if (!mode) + return FALSE; + crtc->desiredMode = *mode; + crtc->desiredRotation = RR_Rotate_0; + crtc->desiredX = 0; + crtc->desiredY = 0; + } + + if (!xf86CrtcSetMode (crtc, &crtc->desiredMode, crtc->desiredRotation, + crtc->desiredX, crtc->desiredY)) + return FALSE; + } + + xf86DisableUnusedFunctions(scrn); + return TRUE; +} + /** * In the current world order, there are lists of modes per output, which may * or may not include the mode that was asked to be set by XFree86's mode diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index 56c7769cf..062a2dbec 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -644,4 +644,12 @@ xf86CrtcSetScreenSubpixelOrder (ScreenPtr pScreen); char * xf86ConnectorGetName(xf86ConnectorType connector); +/* + * Using the desired mode information in each crtc, set + * modes (used in EnterVT functions, or at server startup) + */ + +Bool +xf86SetDesiredModes (ScrnInfoPtr pScrn); + #endif /* _XF86CRTC_H_ */ diff --git a/hw/xfree86/modes/xf86Rename.h b/hw/xfree86/modes/xf86Rename.h index 6cfa5caa1..eae6d64d5 100644 --- a/hw/xfree86/modes/xf86Rename.h +++ b/hw/xfree86/modes/xf86Rename.h @@ -76,5 +76,8 @@ #define xf86CrtcSetScreenSubpixelOrder XF86NAME(xf86CrtcSetScreenSubpixelOrder) #define xf86ModeWidth XF86NAME(xf86ModeWidth) #define xf86ModeHeight XF86NAME(xf86ModeHeight) +#define xf86OutputFindClosestMode XF86NAME(xf86OutputFindClosestMode) +#define xf86SetSingleMode XF86NAME(xf86SetSingleMode) +#define xf86SetDesiredModes XF86NAME(xf86SetDesiredModes) #endif /* _XF86RENAME_H_ */ From bed76caa6caaea6a6598755b82a54425a9d9f73e Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 5 Mar 2007 23:36:00 -0800 Subject: [PATCH 15/39] Use EDID data to set screen physical size at server startup. Screen physical size is set to a random value before the RandR code gets control, override that and reset it to a value based on the compat_output physical size (if available). If that output has no physical size, just use 96dpi as the default resolution and set the physical size as appropriate. (cherry picked from commit 843077f23a1b49bd712d931421753e3a09d4008c) --- hw/xfree86/modes/xf86RandR12.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index 052d12aa3..ce780b6ef 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -422,8 +422,28 @@ xf86RandR12CreateScreenResources (ScreenPtr pScreen) } else { - mmWidth = pScreen->mmWidth; - mmHeight = pScreen->mmHeight; + xf86OutputPtr output = config->output[config->compat_output]; + xf86CrtcPtr crtc = output->crtc; + + if (crtc && crtc->mode.HDisplay && + output->mm_width && output->mm_height) + { + /* + * If the output has a mode and a declared size, use that + * to scale the screen size + */ + DisplayModePtr mode = &crtc->mode; + mmWidth = output->mm_width * width / mode->HDisplay; + mmHeight = output->mm_height * height / mode->VDisplay; + } + else + { + /* + * Otherwise, just set the screen to 96dpi + */ + mmWidth = width * 25.4 / 96; + mmHeight = height * 25.4 / 96; + } } xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting screen physical size to %d x %d\n", From 9b6bb06f13a71f6078f762b4a78fa516faccb638 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 5 Mar 2007 23:49:35 -0800 Subject: [PATCH 16/39] Allow relative positions to use output names or monitor identifiers. Previous version used monitor identifiers if present, otherwise output names. That caused existing working configurations to break when additional information was added to the configuration file. (cherry picked from commit 3f5cedf00a82f08a433c95ffbb7f8ac69dcf6a50) --- hw/xfree86/modes/xf86Crtc.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index c38da62ce..46515fdcc 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -879,13 +879,17 @@ xf86InitialOutputPositions (ScrnInfoPtr scrn, DisplayModePtr *modes) { xf86OutputPtr out_rel = config->output[or]; XF86ConfMonitorPtr rel_mon = out_rel->conf_monitor; - char *name; if (rel_mon) - name = rel_mon->mon_identifier; - else - name = out_rel->name; - if (!strcmp (relative_name, name)) + { + if (xf86nameCompare (rel_mon->mon_identifier, + relative_name) == 0) + { + relative = config->output[or]; + break; + } + } + if (strcmp (out_rel->name, relative_name) == 0) { relative = config->output[or]; break; From ec1ef8a56d6217ca2b04899043874ce0bcad9784 Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Tue, 6 Mar 2007 00:57:23 -0800 Subject: [PATCH 17/39] Fixed Darwin's Makefile.am to fix a problem building X11.app --- hw/darwin/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/darwin/Makefile.am b/hw/darwin/Makefile.am index 75d028ea5..3e28d3212 100644 --- a/hw/darwin/Makefile.am +++ b/hw/darwin/Makefile.am @@ -112,7 +112,7 @@ macos_PROGRAMS = XDarwinApp macos_SCRIPTS = x11app x11app: - cd apple && xcodebuild + cd apple && xcodebuild CFLAGS="$(XSERVERCFLAGS_CFLAGS)" LDFLAGS="$(XSERVERCFLAGS_LIBS)" XDarwinApp_SOURCES = \ $(top_srcdir)/fb/fbcmap.c \ @@ -275,7 +275,7 @@ install-data-hook: $(HOOK_TARGETS) xquartz-install-hook: mv $(DESTDIR)$(macosdir)/XDarwinApp $(DESTDIR)$(macosdir)/XDarwin - cd apple && xcodebuild CFLAGS="$(XSERVERCFLAGS_CFLAGS)" LDFLAGS="$(XSERVERCFLAGS_LIBS)" + cd apple && xcodebuild install EXTRA_DIST = \ darwin.c \ From 3206e9225897989638ad553e1f392b918ac4d21f Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Tue, 6 Mar 2007 02:31:59 -0800 Subject: [PATCH 18/39] moved new event-handling code from X11Application.m to darwinEvents.c in preparation for making all Darwin servers use it --- hw/darwin/apple/X11Application.m | 42 ------------------------------- hw/darwin/darwinEvents.c | 43 ++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 42 deletions(-) diff --git a/hw/darwin/apple/X11Application.m b/hw/darwin/apple/X11Application.m index cfc975037..34c0307a5 100644 --- a/hw/darwin/apple/X11Application.m +++ b/hw/darwin/apple/X11Application.m @@ -855,48 +855,6 @@ convert_flags (unsigned int nsflags) { return xflags; } -/* Sends a null byte down darwinEventWriteFD, which will cause the - Dispatch() event loop to check out event queue */ -void DarwinPokeEQ(void) { - char nullbyte=0; - input_check_flag++; - // bushing: oh, i ... er ... christ. - write(darwinEventWriteFD, &nullbyte, 1); -} - -void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int pointer_y) { - int i; - int valuators[2] = {pointer_x, pointer_y}; - int num_events = GetPointerEvents(darwinEvents, darwinPointer, ev_type, ev_button, - POINTER_ABSOLUTE, 0, 2, valuators); - - for(i=0; i 0.0f ? 4 : 5; - int valuators[2] = {pointer_x, pointer_y}; - - for (count = fabs(count); count > 0.0; count = count - 1.0f) { - int num_events = GetPointerEvents(darwinEvents, darwinPointer, ButtonPress, ev_button, - POINTER_ABSOLUTE, 0, 2, valuators); - for(i=0; i bushing: oh, i ... er ... christ. + write(darwinEventWriteFD, &nullbyte, 1); +} + +void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int pointer_y) { + int i; + int valuators[2] = {pointer_x, pointer_y}; + int num_events = GetPointerEvents(darwinEvents, darwinPointer, ev_type, ev_button, + POINTER_ABSOLUTE, 0, 2, valuators); + + for(i=0; i 0.0f ? 4 : 5; + int valuators[2] = {pointer_x, pointer_y}; + + for (count = fabs(count); count > 0.0; count = count - 1.0f) { + int num_events = GetPointerEvents(darwinEvents, darwinPointer, ButtonPress, ev_button, + POINTER_ABSOLUTE, 0, 2, valuators); + for(i=0; i Date: Tue, 6 Mar 2007 23:53:23 +1100 Subject: [PATCH 19/39] Xprint: shorten font filename to fit in tar length limit The length of the Xprint font file NewCenturySchlbk-BoldItalic.pmf pushes the full path over the traditional 100 character limit for tarballs (when module version number is included). Shorten it to NewCentSchlbk-BoldItal.pmf to get back below the limit and rename other font files in that family to match. --- .../C/print/models/CANONC3200-PS/fonts/Makefile.am | 8 ++++---- .../C/print/models/HPLJ4050-PS/fonts/Makefile.am | 8 ++++---- .../C/print/models/PSdefault/fonts/Makefile.am | 8 ++++---- ...enturySchlbk-Bold.pmf => NewCentSchlbk-Bold.pmf} | Bin ...bk-BoldItalic.pmf => NewCentSchlbk-BoldItal.pmf} | Bin ...turySchlbk-Italic.pmf => NewCentSchlbk-Ital.pmf} | Bin ...turySchlbk-Roman.pmf => NewCentSchlbk-Roman.pmf} | Bin 7 files changed, 12 insertions(+), 12 deletions(-) rename hw/xprint/config/C/print/models/PSdefault/fonts/{NewCenturySchlbk-Bold.pmf => NewCentSchlbk-Bold.pmf} (100%) rename hw/xprint/config/C/print/models/PSdefault/fonts/{NewCenturySchlbk-BoldItalic.pmf => NewCentSchlbk-BoldItal.pmf} (100%) rename hw/xprint/config/C/print/models/PSdefault/fonts/{NewCenturySchlbk-Italic.pmf => NewCentSchlbk-Ital.pmf} (100%) rename hw/xprint/config/C/print/models/PSdefault/fonts/{NewCenturySchlbk-Roman.pmf => NewCentSchlbk-Roman.pmf} (100%) diff --git a/hw/xprint/config/C/print/models/CANONC3200-PS/fonts/Makefile.am b/hw/xprint/config/C/print/models/CANONC3200-PS/fonts/Makefile.am index c574c5cde..7a7ecc31a 100644 --- a/hw/xprint/config/C/print/models/CANONC3200-PS/fonts/Makefile.am +++ b/hw/xprint/config/C/print/models/CANONC3200-PS/fonts/Makefile.am @@ -19,10 +19,10 @@ XPFONTS = \ LubalinGraph-BookOblique.pmf \ LubalinGraph-Demi.pmf \ LubalinGraph-DemiOblique.pmf \ - NewCenturySchlbk-Bold.pmf \ - NewCenturySchlbk-BoldItalic.pmf \ - NewCenturySchlbk-Italic.pmf \ - NewCenturySchlbk-Roman.pmf \ + NewCentSchlbk-Bold.pmf \ + NewCentSchlbk-BoldItal.pmf \ + NewCentSchlbk-Ital.pmf \ + NewCentSchlbk-Roman.pmf \ Souvenir-Demi.pmf \ Souvenir-DemiItalic.pmf \ Souvenir-Light.pmf \ diff --git a/hw/xprint/config/C/print/models/HPLJ4050-PS/fonts/Makefile.am b/hw/xprint/config/C/print/models/HPLJ4050-PS/fonts/Makefile.am index 634db1f39..f4f4243e9 100644 --- a/hw/xprint/config/C/print/models/HPLJ4050-PS/fonts/Makefile.am +++ b/hw/xprint/config/C/print/models/HPLJ4050-PS/fonts/Makefile.am @@ -19,10 +19,10 @@ XPFONTS = \ LubalinGraph-BookOblique.pmf \ LubalinGraph-Demi.pmf \ LubalinGraph-DemiOblique.pmf \ - NewCenturySchlbk-Bold.pmf \ - NewCenturySchlbk-BoldItalic.pmf \ - NewCenturySchlbk-Italic.pmf \ - NewCenturySchlbk-Roman.pmf \ + NewCentSchlbk-Bold.pmf \ + NewCentSchlbk-BoldItal.pmf \ + NewCentSchlbk-Ital.pmf \ + NewCentSchlbk-Roman.pmf \ Souvenir-Demi.pmf \ Souvenir-DemiItalic.pmf \ Souvenir-Light.pmf \ diff --git a/hw/xprint/config/C/print/models/PSdefault/fonts/Makefile.am b/hw/xprint/config/C/print/models/PSdefault/fonts/Makefile.am index 1e8c8a781..40f1e3da5 100644 --- a/hw/xprint/config/C/print/models/PSdefault/fonts/Makefile.am +++ b/hw/xprint/config/C/print/models/PSdefault/fonts/Makefile.am @@ -17,10 +17,10 @@ dist_xpc_DATA = \ LubalinGraph-Book.pmf \ LubalinGraph-DemiOblique.pmf \ LubalinGraph-Demi.pmf \ - NewCenturySchlbk-Bold.pmf \ - NewCenturySchlbk-BoldItalic.pmf \ - NewCenturySchlbk-Italic.pmf \ - NewCenturySchlbk-Roman.pmf \ + NewCentSchlbk-Bold.pmf \ + NewCentSchlbk-BoldItal.pmf \ + NewCentSchlbk-Ital.pmf \ + NewCentSchlbk-Roman.pmf \ Souvenir-DemiItalic.pmf \ Souvenir-Demi.pmf \ Souvenir-LightItalic.pmf \ diff --git a/hw/xprint/config/C/print/models/PSdefault/fonts/NewCenturySchlbk-Bold.pmf b/hw/xprint/config/C/print/models/PSdefault/fonts/NewCentSchlbk-Bold.pmf similarity index 100% rename from hw/xprint/config/C/print/models/PSdefault/fonts/NewCenturySchlbk-Bold.pmf rename to hw/xprint/config/C/print/models/PSdefault/fonts/NewCentSchlbk-Bold.pmf diff --git a/hw/xprint/config/C/print/models/PSdefault/fonts/NewCenturySchlbk-BoldItalic.pmf b/hw/xprint/config/C/print/models/PSdefault/fonts/NewCentSchlbk-BoldItal.pmf similarity index 100% rename from hw/xprint/config/C/print/models/PSdefault/fonts/NewCenturySchlbk-BoldItalic.pmf rename to hw/xprint/config/C/print/models/PSdefault/fonts/NewCentSchlbk-BoldItal.pmf diff --git a/hw/xprint/config/C/print/models/PSdefault/fonts/NewCenturySchlbk-Italic.pmf b/hw/xprint/config/C/print/models/PSdefault/fonts/NewCentSchlbk-Ital.pmf similarity index 100% rename from hw/xprint/config/C/print/models/PSdefault/fonts/NewCenturySchlbk-Italic.pmf rename to hw/xprint/config/C/print/models/PSdefault/fonts/NewCentSchlbk-Ital.pmf diff --git a/hw/xprint/config/C/print/models/PSdefault/fonts/NewCenturySchlbk-Roman.pmf b/hw/xprint/config/C/print/models/PSdefault/fonts/NewCentSchlbk-Roman.pmf similarity index 100% rename from hw/xprint/config/C/print/models/PSdefault/fonts/NewCenturySchlbk-Roman.pmf rename to hw/xprint/config/C/print/models/PSdefault/fonts/NewCentSchlbk-Roman.pmf From a05ffca8dd0da9bdb5c1bf4c481028aeabf21e34 Mon Sep 17 00:00:00 2001 From: Ben Byer Date: Tue, 6 Mar 2007 10:36:51 -0800 Subject: [PATCH 20/39] rewrote event handling, Xquartz now has working mouse and keyboard. use it\! --- hw/darwin/apple/X11Application.m | 6 +- hw/darwin/darwinEvents.c | 250 +++++++++++-------------------- 2 files changed, 88 insertions(+), 168 deletions(-) diff --git a/hw/darwin/apple/X11Application.m b/hw/darwin/apple/X11Application.m index 34c0307a5..57795f452 100644 --- a/hw/darwin/apple/X11Application.m +++ b/hw/darwin/apple/X11Application.m @@ -919,11 +919,7 @@ static void send_nsevent (NSEventType type, NSEvent *e) { break; case NSFlagsChanged: - bzero(&xe, sizeof(xe)); - xe.u.u.type = kXDarwinUpdateModifiers; - xe.u.clientMessage.u.l.longs0 = [e modifierFlags]; - DarwinEQEnqueue (&xe); - DarwinPokeEQ(); + DarwinUpdateModKeys([e modifierFlags]); break; default: break; /* for gcc */ } diff --git a/hw/darwin/darwinEvents.c b/hw/darwin/darwinEvents.c index cb30a90ab..3d7f268ca 100644 --- a/hw/darwin/darwinEvents.c +++ b/hw/darwin/darwinEvents.c @@ -63,6 +63,8 @@ typedef struct _Event { int input_check_zero, input_check_flag; +static int old_flags = 0; // last known modifier state + typedef struct _EventQueue { HWEventQueueType head, tail; /* long for SetInputCheck */ CARD32 lastEventTime; /* to avoid time running backwards */ @@ -81,18 +83,15 @@ xEvent *darwinEvents; * Press or release the given modifier key, specified by its mask. */ static void DarwinPressModifierMask( - xEvent *xe, // must already have type, time and mouse location + int pressed, int mask) // one of NX_*MASK constants { int key = DarwinModifierNXMaskToNXKey(mask); if (key != -1) { int keycode = DarwinModifierNXKeyToNXKeycode(key, 0); - if (keycode != 0) { - xe->u.u.detail = keycode + MIN_KEYCODE; - (*darwinEventQueue.pKbd->processInputProc)(xe, - (DeviceIntPtr)darwinEventQueue.pKbd, 1); - } + if (keycode != 0) + DarwinSendKeyboardEvents(pressed, keycode); } } @@ -125,28 +124,26 @@ static void DarwinPressModifierMask( * Send events to update the modifier state. */ static void DarwinUpdateModifiers( - xEvent *xe, // event template with time and mouse position set int pressed, // KeyPress or KeyRelease int flags ) // modifier flags that have changed { - xe->u.u.type = pressed; if (flags & NX_ALPHASHIFTMASK) { - DarwinPressModifierMask(xe, NX_ALPHASHIFTMASK); + DarwinPressModifierMask(pressed, NX_ALPHASHIFTMASK); } if (flags & NX_COMMANDMASK) { - DarwinPressModifierMask(xe, COMMAND_MASK(flags)); + DarwinPressModifierMask(pressed, COMMAND_MASK(flags)); } if (flags & NX_CONTROLMASK) { - DarwinPressModifierMask(xe, CONTROL_MASK(flags)); + DarwinPressModifierMask(pressed, CONTROL_MASK(flags)); } if (flags & NX_ALTERNATEMASK) { - DarwinPressModifierMask(xe, ALTERNATE_MASK(flags)); + DarwinPressModifierMask(pressed, ALTERNATE_MASK(flags)); } if (flags & NX_SHIFTMASK) { - DarwinPressModifierMask(xe, SHIFT_MASK(flags)); + DarwinPressModifierMask(pressed, SHIFT_MASK(flags)); } if (flags & NX_SECONDARYFNMASK) { - DarwinPressModifierMask(xe, NX_SECONDARYFNMASK); + DarwinPressModifierMask(pressed, NX_SECONDARYFNMASK); } } @@ -163,19 +160,20 @@ static void DarwinUpdateModifiers( * simulate a button 2 press instead of Command-button 2. */ static void DarwinSimulateMouseClick( - xEvent *xe, // event template with time and - // mouse position filled in + int pointer_x, + int pointer_y, int whichButton, // mouse button to be pressed int modifierMask) // modifiers used for the fake click { // first fool X into forgetting about the keys - DarwinUpdateModifiers(xe, KeyRelease, modifierMask); + DarwinUpdateModifiers(KeyRelease, modifierMask); // push the mouse button - xe->u.u.type = ButtonPress; - xe->u.u.detail = whichButton; - (*darwinEventQueue.pPtr->processInputProc) - (xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1); + DarwinSendPointerEvents(ButtonPress, whichButton, pointer_x, pointer_y); + DarwinSendPointerEvents(ButtonRelease, whichButton, pointer_x, pointer_y); + + // restore old modifiers + DarwinUpdateModifiers(KeyPress, modifierMask); } @@ -234,7 +232,7 @@ void DarwinEQEnqueue(const xEvent *e) { darwinEventQueue.tail = newtail; // Signal there is an event ready to handle - write(darwinEventWriteFD, &byte, 1); + DarwinPokeEQ(); } @@ -265,8 +263,6 @@ void ProcessInputEvents(void) { xEvent xe; static int old_flags = 0; // last known modifier state // button number and modifier mask of currently pressed fake button - static int darwinFakeMouseButtonDown = 0; - static int darwinFakeMouseButtonMask = 0; input_check_flag=0; // ErrorF("calling mieqProcessInputEvents\n"); @@ -318,155 +314,35 @@ void ProcessInputEvents(void) { darwinEventQueue.head = 0; else ++darwinEventQueue.head; - switch (xe.u.u.type) - { + switch (xe.u.u.type) { case KeyPress: - if (old_flags == 0 - && darwinSyncKeymap && darwinKeymapFile == NULL) - { - /* See if keymap has changed. */ - - static unsigned int last_seed; - unsigned int this_seed; - - this_seed = DarwinModeSystemKeymapSeed(); - if (this_seed != last_seed) - { - last_seed = this_seed; - DarwinKeyboardReload(darwinKeyboard); - } - } - /* fall through */ - case KeyRelease: - xe.u.u.detail += MIN_KEYCODE; - (*darwinEventQueue.pKbd->processInputProc) - (&xe, (DeviceIntPtr)darwinEventQueue.pKbd, 1); - break; + ErrorF("Unexpected Keyboard event in DarwinProcessInputEvents\n"); + break; case ButtonPress: - miPointerAbsoluteCursor(xe.u.keyButtonPointer.rootX, - xe.u.keyButtonPointer.rootY, - xe.u.keyButtonPointer.time); - if (darwinFakeButtons && xe.u.u.detail == 1) { - // Mimic multi-button mouse with modifier-clicks - // If both sets of modifiers are pressed, - // button 2 is clicked. - if ((old_flags & darwinFakeMouse2Mask) == - darwinFakeMouse2Mask) - { - DarwinSimulateMouseClick(&xe, 2, darwinFakeMouse2Mask); - darwinFakeMouseButtonDown = 2; - darwinFakeMouseButtonMask = darwinFakeMouse2Mask; - break; - } - else if ((old_flags & darwinFakeMouse3Mask) == - darwinFakeMouse3Mask) - { - DarwinSimulateMouseClick(&xe, 3, darwinFakeMouse3Mask); - darwinFakeMouseButtonDown = 3; - darwinFakeMouseButtonMask = darwinFakeMouse3Mask; - break; - } - } - (*darwinEventQueue.pPtr->processInputProc) - (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1); + ErrorF("Unexpected ButtonPress event in DarwinProcessInputEvents\n"); break; case ButtonRelease: - miPointerAbsoluteCursor(xe.u.keyButtonPointer.rootX, - xe.u.keyButtonPointer.rootY, - xe.u.keyButtonPointer.time); - if (darwinFakeButtons && xe.u.u.detail == 1 && - darwinFakeMouseButtonDown) - { - // If last mousedown was a fake click, don't check for - // mouse modifiers here. The user may have released the - // modifiers before the mouse button. - xe.u.u.detail = darwinFakeMouseButtonDown; - darwinFakeMouseButtonDown = 0; - (*darwinEventQueue.pPtr->processInputProc) - (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1); - - // Bring modifiers back up to date - DarwinUpdateModifiers(&xe, KeyPress, - darwinFakeMouseButtonMask & old_flags); - darwinFakeMouseButtonMask = 0; - } else { - (*darwinEventQueue.pPtr->processInputProc) - (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1); - } + ErrorF("Unexpected ButtonRelease event in DarwinProcessInputEvents\n"); break; case MotionNotify: - miPointerAbsoluteCursor(xe.u.keyButtonPointer.rootX, - xe.u.keyButtonPointer.rootY, - xe.u.keyButtonPointer.time); + ErrorF("Unexpected ButtonRelease event in DarwinProcessInputEvents\n"); break; case kXDarwinUpdateModifiers: - { - // Update modifier state. - // Any amount of modifiers may have changed. - int flags = xe.u.clientMessage.u.l.longs0; - DarwinUpdateModifiers(&xe, KeyRelease, - old_flags & ~flags); - DarwinUpdateModifiers(&xe, KeyPress, - ~old_flags & flags); - old_flags = flags; - break; - } + ErrorF("Unexpected ButtonRelease event in DarwinProcessInputEvents\n"); + break; case kXDarwinUpdateButtons: - { - long hwDelta = xe.u.clientMessage.u.l.longs0; - long hwButtons = xe.u.clientMessage.u.l.longs1; - int i; + ErrorF("Unexpected XDarwinScrollWheel event in DarwinProcessInputEvents\n"); + break; - for (i = 1; i < 5; i++) { - if (hwDelta & (1 << i)) { - // IOKit and X have different numbering for the - // middle and right mouse buttons. - if (i == 1) { - xe.u.u.detail = 3; - } else if (i == 2) { - xe.u.u.detail = 2; - } else { - xe.u.u.detail = i + 1; - } - if (hwButtons & (1 << i)) { - xe.u.u.type = ButtonPress; - } else { - xe.u.u.type = ButtonRelease; - } - (*darwinEventQueue.pPtr->processInputProc) - (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1); - } - } - break; - } - - case kXDarwinScrollWheel: - { - short count = xe.u.clientMessage.u.s.shorts0; - - if (count > 0) { - xe.u.u.detail = SCROLLWHEELUPFAKE; - } else { - xe.u.u.detail = SCROLLWHEELDOWNFAKE; - count = -count; - } - - for (; count; --count) { - xe.u.u.type = ButtonPress; - (*darwinEventQueue.pPtr->processInputProc) - (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1); - xe.u.u.type = ButtonRelease; - (*darwinEventQueue.pPtr->processInputProc) - (&xe, (DeviceIntPtr)darwinEventQueue.pPtr, 1); - } - break; - } + case kXDarwinScrollWheel: + ErrorF("Unexpected XDarwinScrollWheel event in DarwinProcessInputEvents\n"); + break; default: // Check for mode specific event @@ -475,7 +351,7 @@ void ProcessInputEvents(void) { } } - miPointerUpdate(); + // miPointerUpdate(); } /* Sends a null byte down darwinEventWriteFD, which will cause the @@ -488,18 +364,58 @@ void DarwinPokeEQ(void) { } void DarwinSendPointerEvents(int ev_type, int ev_button, int pointer_x, int pointer_y) { - int i; + static int darwinFakeMouseButtonDown = 0; + static int darwinFakeMouseButtonMask = 0; + int i, num_events; int valuators[2] = {pointer_x, pointer_y}; - int num_events = GetPointerEvents(darwinEvents, darwinPointer, ev_type, ev_button, - POINTER_ABSOLUTE, 0, 2, valuators); + if (ev_type == ButtonPress && darwinFakeButtons && ev_button == 1) { + // Mimic multi-button mouse with modifier-clicks + // If both sets of modifiers are pressed, + // button 2 is clicked. + if ((old_flags & darwinFakeMouse2Mask) == darwinFakeMouse2Mask) { + DarwinSimulateMouseClick(pointer_x, pointer_y, 2, darwinFakeMouse2Mask); + darwinFakeMouseButtonDown = 2; + darwinFakeMouseButtonMask = darwinFakeMouse2Mask; + } else if ((old_flags & darwinFakeMouse3Mask) == darwinFakeMouse3Mask) { + DarwinSimulateMouseClick(pointer_x, pointer_y, 3, darwinFakeMouse3Mask); + darwinFakeMouseButtonDown = 3; + darwinFakeMouseButtonMask = darwinFakeMouse3Mask; + } + } + if (ev_type == ButtonRelease && darwinFakeButtons && darwinFakeMouseButtonDown) { + // If last mousedown was a fake click, don't check for + // mouse modifiers here. The user may have released the + // modifiers before the mouse button. + ev_button = darwinFakeMouseButtonDown; + darwinFakeMouseButtonDown = 0; + // Bring modifiers back up to date + DarwinUpdateModifiers(KeyPress, darwinFakeMouseButtonMask & old_flags); + darwinFakeMouseButtonMask = 0; + } + + num_events = GetPointerEvents(darwinEvents, darwinPointer, ev_type, ev_button, + POINTER_ABSOLUTE, 0, 2, valuators); for(i=0; i Date: Tue, 6 Mar 2007 11:09:30 -0800 Subject: [PATCH 21/39] updated todo list --- hw/darwin/README.apple | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/hw/darwin/README.apple b/hw/darwin/README.apple index 68bc692c9..229ab17ad 100644 --- a/hw/darwin/README.apple +++ b/hw/darwin/README.apple @@ -22,20 +22,14 @@ The server builds 4 targets: Known issues: * AGL and CGL support for 3D indirect acceleration does not work; - indirect.c needs to be rewritten. + indirect.c has been rewritten, but not yet integrated into this source tree. * Fullscreen mode does not work; I don't know why. -* The keyboard and mouse do not work at all; they worked in X11R7.1, - and I believe that they were broken by the events changes in dix/. - * Some features in X11.app are not yet implemented; these are marked with #ifdef DARWIN_DDX_MISSING in the code. * The build system code could probably be cleaned up slightly. -* Most testing of this code has occurred under 10.5, but it should - also work under 10.4. - Any patches or code contributions would be most welcome and may be sent to me at bbyer@apple.com. From 024bbc7cbb924daaf3e305ddfc8e74509acd1e15 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 6 Mar 2007 16:18:59 -0800 Subject: [PATCH 22/39] Bug #9931: Fix linear allocations with a non-1-byte granularity. This was introduced in 83080809f9a1c1d24b0318e54632f25f5940da25. Instead of aligning the offset, it doubled it. Results were appropriately spectacular. --- hw/xfree86/common/xf86fbman.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86fbman.c b/hw/xfree86/common/xf86fbman.c index d64cfaee4..537d53d7d 100644 --- a/hw/xfree86/common/xf86fbman.c +++ b/hw/xfree86/common/xf86fbman.c @@ -968,7 +968,7 @@ localAllocateOffscreenLinear( linear->size = h * w; linear->offset = (pitch * area->box.y1) + area->box.x1; if (gran > 1) - linear->offset += ((linear->offset + gran - 1) / gran) * gran; + linear->offset = ((linear->offset + gran - 1) / gran) * gran; linear->granularity = gran; linear->MoveLinearCallback = moveCB; linear->RemoveLinearCallback = removeCB; From a7cd53deb99957dec27a55ffd75e548b322ae0ce Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Tue, 6 Mar 2007 15:32:13 -0500 Subject: [PATCH 23/39] remove PIXPRIV checks as this flag is always set. --- Xext/shm.c | 23 ----------------------- afb/afbpixmap.c | 4 ---- cfb/cfbpixmap.c | 4 ---- dix/main.c | 6 ------ dix/privates.c | 2 -- fb/fbpixmap.c | 4 ---- hw/dmx/dmxpixmap.c | 4 ---- hw/dmx/dmxscrinit.c | 6 ------ hw/xfree86/loader/dixsym.c | 2 -- hw/xfree86/xf4bpp/ppcPixmap.c | 4 ---- hw/xnest/Pixmap.c | 6 ------ hw/xnest/Screen.c | 4 ---- hw/xnest/XNPixmap.h | 7 ------- include/pixmapstr.h | 2 -- include/screenint.h | 4 ---- include/scrnintstr.h | 2 -- mfb/mfbpixmap.c | 4 ---- 17 files changed, 88 deletions(-) diff --git a/Xext/shm.c b/Xext/shm.c index 7cfaa6808..ac587bef7 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -119,9 +119,7 @@ static int pixmapFormat; static int shmPixFormat[MAXSCREENS]; static ShmFuncsPtr shmFuncs[MAXSCREENS]; static DestroyPixmapProcPtr destroyPixmap[MAXSCREENS]; -#ifdef PIXPRIV static int shmPixmapPrivate; -#endif static ShmFuncs miFuncs = {NULL, miShmPutImage}; static ShmFuncs fbFuncs = {fbShmCreatePixmap, fbShmPutImage}; @@ -237,7 +235,6 @@ ShmExtensionInit(INITARGS) destroyPixmap[i] = screenInfo.screens[i]->DestroyPixmap; screenInfo.screens[i]->DestroyPixmap = ShmDestroyPixmap; } -#ifdef PIXPRIV shmPixmapPrivate = AllocatePixmapPrivateIndex(); for (i = 0; i < screenInfo.numScreens; i++) { @@ -245,7 +242,6 @@ ShmExtensionInit(INITARGS) shmPixmapPrivate, 0)) return; } -#endif } } ShmSegType = CreateNewResourceType(ShmDetachSegment); @@ -299,22 +295,7 @@ ShmDestroyPixmap (PixmapPtr pPixmap) if (pPixmap->refcnt == 1) { ShmDescPtr shmdesc; -#ifdef PIXPRIV shmdesc = (ShmDescPtr) pPixmap->devPrivates[shmPixmapPrivate].ptr; -#else - char *base = (char *) pPixmap->devPrivate.ptr; - - if (base != (pointer) (pPixmap + 1)) - { - for (shmdesc = Shmsegs; shmdesc; shmdesc = shmdesc->next) - { - if (shmdesc->addr <= base && base <= shmdesc->addr + shmdesc->size) - break; - } - } - else - shmdesc = 0; -#endif if (shmdesc) ShmDetachSegment ((pointer) shmdesc, pPixmap->drawable.id); } @@ -781,9 +762,7 @@ CreatePmap: shmdesc->addr + stuff->offset); if (pMap) { -#ifdef PIXPRIV pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc; -#endif shmdesc->refcnt++; pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pMap->drawable.id = newPix->info[j].id; @@ -1097,9 +1076,7 @@ CreatePmap: shmdesc->addr + stuff->offset); if (pMap) { -#ifdef PIXPRIV pMap->devPrivates[shmPixmapPrivate].ptr = (pointer) shmdesc; -#endif shmdesc->refcnt++; pMap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pMap->drawable.id = stuff->pid; diff --git a/afb/afbpixmap.c b/afb/afbpixmap.c index 6801960c6..6a3a48518 100644 --- a/afb/afbpixmap.c +++ b/afb/afbpixmap.c @@ -102,12 +102,8 @@ afbCreatePixmap(pScreen, width, height, depth) pPixmap->drawable.height = height; pPixmap->devKind = paddedWidth; pPixmap->refcnt = 1; -#ifdef PIXPRIV pPixmap->devPrivate.ptr = datasize ? (pointer)((char *)pPixmap + pScreen->totalPixmapSize) : NULL; -#else - pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1); -#endif return(pPixmap); } diff --git a/cfb/cfbpixmap.c b/cfb/cfbpixmap.c index d51c5187c..6fdf3eae6 100644 --- a/cfb/cfbpixmap.c +++ b/cfb/cfbpixmap.c @@ -96,12 +96,8 @@ cfbCreatePixmap (pScreen, width, height, depth) pPixmap->drawable.height = height; pPixmap->devKind = paddedWidth; pPixmap->refcnt = 1; -#ifdef PIXPRIV pPixmap->devPrivate.ptr = datasize ? (pointer)((char *)pPixmap + pScreen->totalPixmapSize) : NULL; -#else - pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1); -#endif return pPixmap; } diff --git a/dix/main.c b/dix/main.c index 3a77533a5..92c30b639 100644 --- a/dix/main.c +++ b/dix/main.c @@ -361,9 +361,7 @@ main(int argc, char *argv[], char *envp[]) ResetScreenPrivates(); ResetWindowPrivates(); ResetGCPrivates(); -#ifdef PIXPRIV ResetPixmapPrivates(); -#endif ResetColormapPrivates(); ResetFontPrivateIndex(); ResetDevicePrivateIndex(); @@ -731,11 +729,9 @@ AddScreen( pScreen->GCPrivateSizes = (unsigned *)NULL; pScreen->totalGCSize = ((sizeof(GC) + sizeof(long) - 1) / sizeof(long)) * sizeof(long); -#ifdef PIXPRIV pScreen->PixmapPrivateLen = 0; pScreen->PixmapPrivateSizes = (unsigned *)NULL; pScreen->totalPixmapSize = BitmapBytePad(sizeof(PixmapRec)*8); -#endif pScreen->ClipNotify = 0; /* for R4 ddx compatibility */ pScreen->CreateScreenResources = 0; @@ -799,9 +795,7 @@ FreeScreen(ScreenPtr pScreen) { xfree(pScreen->WindowPrivateSizes); xfree(pScreen->GCPrivateSizes); -#ifdef PIXPRIV xfree(pScreen->PixmapPrivateSizes); -#endif xfree(pScreen->devPrivates); xfree(pScreen); } diff --git a/dix/privates.c b/dix/privates.c index b20a1dbf0..a61c3cbb6 100644 --- a/dix/privates.c +++ b/dix/privates.c @@ -309,7 +309,6 @@ AllocateGCPrivate(register ScreenPtr pScreen, int index2, unsigned amount) /* * pixmap private machinery */ -#ifdef PIXPRIV static int pixmapPrivateCount; void @@ -355,7 +354,6 @@ AllocatePixmapPrivate(register ScreenPtr pScreen, int index2, unsigned amount) pScreen->totalPixmapSize = BitmapBytePad(pScreen->totalPixmapSize * 8); return TRUE; } -#endif /* diff --git a/fb/fbpixmap.c b/fb/fbpixmap.c index c2ddcb0e9..18c120440 100644 --- a/fb/fbpixmap.c +++ b/fb/fbpixmap.c @@ -43,11 +43,7 @@ fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp) if (paddedWidth / 4 > 32767 || height > 32767) return NullPixmap; datasize = height * paddedWidth; -#ifdef PIXPRIV base = pScreen->totalPixmapSize; -#else - base = sizeof (PixmapRec); -#endif adjust = 0; if (base & 7) adjust = 8 - (base & 7); diff --git a/hw/dmx/dmxpixmap.c b/hw/dmx/dmxpixmap.c index 4a669fdd9..934060675 100644 --- a/hw/dmx/dmxpixmap.c +++ b/hw/dmx/dmxpixmap.c @@ -49,15 +49,11 @@ /** Initialize a private area in \a pScreen for pixmap information. */ Bool dmxInitPixmap(ScreenPtr pScreen) { -#ifdef PIXPRIV if (!AllocatePixmapPrivate(pScreen, dmxPixPrivateIndex, sizeof(dmxPixPrivRec))) return FALSE; return TRUE; -#else -#error Must define PIXPRIV to compile DMX X server -#endif } /** Create a pixmap on the back-end server. */ diff --git a/hw/dmx/dmxscrinit.c b/hw/dmx/dmxscrinit.c index 5bfb4df0a..7c315d89f 100644 --- a/hw/dmx/dmxscrinit.c +++ b/hw/dmx/dmxscrinit.c @@ -70,9 +70,7 @@ static unsigned long *dmxCursorGeneration; int dmxGCPrivateIndex; /**< Private index for GCs */ int dmxWinPrivateIndex; /**< Private index for Windows */ -#ifdef PIXPRIV int dmxPixPrivateIndex; /**< Private index for Pixmaps */ -#endif int dmxFontPrivateIndex; /**< Private index for Fonts */ int dmxScreenPrivateIndex; /**< Private index for Screens */ int dmxColormapPrivateIndex; /**< Private index for Colormaps */ @@ -233,14 +231,10 @@ Bool dmxScreenInit(int idx, ScreenPtr pScreen, int argc, char *argv[]) if (dmxWinPrivateIndex == -1) return FALSE; -#ifdef PIXPRIV /* Allocate pixmap private index */ dmxPixPrivateIndex = AllocatePixmapPrivateIndex(); if (dmxPixPrivateIndex == -1) return FALSE; -#else -#error Must define PIXPRIV to compile DMX X server -#endif /* Allocate font private index */ dmxFontPrivateIndex = AllocateFontPrivateIndex(); diff --git a/hw/xfree86/loader/dixsym.c b/hw/xfree86/loader/dixsym.c index 32e0e4f68..594bf4377 100644 --- a/hw/xfree86/loader/dixsym.c +++ b/hw/xfree86/loader/dixsym.c @@ -271,10 +271,8 @@ _X_HIDDEN void *dixLookupTab[] = { SYMFUNC(AllocateColormapPrivateIndex) SYMFUNC(AllocateDevicePrivateIndex) SYMFUNC(AllocateDevicePrivate) -#ifdef PIXPRIV SYMFUNC(AllocatePixmapPrivateIndex) SYMFUNC(AllocatePixmapPrivate) -#endif /* resource.c */ SYMFUNC(AddResource) SYMFUNC(ChangeResourceValue) diff --git a/hw/xfree86/xf4bpp/ppcPixmap.c b/hw/xfree86/xf4bpp/ppcPixmap.c index 9f4cdc99a..9b2defda1 100644 --- a/hw/xfree86/xf4bpp/ppcPixmap.c +++ b/hw/xfree86/xf4bpp/ppcPixmap.c @@ -120,12 +120,8 @@ xf4bppCreatePixmap( pScreen, width, height, depth ) pPixmap->devKind = size; pPixmap->refcnt = 1 ; size = height * pPixmap->devKind ; -#ifdef PIXPRIV pPixmap->devPrivate.ptr = (pointer) (((CARD8*)pPixmap) + pScreen->totalPixmapSize); -#else - pPixmap->devPrivate.ptr = (pointer) (pPixmap + 1); -#endif bzero( (char *) pPixmap->devPrivate.ptr, size ) ; return pPixmap ; } diff --git a/hw/xnest/Pixmap.c b/hw/xnest/Pixmap.c index aa8bed933..612df8dac 100644 --- a/hw/xnest/Pixmap.c +++ b/hw/xnest/Pixmap.c @@ -32,9 +32,7 @@ is" without express or implied warranty. #include "Screen.h" #include "XNPixmap.h" -#ifdef PIXPRIV int xnestPixmapPrivateIndex; -#endif PixmapPtr xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth) @@ -57,12 +55,8 @@ xnestCreatePixmap(ScreenPtr pScreen, int width, int height, int depth) pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pPixmap->refcnt = 1; pPixmap->devKind = PixmapBytePad(width, depth); -#ifdef PIXPRIV pPixmap->devPrivates[xnestPixmapPrivateIndex].ptr = (pointer)((char *)pPixmap + pScreen->totalPixmapSize); -#else - pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1); -#endif if (width && height) xnestPixmapPriv(pPixmap)->pixmap = XCreatePixmap(xnestDisplay, diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c index 8e86efbdb..e6870e702 100644 --- a/hw/xnest/Screen.c +++ b/hw/xnest/Screen.c @@ -49,9 +49,7 @@ Window xnestScreenSaverWindows[MAXSCREENS]; extern void GlxWrapInitVisuals(miInitVisualsProcPtr *); #endif -#ifdef PIXPRIV int xnestScreenGeneration = -1; -#endif ScreenPtr xnestScreen(Window window) @@ -154,7 +152,6 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) sizeof(xnestPrivGC)))) return False; -#ifdef PIXPRIV if (xnestScreenGeneration != serverGeneration) { if ((xnestPixmapPrivateIndex = AllocatePixmapPrivateIndex()) < 0) return False; @@ -164,7 +161,6 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) if (!AllocatePixmapPrivate(pScreen,xnestPixmapPrivateIndex, sizeof (xnestPrivPixmap))) return False; -#endif visuals = (VisualPtr)xalloc(xnestNumVisuals * sizeof(VisualRec)); numVisuals = 0; diff --git a/hw/xnest/XNPixmap.h b/hw/xnest/XNPixmap.h index 77cba24af..6971b1162 100644 --- a/hw/xnest/XNPixmap.h +++ b/hw/xnest/XNPixmap.h @@ -15,21 +15,14 @@ is" without express or implied warranty. #ifndef XNESTPIXMAP_H #define XNESTPIXMAP_H -#ifdef PIXPRIV extern int xnestPixmapPrivateIndex; -#endif typedef struct { Pixmap pixmap; } xnestPrivPixmap; -#ifdef PIXPRIV #define xnestPixmapPriv(pPixmap) \ ((xnestPrivPixmap *)((pPixmap)->devPrivates[xnestPixmapPrivateIndex].ptr)) -#else -#define xnestPixmapPriv(pPixmap) \ - ((xnestPrivPixmap *)((pPixmap)->devPrivate.ptr)) -#endif #define xnestPixmap(pPixmap) (xnestPixmapPriv(pPixmap)->pixmap) diff --git a/include/pixmapstr.h b/include/pixmapstr.h index 628465b97..93bd45db8 100644 --- a/include/pixmapstr.h +++ b/include/pixmapstr.h @@ -86,9 +86,7 @@ typedef struct _Pixmap { int refcnt; int devKind; DevUnion devPrivate; -#ifdef PIXPRIV DevUnion *devPrivates; /* real devPrivates like gcs & windows */ -#endif #ifdef COMPOSITE short screen_x; short screen_y; diff --git a/include/screenint.h b/include/screenint.h index e60c2480c..1f1434a84 100644 --- a/include/screenint.h +++ b/include/screenint.h @@ -86,8 +86,6 @@ extern int AddScreen( int /*argc*/, char** /*argv*/); -#ifdef PIXPRIV - extern void ResetPixmapPrivates(void); extern int AllocatePixmapPrivateIndex(void); @@ -97,8 +95,6 @@ extern Bool AllocatePixmapPrivate( int /* index */, unsigned /* amount */); -#endif /* PIXPRIV */ - extern void ResetColormapPrivates(void); diff --git a/include/scrnintstr.h b/include/scrnintstr.h index 36135153f..110f4dce9 100644 --- a/include/scrnintstr.h +++ b/include/scrnintstr.h @@ -558,11 +558,9 @@ typedef struct _Screen { PixmapPtr pScratchPixmap; /* scratch pixmap "pool" */ -#ifdef PIXPRIV int PixmapPrivateLen; unsigned int *PixmapPrivateSizes; unsigned int totalPixmapSize; -#endif MarkWindowProcPtr MarkWindow; MarkOverlappedWindowsProcPtr MarkOverlappedWindows; diff --git a/mfb/mfbpixmap.c b/mfb/mfbpixmap.c index 5ec8502cb..e34972451 100644 --- a/mfb/mfbpixmap.c +++ b/mfb/mfbpixmap.c @@ -101,12 +101,8 @@ mfbCreatePixmap (pScreen, width, height, depth) pPixmap->drawable.height = height; pPixmap->devKind = paddedWidth; pPixmap->refcnt = 1; -#ifdef PIXPRIV pPixmap->devPrivate.ptr = datasize ? (pointer)((char *)pPixmap + pScreen->totalPixmapSize) : NULL; -#else - pPixmap->devPrivate.ptr = (pointer)(pPixmap + 1); -#endif return pPixmap; } From 81526232bc0119d2ec7b8590be4f78cf066ae359 Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Tue, 6 Mar 2007 17:19:11 -0500 Subject: [PATCH 24/39] remove PIXPRIV check as this flag is always set. --- dix/pixmap.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dix/pixmap.c b/dix/pixmap.c index a5b7b064d..c280a3b94 100644 --- a/dix/pixmap.c +++ b/dix/pixmap.c @@ -109,7 +109,6 @@ _X_EXPORT PixmapPtr AllocatePixmap(ScreenPtr pScreen, int pixDataSize) { PixmapPtr pPixmap; -#ifdef PIXPRIV char *ptr; DevUnion *ppriv; unsigned *sizes; @@ -136,9 +135,6 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize) else ppriv->ptr = (pointer)NULL; } -#else - pPixmap = (PixmapPtr)xalloc(sizeof(PixmapRec) + pixDataSize); -#endif #ifdef _XSERVER64 if (pPixmap) { From 72a23d88d73a8c72ed18847b004db05092d3e7be Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 6 Mar 2007 23:15:34 -0800 Subject: [PATCH 25/39] Add xf86CrtcScreenInit to share initialization across drivers. xf86CrtcScreenInit performs initialization that needs to happen at ScreenInit time. (cherry picked from commit 558a4f5588ad2ec11254e0b5d6ce9515b137369e) --- hw/xfree86/modes/xf86Crtc.c | 54 +++++++++++++++++++++++++++++++++++ hw/xfree86/modes/xf86Crtc.h | 23 +++------------ hw/xfree86/modes/xf86Rename.h | 1 + 3 files changed, 59 insertions(+), 19 deletions(-) diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 46515fdcc..279449688 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -545,6 +545,60 @@ xf86OutputDestroy (xf86OutputPtr output) xfree (output); } +/* + * Called during CreateScreenResources to hook up RandR + */ +static Bool +xf86CrtcCreateScreenResources (ScreenPtr screen) +{ + ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + + screen->CreateScreenResources = config->CreateScreenResources; + + if (!(*screen->CreateScreenResources)(screen)) + return FALSE; + + if (!xf86RandR12CreateScreenResources (screen)) + return FALSE; + + return TRUE; +} + +/* + * Called at ScreenInit time to set up + */ +Bool +xf86CrtcScreenInit (ScreenPtr screen) +{ + ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + int c; + + /* Rotation */ + xf86DrvMsg(scrn->scrnIndex, X_INFO, "RandR 1.2 enabled, ignore the following RandR disabled message.\n"); + xf86DisableRandR(); /* Disable old RandR extension support */ + xf86RandR12Init (screen); + + /* support all rotations if every crtc has the shadow alloc funcs */ + for (c = 0; c < config->num_crtc; c++) + { + xf86CrtcPtr crtc = config->crtc[c]; + if (!crtc->funcs->shadow_allocate || !crtc->funcs->shadow_create) + break; + } + if (c == config->num_crtc) + xf86RandR12SetRotations (screen, RR_Rotate_0 | RR_Rotate_90 | + RR_Rotate_180 | RR_Rotate_270); + else + xf86RandR12SetRotations (screen, RR_Rotate_0); + + /* Wrap CreateScreenResources so we can initialize the RandR code */ + config->CreateScreenResources = screen->CreateScreenResources; + screen->CreateScreenResources = xf86CrtcCreateScreenResources; + return TRUE; +} + static DisplayModePtr xf86DefaultMode (xf86OutputPtr output, int width, int height) { diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index 062a2dbec..6152ae4c9 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -494,6 +494,7 @@ typedef struct _xf86CrtcConfig { const xf86CrtcConfigFuncsRec *funcs; + CreateScreenResourcesProcPtr CreateScreenResources; } xf86CrtcConfigRec, *xf86CrtcConfigPtr; extern int xf86CrtcConfigPrivateIndex; @@ -524,25 +525,6 @@ void xf86CrtcDestroy (xf86CrtcPtr crtc); -/** - * Allocate a crtc for the specified output - * - * Find a currently unused CRTC which is suitable for - * the specified output - */ - -xf86CrtcPtr -xf86AllocCrtc (xf86OutputPtr output); - -/** - * Free a crtc - * - * Mark the crtc as unused by any outputs - */ - -void -xf86FreeCrtc (xf86CrtcPtr crtc); - /** * Sets the given video mode on the given crtc */ @@ -582,6 +564,9 @@ xf86ProbeOutputModes (ScrnInfoPtr pScrn, int maxX, int maxY); void xf86SetScrnInfoModes (ScrnInfoPtr pScrn); +Bool +xf86CrtcScreenInit (ScreenPtr pScreen); + Bool xf86InitialConfiguration (ScrnInfoPtr pScrn, Bool canGrow); diff --git a/hw/xfree86/modes/xf86Rename.h b/hw/xfree86/modes/xf86Rename.h index eae6d64d5..9dcfef5da 100644 --- a/hw/xfree86/modes/xf86Rename.h +++ b/hw/xfree86/modes/xf86Rename.h @@ -31,6 +31,7 @@ #define xf86CrtcDestroy XF86NAME(xf86CrtcDestroy) #define xf86CrtcInUse XF86NAME(xf86CrtcInUse) #define xf86CrtcRotate XF86NAME(xf86CrtcRotate) +#define xf86CrtcScreenInit XF86NAME(xf86CrtcScreenInit) #define xf86CrtcSetMode XF86NAME(xf86CrtcSetMode) #define xf86CrtcSetSizeRange XF86NAME(xf86CrtcSetSizeRange) #define xf86CVTMode XF86NAME(xf86CVTMode) From e9bfb2b3d7dfaafd90d2ad0fa3d0e1acced4380b Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 6 Mar 2007 23:19:30 -0800 Subject: [PATCH 26/39] Add hw/xfree86/docs/README.modes, documenting new mode setting APIs. This document covers both API and xorg.conf usage of the new mode setting APIs. (cherry picked from commit a59c31b0f7b94ed1f395c7586c37ef5fe7ba2a25) --- hw/xfree86/doc/README.modes | 474 ++++++++++++++++++++++++++++++++++++ 1 file changed, 474 insertions(+) create mode 100644 hw/xfree86/doc/README.modes diff --git a/hw/xfree86/doc/README.modes b/hw/xfree86/doc/README.modes new file mode 100644 index 000000000..894e21313 --- /dev/null +++ b/hw/xfree86/doc/README.modes @@ -0,0 +1,474 @@ + Multi-monitor Mode Setting APIs + Keith Packard, SaveScreen and the core X screen saver will be +implemented by disabling outputs and crtcs using their dpms functions. + + void + xf86DPMSSet(ScrnInfoPtr scrn, int mode, int flags) + +Pass this function to xf86DPMSInit and all DPMS mode switching will be +managed by using the dpms functions provided by the Outputs and CRTCs. + + Bool + xf86CrtcScreenInit (ScreenPtr screen) + +This function completes the screen initialization process for the crtc and +output objects. Call it near the end of the ScreenInit function, after the +frame buffer and acceleration layers have been added. + +3.3 EnterVT functions + +Functions used during EnterVT, or whenever the current configuration needs +to be applied to the hardware. + + Bool + xf86SetDesiredModes (ScrnInfoPtr scrn) + +xf86InitialConfiguration selects the desired configuration at PreInit time; +when the server finally hits ScreenInit, xf86SetDesiredModes is used by the +driver to take that configuration and apply it to the hardware. In addition, +successful mode selection at other times updates the configuration that will +be used by this function, so LeaveVT/EnterVT pairs can simply invoke this +and return to the previous configuration. + +3.4 SwitchMode functions + +Functions called from the pScrn->SwitchMode hook, which is used by the +XFree86-VidModeExtension and the keypad mode switch commands. + + Bool + xf86SetSingleMode (ScrnInfoPtr scrn, + DisplayModePtr desired, + Rotation rotation) + +This function applies the specified mode to all active outputs. Which is to +say, it picks reasonable modes for all active outputs, attempting to get the +screen to the specified size while not breaking anything that is currently +working. + +3.7 get_modes functions + +Functions called during output->get_modes to help build lists of modes + + xf86MonPtr + xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus) + +This returns the EDID data structure for the 'output' using the I2C bus +'pDDCBus'. This has no effect on 'output' itself. + + void + xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon) + +Once the EDID data has been fetched, this call applies the EDID data to the +output object, setting the physical size and also various properties, like +the DDC root window property (when output is the 'compat' output), and the +RandR 1.2 EDID output properties. + + DisplayModePtr + xf86OutputGetEDIDModes (xf86OutputPtr output) + +Given an EDID data structure, this function computes a list of suitable +modes. This function also applies a sequence of 'quirks' during this process +so that the returned modes may not actually match the mode data present in +the EDID data. + +3.6 Other functions + +These remaining functions in the API can be used by the driver as needed. + + Bool + xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, + int x, int y) + +Applies a mode to a CRTC. All of the outputs which are currently using the +specified CRTC are included in the mode setting process. 'x' and 'y' are the +offset within the frame buffer that the crtc is placed at. No checking is +done in this function to ensure that the mode is usable by the active +outputs. + + void + xf86ProbeOutputModes (ScrnInfoPtr pScrn, int maxX, int maxY) + +This discards the mode lists for all outputs, re-detects monitor presence +and then acquires new mode lists for all monitors which are not disconnected. +Monitor configuration data is used to modify the mode lists returned by the +outputs. 'maxX' and 'maxY' limit the maximum size modes that will be +returned. + + void + xf86SetScrnInfoModes (ScrnInfoPtr pScrn) + +This copies the 'compat' output mode list into the pScrn modes list which is +used by the XFree86-VidModeExtension and the keypad mode switching +operations. The current 'desired' mode for the CRTC associated with the +'compat' output is placed first in this list to indicate the current mode. +Usually, the driver won't need to call this function as +xf86InitialConfiguration will do so automatically, as well as any RandR +functions which reprobe for modes. However, if the driver reprobes for modes +at other times using xf86ProbeOutputModes, this function needs to be called. + + Bool + xf86DiDGAReInit (ScreenPtr pScreen) + +This is similar to xf86SetScrnInfoModes, but it applies the 'compat' output +mode list to the set of modes advertised by the DGA extension; it needs to +be called whenever xf86ProbeOutputModes is invoked. + + void + xf86DisableUnusedFunctions(ScrnInfoPtr pScrn) + +After any sequence of calls using xf86CrtcSetMode, this function cleans up +any leftover Output and CRTC objects by disabling them, saving power. It is +safe to call this whenever the server is running as it only disables objects +which are not currently in use. + +4. CRTC operations + +4.1 CRTC functions + +These functions provide an abstract interface for the CRTC object; most +manipulation of the CRTC object is done through these functions. + + void + crtc->funcs->dpms (xf86CrtcPtr crtc, int mode) + +Where 'mode' is one of DPMSModeOff, DPMSModeSuspend, DPMSModeStandby or +DPMSModeOn. This requests that the crtc go to the specified power state. +When changing power states, the output dpms functions are invoked before the +crtc dpms functions. + + void + crtc->funcs->save (xf86CrtcPtr crtc) + + void + crtc->funcs->restore (xf86CrtcPtr crtc) + +Preserve/restore any register contents related to the CRTC. These are +strictly a convenience for the driver writer; if the existing driver has +fully operation save/restore functions, you need not place any additional +code here. In particular, the server itself never uses this function. + + Bool + crtc->funcs->lock (xf86CrtcPtr crtc) + + void + crtc->funcs->unlock (xf86CrtcPtr crtc) + +These functions are invoked around mode setting operations; the intent is +that DRI locking be done here to prevent DRI applications from manipulating +the hardware while the server is busy changing the output configuration. If +the lock function returns FALSE, the unlock function will not be invoked. + + Bool + crtc->funcs->mode_fixup (xf86CrtcPtr crtc, + DisplayModePtr mode, + DisplayModePtr adjusted_mode) + +This call gives the CRTC a chance to see what mode will be set and to +comment on the mode by changing 'adjusted_mode' as needed. This function +shall not modify the state of the crtc hardware at all. If the CRTC cannot +accept this mode, this function may return FALSE. + + void + crtc->funcs->prepare (xf86CrtcPtr crtc) + +This call is made just before the mode is set to make the hardware ready for +the operation. A usual function to perform here is to disable the crtc so +that mode setting can occur with clocks turned off and outputs deactivated. + + void + crtc->funcs->mode_set (xf86CrtcPtr crtc, + DisplayModePtr mode, + DisplayModePtr adjusted_mode) + +This function applies the specified mode (possibly adjusted by the CRTC +and/or Outputs). + + void + crtc->funcs->commit (xf86CrtcPtr crtc) + +Once the mode has been applied to the CRTC and Outputs, this function is +invoked to let the hardware turn things back on. + + void + crtc->funcs->gamma_set (xf86CrtcPtr crtc, CARD16 *red, + CARD16 *green, CARD16 *blue, int size) + +This function adjusts the gamma ramps for the specified crtc. + + void * + crtc->funcs->shadow_allocate (xf86CrtcPtr crtc, int width, int height) + +This function allocates frame buffer space for a shadow frame buffer. When +allocated, the crtc must scan from the shadow instead of the main frame +buffer. This is used for rotation. The address returned is passed to the +shadow_create function. This function should return NULL on failure. + + PixmapPtr + crtc->funcs->shadow_create (xf86CrtcPtr crtc, void *data, + int width, int height) + +This function creates a pixmap object that will be used as a shadow of the +main frame buffer for CRTCs which are rotated or reflected. 'data' is the +value returned by shadow_allocate. + + void + crtc->funcs->shadow_destroy (xf86CrtcPtr crtc, PixmapPtr pPixmap, + void *data) + +Destroys any associated shadow objects. If pPixmap is NULL, then a pixmap +was not created, but 'data' may still be non-NULL indicating that the shadow +had been allocated. + + void + crtc->funcs->destroy (xf86CrtcPtr crtc) + +When a CRTC is destroyed (which only happens in error cases), this function +can clean up any driver-specific data. + +4.2 CRTC fields + +The CRTC object is not opaque; there are several fields of interest to the +driver writer. + + struct _xf86Crtc { + /** + * Associated ScrnInfo + */ + ScrnInfoPtr scrn; + + /** + * Active state of this CRTC + * + * Set when this CRTC is driving one or more outputs + */ + Bool enabled; + + /** Track whether cursor is within CRTC range */ + Bool cursorInRange; + + /** Track state of cursor associated with this CRTC */ + Bool cursorShown; + + /** + * Active mode + * + * This reflects the mode as set in the CRTC currently + * It will be cleared when the VT is not active or + * during server startup + */ + DisplayModeRec mode; + Rotation rotation; + PixmapPtr rotatedPixmap; + void *rotatedData; + + /** + * Position on screen + * + * Locates this CRTC within the frame buffer + */ + int x, y; + + /** + * Desired mode + * + * This is set to the requested mode, independent of + * whether the VT is active. In particular, it receives + * the startup configured mode and saves the active mode + * on VT switch. + */ + DisplayModeRec desiredMode; + Rotation desiredRotation; + int desiredX, desiredY; + + /** crtc-specific functions */ + const xf86CrtcFuncsRec *funcs; + + /** + * Driver private + * + * Holds driver-private information + */ + void *driver_private; + #ifdef RANDR_12_INTERFACE + /** + * RandR crtc + * + * When RandR 1.2 is available, this + * points at the associated crtc object + */ + RRCrtcPtr randr_crtc; + #else + void *randr_crtc; + #endif + }; + + +5. Output functions. + +6. Configuration + +Because the configuration file syntax is fixed, +this was done by creating new "Driver" section options that hook specific +outputs to specific "Monitor" sections in the file. The option: +section of the form: + + Option "monitor-VGA" "My VGA Monitor" + +connects the VGA output of this driver to the "Monitor" section with +Identifier "My VGA Monitor". All of the usual monitor options can now be +placed in that "Monitor" section and will be applied to the VGA output +configuration. From a3d2c5d622d9ca36d6fa2966aff09524e3ea39ac Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 7 Mar 2007 11:02:47 -0500 Subject: [PATCH 27/39] XORG_VERSION_CURRENT, not XF86_VERSION_CURRENT. If only this was the least wrong thing in this code. --- hw/xfree86/i2c/uda1380_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/i2c/uda1380_module.c b/hw/xfree86/i2c/uda1380_module.c index 384458326..895f8c6f2 100644 --- a/hw/xfree86/i2c/uda1380_module.c +++ b/hw/xfree86/i2c/uda1380_module.c @@ -12,7 +12,7 @@ static XF86ModuleVersionInfo uda1380VersRec = MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, - XF86_VERSION_CURRENT, + XORG_VERSION_CURRENT, 1, 0, 0, ABI_CLASS_VIDEODRV, /* This needs the video driver ABI */ ABI_VIDEODRV_VERSION, From b5fde366e2e21234ac0b81222fd5c42ca3e49cba Mon Sep 17 00:00:00 2001 From: Eamon Walsh Date: Wed, 7 Mar 2007 12:29:55 -0500 Subject: [PATCH 28/39] Properly free device devPrivates - memory leak fix. --- dix/devices.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dix/devices.c b/dix/devices.c index 9f4218414..d5acb2d4e 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -494,6 +494,9 @@ CloseDevice(register DeviceIntPtr dev) XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource); #endif + if (dev->devPrivates) + xfree(dev->devPrivates); + xfree(dev->sync.event); xfree(dev); } From 40ae4f246d8818410490236ab183204a84765629 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 7 Mar 2007 20:52:31 -0800 Subject: [PATCH 29/39] Remove stale monitor data when output becomes disconnected. Remove parsed EDID and EDID property from disconnected outputs. (cherry picked from commit ae9d5aa479dd50cc81b755079fcf96a0d02f135a) --- hw/xfree86/modes/xf86Crtc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 279449688..1a4292092 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -1158,7 +1158,10 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) output->status = (*output->funcs->detect)(output); if (output->status == XF86OutputStatusDisconnected) + { + xf86OutputSetEDID (output, NULL); continue; + } memset (&mon_rec, '\0', sizeof (mon_rec)); From 63169ce52d354b4345dcfc46b89f0ea88379718f Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 8 Mar 2007 17:50:19 +1030 Subject: [PATCH 30/39] dix: remove 'register' keyword for all variables. --- dix/atom.c | 8 +- dix/colormap.c | 56 +++++----- dix/cursor.c | 8 +- dix/devices.c | 70 ++++++------ dix/dispatch.c | 245 +++++++++++++++++++++--------------------- dix/dixfonts.c | 6 +- dix/dixutils.c | 10 +- dix/events.c | 188 ++++++++++++++++----------------- dix/extension.c | 24 ++--- dix/gc.c | 68 ++++++------ dix/glyphcurs.c | 8 +- dix/grabs.c | 8 +- dix/privates.c | 6 +- dix/property.c | 6 +- dix/resource.c | 68 ++++++------ dix/swaprep.c | 90 ++++++++-------- dix/swapreq.c | 276 ++++++++++++++++++++++++------------------------ dix/window.c | 200 +++++++++++++++++------------------ 18 files changed, 672 insertions(+), 673 deletions(-) diff --git a/dix/atom.c b/dix/atom.c index d9d74f1da..bd3223caa 100644 --- a/dix/atom.c +++ b/dix/atom.c @@ -77,10 +77,10 @@ void FreeAtom(NodePtr patom); _X_EXPORT Atom MakeAtom(char *string, unsigned len, Bool makeit) { - register NodePtr * np; + NodePtr * np; unsigned i; - int comp; - register unsigned int fp = 0; + int comp; + unsigned int fp = 0; np = &atomRoot; for (i = 0; i < (len+1)/2; i++) @@ -107,7 +107,7 @@ MakeAtom(char *string, unsigned len, Bool makeit) } if (makeit) { - register NodePtr nd; + NodePtr nd; nd = (NodePtr) xalloc(sizeof(NodeRec)); if (!nd) diff --git a/dix/colormap.c b/dix/colormap.c index a74cb390c..73b666971 100644 --- a/dix/colormap.c +++ b/dix/colormap.c @@ -95,8 +95,8 @@ static int BlueComp( ); static void FreePixels( - register ColormapPtr /*pmap*/, - register int /*client*/ + ColormapPtr /*pmap*/, + int /*client*/ ); static void CopyFree( @@ -259,9 +259,9 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, int class, size; unsigned long sizebytes; ColormapPtr pmap; - register EntryPtr pent; + EntryPtr pent; int i; - register Pixel *ppix, **pptr; + Pixel *ppix, **pptr; class = pVisual->class; if(!(class & DynamicClass) && (alloc != AllocNone) && (client != SERVER_ID)) @@ -428,8 +428,8 @@ CreateColormap (Colormap mid, ScreenPtr pScreen, VisualPtr pVisual, int FreeColormap (pointer value, XID mid) { - int i; - register EntryPtr pent; + int i; + EntryPtr pent; ColormapPtr pmap = (ColormapPtr)value; if(CLIENT_ID(mid) != SERVER_ID) @@ -744,9 +744,9 @@ static void UpdateColors (ColormapPtr pmap) { xColorItem *defs; - register xColorItem *pdef; - register EntryPtr pent; - register VisualPtr pVisual; + xColorItem *pdef; + EntryPtr pent; + VisualPtr pVisual; int i, n, size; pVisual = pmap->pVisual; @@ -993,14 +993,14 @@ AllocColor (ColormapPtr pmap, */ _X_EXPORT void -FakeAllocColor (register ColormapPtr pmap, register xColorItem *item) +FakeAllocColor (ColormapPtr pmap, xColorItem *item) { - Pixel pixR, pixG, pixB; - Pixel temp; - int entries; - xrgb rgb; - int class; - register VisualPtr pVisual; + Pixel pixR, pixG, pixB; + Pixel temp; + int entries; + xrgb rgb; + int class; + VisualPtr pVisual; pVisual = pmap->pVisual; rgb.red = item->red; @@ -1059,9 +1059,9 @@ FakeAllocColor (register ColormapPtr pmap, register xColorItem *item) /* free a pixel value obtained from FakeAllocColor */ _X_EXPORT void -FakeFreeColor(register ColormapPtr pmap, Pixel pixel) +FakeFreeColor(ColormapPtr pmap, Pixel pixel) { - register VisualPtr pVisual; + VisualPtr pVisual; Pixel pixR, pixG, pixB; switch (pmap->class) { @@ -1507,11 +1507,11 @@ QueryColors (ColormapPtr pmap, int count, Pixel *ppixIn, xrgb *prgbList) } static void -FreePixels(register ColormapPtr pmap, register int client) +FreePixels(ColormapPtr pmap, int client) { - register Pixel *ppix, *ppixStart; - register int n; - int class; + Pixel *ppix, *ppixStart; + int n; + int class; class = pmap->class; ppixStart = pmap->clientPixelsRed[client]; @@ -1646,8 +1646,8 @@ AllocColorPlanes (int client, ColormapPtr pmap, int colors, { int ok; Pixel mask, *ppixFirst; - register Pixel shift; - register int i; + Pixel shift; + int i; int class; int oldcount; colorResource *pcr = (colorResource *)NULL; @@ -2409,10 +2409,10 @@ FreeCo (ColormapPtr pmap, int client, int color, int npixIn, Pixel *ppixIn, Pixe _X_EXPORT int StoreColors (ColormapPtr pmap, int count, xColorItem *defs) { - register Pixel pix; - register xColorItem *pdef; - register EntryPtr pent, pentT, pentLast; - register VisualPtr pVisual; + Pixel pix; + xColorItem *pdef; + EntryPtr pent, pentT, pentLast; + VisualPtr pVisual; SHAREDCOLOR *pred, *pgreen, *pblue; int n, ChgRed, ChgGreen, ChgBlue, idef; int class, errVal = Success; diff --git a/dix/cursor.c b/dix/cursor.c index 7071d8345..5ab562ead 100644 --- a/dix/cursor.c +++ b/dix/cursor.c @@ -86,7 +86,7 @@ FreeCursorBits(CursorBitsPtr bits) #endif if (bits->refcnt == 0) { - register GlyphSharePtr *prev, this; + GlyphSharePtr *prev, this; for (prev = &sharedGlyphs; (this = *prev) && (this->bits != bits); @@ -135,7 +135,7 @@ FreeCursor(pointer value, XID cid) static void CheckForEmptyMask(CursorBitsPtr bits) { - register unsigned char *msk = bits->mask; + unsigned char *msk = bits->mask; int n = BitmapBytePad(bits->width) * bits->height; bits->emptyMask = FALSE; @@ -305,8 +305,8 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar, } if (!maskfont) { - register long n; - register unsigned char *mskptr; + long n; + unsigned char *mskptr; n = BitmapBytePad(cm.width)*(long)cm.height; mskptr = mskbits = (unsigned char *)xalloc(n); diff --git a/dix/devices.c b/dix/devices.c index d5acb2d4e..8eb54f770 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -84,7 +84,7 @@ int CoreDevicePrivatesIndex = 0, CoreDevicePrivatesGeneration = -1; DeviceIntPtr AddInputDevice(DeviceProc deviceProc, Bool autoStart) { - register DeviceIntPtr dev, *prev; /* not a typo */ + DeviceIntPtr dev, *prev; /* not a typo */ if (inputInfo.numDevices >= MAX_DEVICES) return (DeviceIntPtr)NULL; @@ -140,9 +140,9 @@ AddInputDevice(DeviceProc deviceProc, Bool autoStart) } Bool -EnableDevice(register DeviceIntPtr dev) +EnableDevice(DeviceIntPtr dev) { - register DeviceIntPtr *prev; + DeviceIntPtr *prev; int ret; for (prev = &inputInfo.off_devices; @@ -166,9 +166,9 @@ EnableDevice(register DeviceIntPtr dev) } Bool -DisableDevice(register DeviceIntPtr dev) +DisableDevice(DeviceIntPtr dev) { - register DeviceIntPtr *prev; + DeviceIntPtr *prev; for (prev = &inputInfo.devices; *prev && (*prev != dev); @@ -315,7 +315,7 @@ CorePointerProc(DeviceIntPtr pDev, int what) void InitCoreDevices() { - register DeviceIntPtr dev; + DeviceIntPtr dev; if (CoreDevicePrivatesGeneration != serverGeneration) { CoreDevicePrivatesIndex = AllocateDevicePrivateIndex(); @@ -374,7 +374,7 @@ InitCoreDevices() int InitAndStartDevices() { - register DeviceIntPtr dev, next; + DeviceIntPtr dev, next; for (dev = inputInfo.off_devices; dev; dev = dev->next) { DebugF("(dix) initialising device %d\n", dev->id); @@ -406,7 +406,7 @@ InitAndStartDevices() } static void -CloseDevice(register DeviceIntPtr dev) +CloseDevice(DeviceIntPtr dev) { KbdFeedbackPtr k, knext; PtrFeedbackPtr p, pnext; @@ -504,7 +504,7 @@ CloseDevice(register DeviceIntPtr dev) void CloseDownDevices() { - register DeviceIntPtr dev, next; + DeviceIntPtr dev, next; for (dev = inputInfo.devices; dev; dev = next) { @@ -634,7 +634,7 @@ QueryMinMaxKeyCodes(KeyCode *minCode, KeyCode *maxCode) } Bool -SetKeySymsMap(register KeySymsPtr dst, register KeySymsPtr src) +SetKeySymsMap(KeySymsPtr dst, KeySymsPtr src) { int i, j; int rowDif = src->minKeyCode - dst->minKeyCode; @@ -683,7 +683,7 @@ SetKeySymsMap(register KeySymsPtr dst, register KeySymsPtr src) } static Bool -InitModMap(register KeyClassPtr keyc) +InitModMap(KeyClassPtr keyc) { int i, j; CARD8 keysPerModifier[8]; @@ -728,7 +728,7 @@ _X_EXPORT Bool InitKeyClassDeviceStruct(DeviceIntPtr dev, KeySymsPtr pKeySyms, CARD8 pModifiers[]) { int i; - register KeyClassPtr keyc; + KeyClassPtr keyc; keyc = (KeyClassPtr)xalloc(sizeof(KeyClassRec)); if (!keyc) @@ -763,10 +763,10 @@ InitKeyClassDeviceStruct(DeviceIntPtr dev, KeySymsPtr pKeySyms, CARD8 pModifiers } _X_EXPORT Bool -InitButtonClassDeviceStruct(register DeviceIntPtr dev, int numButtons, +InitButtonClassDeviceStruct(DeviceIntPtr dev, int numButtons, CARD8 *map) { - register ButtonClassPtr butc; + ButtonClassPtr butc; int i; butc = (ButtonClassPtr)xalloc(sizeof(ButtonClassRec)); @@ -792,7 +792,7 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, int numMotionEvents, int mode) { int i; - register ValuatorClassPtr valc; + ValuatorClassPtr valc; if (!dev) return FALSE; @@ -834,7 +834,7 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, _X_EXPORT Bool InitAbsoluteClassDeviceStruct(DeviceIntPtr dev) { - register AbsoluteClassPtr abs; + AbsoluteClassPtr abs; abs = (AbsoluteClassPtr)xalloc(sizeof(AbsoluteClassRec)); if (!abs) @@ -864,7 +864,7 @@ InitAbsoluteClassDeviceStruct(DeviceIntPtr dev) _X_EXPORT Bool InitFocusClassDeviceStruct(DeviceIntPtr dev) { - register FocusClassPtr focc; + FocusClassPtr focc; focc = (FocusClassPtr)xalloc(sizeof(FocusClassRec)); if (!focc) @@ -883,7 +883,7 @@ _X_EXPORT Bool InitKbdFeedbackClassDeviceStruct(DeviceIntPtr dev, BellProcPtr bellProc, KbdCtrlProcPtr controlProc) { - register KbdFeedbackPtr feedc; + KbdFeedbackPtr feedc; feedc = (KbdFeedbackPtr)xalloc(sizeof(KbdFeedbackClassRec)); if (!feedc) @@ -910,7 +910,7 @@ InitKbdFeedbackClassDeviceStruct(DeviceIntPtr dev, BellProcPtr bellProc, _X_EXPORT Bool InitPtrFeedbackClassDeviceStruct(DeviceIntPtr dev, PtrCtrlProcPtr controlProc) { - register PtrFeedbackPtr feedc; + PtrFeedbackPtr feedc; feedc = (PtrFeedbackPtr)xalloc(sizeof(PtrFeedbackClassRec)); if (!feedc) @@ -948,7 +948,7 @@ InitStringFeedbackClassDeviceStruct ( int max_symbols, int num_symbols_supported, KeySym *symbols) { int i; - register StringFeedbackPtr feedc; + StringFeedbackPtr feedc; feedc = (StringFeedbackPtr)xalloc(sizeof(StringFeedbackClassRec)); if (!feedc) @@ -986,7 +986,7 @@ _X_EXPORT Bool InitBellFeedbackClassDeviceStruct (DeviceIntPtr dev, BellProcPtr bellProc, BellCtrlProcPtr controlProc) { - register BellFeedbackPtr feedc; + BellFeedbackPtr feedc; feedc = (BellFeedbackPtr)xalloc(sizeof(BellFeedbackClassRec)); if (!feedc) @@ -1005,7 +1005,7 @@ InitBellFeedbackClassDeviceStruct (DeviceIntPtr dev, BellProcPtr bellProc, _X_EXPORT Bool InitLedFeedbackClassDeviceStruct (DeviceIntPtr dev, LedCtrlProcPtr controlProc) { - register LedFeedbackPtr feedc; + LedFeedbackPtr feedc; feedc = (LedFeedbackPtr)xalloc(sizeof(LedFeedbackClassRec)); if (!feedc) @@ -1026,7 +1026,7 @@ InitLedFeedbackClassDeviceStruct (DeviceIntPtr dev, LedCtrlProcPtr controlProc) _X_EXPORT Bool InitIntegerFeedbackClassDeviceStruct (DeviceIntPtr dev, IntegerCtrlProcPtr controlProc) { - register IntegerFeedbackPtr feedc; + IntegerFeedbackPtr feedc; feedc = (IntegerFeedbackPtr)xalloc(sizeof(IntegerFeedbackClassRec)); if (!feedc) @@ -1112,9 +1112,9 @@ SendMappingNotify(unsigned request, unsigned firstKeyCode, unsigned count, * sort it to do the checking. How often is it called? Just being lazy? */ Bool -BadDeviceMap(register BYTE *buff, int length, unsigned low, unsigned high, XID *errval) +BadDeviceMap(BYTE *buff, int length, unsigned low, unsigned high, XID *errval) { - register int i, j; + int i, j; for (i = 0; i < length; i++) if (buff[i]) /* only check non-zero elements */ @@ -1136,12 +1136,12 @@ BadDeviceMap(register BYTE *buff, int length, unsigned low, unsigned high, XID * Bool AllModifierKeysAreUp(dev, map1, per1, map2, per2) - register DeviceIntPtr dev; - register CARD8 *map1, *map2; + DeviceIntPtr dev; + CARD8 *map1, *map2; int per1, per2; { - register int i, j, k; - register CARD8 *down = dev->key->down; + int i, j, k; + CARD8 *down = dev->key->down; for (i = 8; --i >= 0; map2 += per2) { @@ -1258,7 +1258,7 @@ int ProcGetModifierMapping(ClientPtr client) { xGetModifierMappingReply rep; - register KeyClassPtr keyc = inputInfo.keyboard->key; + KeyClassPtr keyc = inputInfo.keyboard->key; REQUEST_SIZE_MATCH(xReq); rep.type = X_Reply; @@ -1459,7 +1459,7 @@ NoteLedState(DeviceIntPtr keybd, int led, Bool on) _X_EXPORT int Ones(unsigned long mask) /* HACKMEM 169 */ { - register unsigned long y; + unsigned long y; y = (mask >> 1) &033333333333; y = mask - y - ((y >>1) & 033333333333); @@ -1676,7 +1676,7 @@ int ProcGetKeyboardControl (ClientPtr client) { int i; - register KeybdCtrl *ctrl = &inputInfo.keyboard->kbdfeed->ctrl; + KeybdCtrl *ctrl = &inputInfo.keyboard->kbdfeed->ctrl; xGetKeyboardControlReply rep; REQUEST_SIZE_MATCH(xReq); @@ -1698,7 +1698,7 @@ ProcGetKeyboardControl (ClientPtr client) int ProcBell(ClientPtr client) { - register DeviceIntPtr keybd = inputInfo.keyboard; + DeviceIntPtr keybd = inputInfo.keyboard; int base = keybd->kbdfeed->ctrl.bell; int newpercent; REQUEST(xBellReq); @@ -1807,7 +1807,7 @@ ProcChangePointerControl(ClientPtr client) int ProcGetPointerControl(ClientPtr client) { - register PtrCtrl *ctrl = &inputInfo.pointer->ptrfeed->ctrl; + PtrCtrl *ctrl = &inputInfo.pointer->ptrfeed->ctrl; xGetPointerControlReply rep; REQUEST_SIZE_MATCH(xReq); @@ -1822,7 +1822,7 @@ ProcGetPointerControl(ClientPtr client) } void -MaybeStopHint(register DeviceIntPtr dev, ClientPtr client) +MaybeStopHint(DeviceIntPtr dev, ClientPtr client) { GrabPtr grab = dev->grab; diff --git a/dix/dispatch.c b/dix/dispatch.c index d44687ec3..b258aa6f4 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -262,7 +262,7 @@ void FlushClientCaches(XID id) { int i; - register ClientPtr client; + ClientPtr client; client = clients[CLIENT_ID(id)]; if (client == NullClient) @@ -394,11 +394,11 @@ SmartScheduleClient (int *clientReady, int nready) void Dispatch(void) { - register int *clientReady; /* array of request ready clients */ - register int result; - register ClientPtr client; - register int nready; - register HWEventQueuePtr* icheck = checkForInput; + int *clientReady; /* array of request ready clients */ + int result; + ClientPtr client; + int nready; + HWEventQueuePtr* icheck = checkForInput; #ifdef SMART_SCHEDULE long start_tick; #endif @@ -594,11 +594,11 @@ ProcCreateWindow(ClientPtr client) } int -ProcChangeWindowAttributes(register ClientPtr client) +ProcChangeWindowAttributes(ClientPtr client) { WindowPtr pWin; REQUEST(xChangeWindowAttributesReq); - register int result; + int result; int len, rc; REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq); @@ -619,7 +619,7 @@ ProcChangeWindowAttributes(register ClientPtr client) } int -ProcGetWindowAttributes(register ClientPtr client) +ProcGetWindowAttributes(ClientPtr client) { WindowPtr pWin; REQUEST(xResourceReq); @@ -636,7 +636,7 @@ ProcGetWindowAttributes(register ClientPtr client) } int -ProcDestroyWindow(register ClientPtr client) +ProcDestroyWindow(ClientPtr client) { WindowPtr pWin; REQUEST(xResourceReq); @@ -652,7 +652,7 @@ ProcDestroyWindow(register ClientPtr client) } int -ProcDestroySubwindows(register ClientPtr client) +ProcDestroySubwindows(ClientPtr client) { WindowPtr pWin; REQUEST(xResourceReq); @@ -667,11 +667,11 @@ ProcDestroySubwindows(register ClientPtr client) } int -ProcChangeSaveSet(register ClientPtr client) +ProcChangeSaveSet(ClientPtr client) { WindowPtr pWin; REQUEST(xChangeSaveSetReq); - register int result, rc; + int result, rc; REQUEST_SIZE_MATCH(xChangeSaveSetReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess); @@ -695,11 +695,11 @@ ProcChangeSaveSet(register ClientPtr client) } int -ProcReparentWindow(register ClientPtr client) +ProcReparentWindow(ClientPtr client) { WindowPtr pWin, pParent; REQUEST(xReparentWindowReq); - register int result, rc; + int result, rc; REQUEST_SIZE_MATCH(xReparentWindowReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixWriteAccess); @@ -728,7 +728,7 @@ ProcReparentWindow(register ClientPtr client) } int -ProcMapWindow(register ClientPtr client) +ProcMapWindow(ClientPtr client) { WindowPtr pWin; REQUEST(xResourceReq); @@ -744,7 +744,7 @@ ProcMapWindow(register ClientPtr client) } int -ProcMapSubwindows(register ClientPtr client) +ProcMapSubwindows(ClientPtr client) { WindowPtr pWin; REQUEST(xResourceReq); @@ -760,7 +760,7 @@ ProcMapSubwindows(register ClientPtr client) } int -ProcUnmapWindow(register ClientPtr client) +ProcUnmapWindow(ClientPtr client) { WindowPtr pWin; REQUEST(xResourceReq); @@ -776,7 +776,7 @@ ProcUnmapWindow(register ClientPtr client) } int -ProcUnmapSubwindows(register ClientPtr client) +ProcUnmapSubwindows(ClientPtr client) { WindowPtr pWin; REQUEST(xResourceReq); @@ -791,11 +791,11 @@ ProcUnmapSubwindows(register ClientPtr client) } int -ProcConfigureWindow(register ClientPtr client) +ProcConfigureWindow(ClientPtr client) { WindowPtr pWin; REQUEST(xConfigureWindowReq); - register int result; + int result; int len, rc; REQUEST_AT_LEAST_SIZE(xConfigureWindowReq); @@ -814,7 +814,7 @@ ProcConfigureWindow(register ClientPtr client) } int -ProcCirculateWindow(register ClientPtr client) +ProcCirculateWindow(ClientPtr client) { WindowPtr pWin; REQUEST(xCirculateWindowReq); @@ -835,7 +835,7 @@ ProcCirculateWindow(register ClientPtr client) } int -GetGeometry(register ClientPtr client, xGetGeometryReply *rep) +GetGeometry(ClientPtr client, xGetGeometryReply *rep) { DrawablePtr pDraw; int rc; @@ -865,7 +865,7 @@ GetGeometry(register ClientPtr client, xGetGeometryReply *rep) if ((pDraw->type == UNDRAWABLE_WINDOW) || ((pDraw->type == DRAWABLE_WINDOW) && (stuff->id == pDraw->id))) { - register WindowPtr pWin = (WindowPtr)pDraw; + WindowPtr pWin = (WindowPtr)pDraw; rep->x = pWin->origin.x - wBorderWidth (pWin); rep->y = pWin->origin.y - wBorderWidth (pWin); rep->borderWidth = pWin->borderWidth; @@ -880,7 +880,7 @@ GetGeometry(register ClientPtr client, xGetGeometryReply *rep) int -ProcGetGeometry(register ClientPtr client) +ProcGetGeometry(ClientPtr client) { xGetGeometryReply rep; int status; @@ -894,7 +894,7 @@ ProcGetGeometry(register ClientPtr client) int -ProcQueryTree(register ClientPtr client) +ProcQueryTree(ClientPtr client) { xQueryTreeReply reply; int rc, numChildren = 0; @@ -942,7 +942,7 @@ ProcQueryTree(register ClientPtr client) } int -ProcInternAtom(register ClientPtr client) +ProcInternAtom(ClientPtr client) { Atom atom; char *tchar; @@ -971,7 +971,7 @@ ProcInternAtom(register ClientPtr client) } int -ProcGetAtomName(register ClientPtr client) +ProcGetAtomName(ClientPtr client) { char *str; xGetAtomNameReply reply; @@ -1002,7 +1002,7 @@ extern int k5_bad(); #endif int -ProcSetSelectionOwner(register ClientPtr client) +ProcSetSelectionOwner(ClientPtr client) { WindowPtr pWin; TimeStamp time; @@ -1097,7 +1097,7 @@ ProcSetSelectionOwner(register ClientPtr client) } int -ProcGetSelectionOwner(register ClientPtr client) +ProcGetSelectionOwner(ClientPtr client) { REQUEST(xResourceReq); @@ -1128,7 +1128,7 @@ ProcGetSelectionOwner(register ClientPtr client) } int -ProcConvertSelection(register ClientPtr client) +ProcConvertSelection(ClientPtr client) { Bool paramsOkay; xEvent event; @@ -1188,7 +1188,7 @@ ProcConvertSelection(register ClientPtr client) } int -ProcGrabServer(register ClientPtr client) +ProcGrabServer(ClientPtr client) { REQUEST_SIZE_MATCH(xReq); if (grabState != GrabNone && client != grabClient) @@ -1242,7 +1242,7 @@ UngrabServer(ClientPtr client) } int -ProcUngrabServer(register ClientPtr client) +ProcUngrabServer(ClientPtr client) { REQUEST_SIZE_MATCH(xReq); UngrabServer(client); @@ -1250,7 +1250,7 @@ ProcUngrabServer(register ClientPtr client) } int -ProcTranslateCoords(register ClientPtr client) +ProcTranslateCoords(ClientPtr client) { REQUEST(xTranslateCoordsReq); @@ -1327,7 +1327,7 @@ ProcTranslateCoords(register ClientPtr client) } int -ProcOpenFont(register ClientPtr client) +ProcOpenFont(ClientPtr client) { int err; REQUEST(xOpenFontReq); @@ -1346,7 +1346,7 @@ ProcOpenFont(register ClientPtr client) } int -ProcCloseFont(register ClientPtr client) +ProcCloseFont(ClientPtr client) { FontPtr pFont; REQUEST(xResourceReq); @@ -1367,11 +1367,11 @@ ProcCloseFont(register ClientPtr client) } int -ProcQueryFont(register ClientPtr client) +ProcQueryFont(ClientPtr client) { xQueryFontReply *reply; FontPtr pFont; - register GC *pGC; + GC *pGC; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); @@ -1425,7 +1425,7 @@ ProcQueryFont(register ClientPtr client) } int -ProcQueryTextExtents(register ClientPtr client) +ProcQueryTextExtents(ClientPtr client) { REQUEST(xQueryTextExtentsReq); xQueryTextExtentsReply reply; @@ -1475,7 +1475,7 @@ ProcQueryTextExtents(register ClientPtr client) } int -ProcListFonts(register ClientPtr client) +ProcListFonts(ClientPtr client) { REQUEST(xListFontsReq); @@ -1486,7 +1486,7 @@ ProcListFonts(register ClientPtr client) } int -ProcListFontsWithInfo(register ClientPtr client) +ProcListFontsWithInfo(ClientPtr client) { REQUEST(xListFontsWithInfoReq); @@ -1508,13 +1508,13 @@ dixDestroyPixmap(pointer value, XID pid) } int -ProcCreatePixmap(register ClientPtr client) +ProcCreatePixmap(ClientPtr client) { PixmapPtr pMap; DrawablePtr pDraw; REQUEST(xCreatePixmapReq); DepthPtr pDepth; - register int i, rc; + int i, rc; REQUEST_SIZE_MATCH(xCreatePixmapReq); client->errorValue = stuff->pid; @@ -1571,7 +1571,7 @@ CreatePmap: } int -ProcFreePixmap(register ClientPtr client) +ProcFreePixmap(ClientPtr client) { PixmapPtr pMap; @@ -1593,7 +1593,7 @@ ProcFreePixmap(register ClientPtr client) } int -ProcCreateGC(register ClientPtr client) +ProcCreateGC(ClientPtr client) { int error, rc; GC *pGC; @@ -1621,7 +1621,7 @@ ProcCreateGC(register ClientPtr client) } int -ProcChangeGC(register ClientPtr client) +ProcChangeGC(ClientPtr client) { GC *pGC; int result; @@ -1648,7 +1648,7 @@ ProcChangeGC(register ClientPtr client) } int -ProcCopyGC(register ClientPtr client) +ProcCopyGC(ClientPtr client) { GC *dstGC; GC *pGC; @@ -1675,7 +1675,7 @@ ProcCopyGC(register ClientPtr client) } int -ProcSetDashes(register ClientPtr client) +ProcSetDashes(ClientPtr client) { GC *pGC; int result; @@ -1704,7 +1704,7 @@ ProcSetDashes(register ClientPtr client) } int -ProcSetClipRectangles(register ClientPtr client) +ProcSetClipRectangles(ClientPtr client) { int nr, result; GC *pGC; @@ -1734,7 +1734,7 @@ ProcSetClipRectangles(register ClientPtr client) } int -ProcFreeGC(register ClientPtr client) +ProcFreeGC(ClientPtr client) { GC *pGC; int rc; @@ -1750,7 +1750,7 @@ ProcFreeGC(register ClientPtr client) } int -ProcClearToBackground(register ClientPtr client) +ProcClearToBackground(ClientPtr client) { REQUEST(xClearAreaReq); WindowPtr pWin; @@ -1777,7 +1777,7 @@ ProcClearToBackground(register ClientPtr client) } int -ProcCopyArea(register ClientPtr client) +ProcCopyArea(ClientPtr client) { DrawablePtr pDst; DrawablePtr pSrc; @@ -1821,7 +1821,7 @@ ProcCopyArea(register ClientPtr client) } int -ProcCopyPlane(register ClientPtr client) +ProcCopyPlane(ClientPtr client) { DrawablePtr psrcDraw, pdstDraw; GC *pGC; @@ -1872,7 +1872,7 @@ ProcCopyPlane(register ClientPtr client) } int -ProcPolyPoint(register ClientPtr client) +ProcPolyPoint(ClientPtr client) { int npoint; GC *pGC; @@ -1895,7 +1895,7 @@ ProcPolyPoint(register ClientPtr client) } int -ProcPolyLine(register ClientPtr client) +ProcPolyLine(ClientPtr client) { int npoint; GC *pGC; @@ -1918,7 +1918,7 @@ ProcPolyLine(register ClientPtr client) } int -ProcPolySegment(register ClientPtr client) +ProcPolySegment(ClientPtr client) { int nsegs; GC *pGC; @@ -1937,7 +1937,7 @@ ProcPolySegment(register ClientPtr client) } int -ProcPolyRectangle (register ClientPtr client) +ProcPolyRectangle (ClientPtr client) { int nrects; GC *pGC; @@ -1957,7 +1957,7 @@ ProcPolyRectangle (register ClientPtr client) } int -ProcPolyArc(register ClientPtr client) +ProcPolyArc(ClientPtr client) { int narcs; GC *pGC; @@ -1976,7 +1976,7 @@ ProcPolyArc(register ClientPtr client) } int -ProcFillPoly(register ClientPtr client) +ProcFillPoly(ClientPtr client) { int things; GC *pGC; @@ -2007,7 +2007,7 @@ ProcFillPoly(register ClientPtr client) } int -ProcPolyFillRectangle(register ClientPtr client) +ProcPolyFillRectangle(ClientPtr client) { int things; GC *pGC; @@ -2028,7 +2028,7 @@ ProcPolyFillRectangle(register ClientPtr client) } int -ProcPolyFillArc(register ClientPtr client) +ProcPolyFillArc(ClientPtr client) { int narcs; GC *pGC; @@ -2101,7 +2101,7 @@ ReformatImage (char *base, int nbytes, int bpp, int order) * boundary, even if the scanlines are padded to our satisfaction. */ int -ProcPutImage(register ClientPtr client) +ProcPutImage(ClientPtr client) { GC *pGC; DrawablePtr pDraw; @@ -2159,13 +2159,13 @@ ProcPutImage(register ClientPtr client) int -DoGetImage(register ClientPtr client, int format, Drawable drawable, +DoGetImage(ClientPtr client, int format, Drawable drawable, int x, int y, int width, int height, Mask planemask, xGetImageReply **im_return) { DrawablePtr pDraw; int nlines, linesPerBuf, rc; - register int linesDone; + int linesDone; long widthBytesLine, length; Mask plane = 0; char *pBuf; @@ -2379,7 +2379,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable, } int -ProcGetImage(register ClientPtr client) +ProcGetImage(ClientPtr client) { REQUEST(xGetImageReq); @@ -2392,7 +2392,7 @@ ProcGetImage(register ClientPtr client) } int -ProcPolyText(register ClientPtr client) +ProcPolyText(ClientPtr client) { int err; REQUEST(xPolyTextReq); @@ -2421,7 +2421,7 @@ ProcPolyText(register ClientPtr client) } int -ProcImageText8(register ClientPtr client) +ProcImageText8(ClientPtr client) { int err; DrawablePtr pDraw; @@ -2451,7 +2451,7 @@ ProcImageText8(register ClientPtr client) } int -ProcImageText16(register ClientPtr client) +ProcImageText16(ClientPtr client) { int err; DrawablePtr pDraw; @@ -2482,7 +2482,7 @@ ProcImageText16(register ClientPtr client) int -ProcCreateColormap(register ClientPtr client) +ProcCreateColormap(ClientPtr client) { VisualPtr pVisual; ColormapPtr pmap; @@ -2524,7 +2524,7 @@ ProcCreateColormap(register ClientPtr client) } int -ProcFreeColormap(register ClientPtr client) +ProcFreeColormap(ClientPtr client) { ColormapPtr pmap; REQUEST(xResourceReq); @@ -2548,7 +2548,7 @@ ProcFreeColormap(register ClientPtr client) int -ProcCopyColormapAndFree(register ClientPtr client) +ProcCopyColormapAndFree(ClientPtr client) { Colormap mid; ColormapPtr pSrcMap; @@ -2575,7 +2575,7 @@ ProcCopyColormapAndFree(register ClientPtr client) } int -ProcInstallColormap(register ClientPtr client) +ProcInstallColormap(ClientPtr client) { ColormapPtr pcmp; REQUEST(xResourceReq); @@ -2596,7 +2596,7 @@ ProcInstallColormap(register ClientPtr client) } int -ProcUninstallColormap(register ClientPtr client) +ProcUninstallColormap(ClientPtr client) { ColormapPtr pcmp; REQUEST(xResourceReq); @@ -2618,7 +2618,7 @@ ProcUninstallColormap(register ClientPtr client) } int -ProcListInstalledColormaps(register ClientPtr client) +ProcListInstalledColormaps(ClientPtr client) { xListInstalledColormapsReply *preply; int nummaps, rc; @@ -2651,7 +2651,7 @@ ProcListInstalledColormaps(register ClientPtr client) } int -ProcAllocColor (register ClientPtr client) +ProcAllocColor (ClientPtr client) { ColormapPtr pmap; int retval; @@ -2693,7 +2693,7 @@ ProcAllocColor (register ClientPtr client) } int -ProcAllocNamedColor (register ClientPtr client) +ProcAllocNamedColor (ClientPtr client) { ColormapPtr pcmp; REQUEST(xAllocNamedColorReq); @@ -2745,7 +2745,7 @@ ProcAllocNamedColor (register ClientPtr client) } int -ProcAllocColorCells (register ClientPtr client) +ProcAllocColorCells (ClientPtr client) { ColormapPtr pcmp; REQUEST(xAllocColorCellsReq); @@ -2811,7 +2811,7 @@ ProcAllocColorCells (register ClientPtr client) } int -ProcAllocColorPlanes(register ClientPtr client) +ProcAllocColorPlanes(ClientPtr client) { ColormapPtr pcmp; REQUEST(xAllocColorPlanesReq); @@ -2875,7 +2875,7 @@ ProcAllocColorPlanes(register ClientPtr client) } int -ProcFreeColors(register ClientPtr client) +ProcFreeColors(ClientPtr client) { ColormapPtr pcmp; REQUEST(xFreeColorsReq); @@ -2944,7 +2944,7 @@ ProcStoreColors (ClientPtr client) } int -ProcStoreNamedColor (register ClientPtr client) +ProcStoreNamedColor (ClientPtr client) { ColormapPtr pcmp; REQUEST(xStoreNamedColorReq); @@ -2978,7 +2978,7 @@ ProcStoreNamedColor (register ClientPtr client) } int -ProcQueryColors(register ClientPtr client) +ProcQueryColors(ClientPtr client) { ColormapPtr pcmp; REQUEST(xQueryColorsReq); @@ -3029,7 +3029,7 @@ ProcQueryColors(register ClientPtr client) } int -ProcLookupColor(register ClientPtr client) +ProcLookupColor(ClientPtr client) { ColormapPtr pcmp; REQUEST(xLookupColorReq); @@ -3067,17 +3067,16 @@ ProcLookupColor(register ClientPtr client) } int -ProcCreateCursor (register ClientPtr client) +ProcCreateCursor (ClientPtr client) { - CursorPtr pCursor; - - register PixmapPtr src; - register PixmapPtr msk; + CursorPtr pCursor; + PixmapPtr src; + PixmapPtr msk; unsigned char * srcbits; unsigned char * mskbits; unsigned short width, height; long n; - CursorMetricRec cm; + CursorMetricRec cm; REQUEST(xCreateCursorReq); @@ -3132,7 +3131,7 @@ ProcCreateCursor (register ClientPtr client) XYPixmap, 1, (pointer)srcbits); if ( msk == (PixmapPtr)NULL) { - register unsigned char *bits = mskbits; + unsigned char *bits = mskbits; while (--n >= 0) *bits++ = ~0; } @@ -3157,7 +3156,7 @@ ProcCreateCursor (register ClientPtr client) } int -ProcCreateGlyphCursor (register ClientPtr client) +ProcCreateGlyphCursor (ClientPtr client) { CursorPtr pCursor; int res; @@ -3181,7 +3180,7 @@ ProcCreateGlyphCursor (register ClientPtr client) int -ProcFreeCursor (register ClientPtr client) +ProcFreeCursor (ClientPtr client) { CursorPtr pCursor; REQUEST(xResourceReq); @@ -3202,7 +3201,7 @@ ProcFreeCursor (register ClientPtr client) } int -ProcQueryBestSize (register ClientPtr client) +ProcQueryBestSize (ClientPtr client) { xQueryBestSizeReply reply; DrawablePtr pDraw; @@ -3239,7 +3238,7 @@ ProcQueryBestSize (register ClientPtr client) int -ProcSetScreenSaver (register ClientPtr client) +ProcSetScreenSaver (ClientPtr client) { int blankingOption, exposureOption; REQUEST(xSetScreenSaverReq); @@ -3295,7 +3294,7 @@ ProcSetScreenSaver (register ClientPtr client) } int -ProcGetScreenSaver(register ClientPtr client) +ProcGetScreenSaver(ClientPtr client) { xGetScreenSaverReply rep; @@ -3312,7 +3311,7 @@ ProcGetScreenSaver(register ClientPtr client) } int -ProcChangeHosts(register ClientPtr client) +ProcChangeHosts(ClientPtr client) { REQUEST(xChangeHostsReq); int result; @@ -3336,7 +3335,7 @@ ProcChangeHosts(register ClientPtr client) } int -ProcListHosts(register ClientPtr client) +ProcListHosts(ClientPtr client) { xListHostsReply reply; int len, nHosts, result; @@ -3367,7 +3366,7 @@ ProcListHosts(register ClientPtr client) } int -ProcChangeAccessControl(register ClientPtr client) +ProcChangeAccessControl(ClientPtr client) { int result; REQUEST(xSetAccessControlReq); @@ -3385,7 +3384,7 @@ ProcChangeAccessControl(register ClientPtr client) } int -ProcKillClient(register ClientPtr client) +ProcKillClient(ClientPtr client) { REQUEST(xResourceReq); ClientPtr killclient; @@ -3417,7 +3416,7 @@ ProcKillClient(register ClientPtr client) } int -ProcSetFontPath(register ClientPtr client) +ProcSetFontPath(ClientPtr client) { unsigned char *ptr; unsigned long nbytes, total; @@ -3452,7 +3451,7 @@ ProcSetFontPath(register ClientPtr client) } int -ProcGetFontPath(register ClientPtr client) +ProcGetFontPath(ClientPtr client) { xGetFontPathReply reply; int stringLens, numpaths; @@ -3474,7 +3473,7 @@ ProcGetFontPath(register ClientPtr client) } int -ProcChangeCloseDownMode(register ClientPtr client) +ProcChangeCloseDownMode(ClientPtr client) { REQUEST(xSetCloseDownModeReq); @@ -3493,7 +3492,7 @@ ProcChangeCloseDownMode(register ClientPtr client) } } -int ProcForceScreenSaver(register ClientPtr client) +int ProcForceScreenSaver(ClientPtr client) { REQUEST(xForceScreenSaverReq); @@ -3509,7 +3508,7 @@ int ProcForceScreenSaver(register ClientPtr client) return client->noClientException; } -int ProcNoOperation(register ClientPtr client) +int ProcNoOperation(ClientPtr client) { REQUEST_AT_LEAST_SIZE(xReq); @@ -3552,7 +3551,7 @@ InitProcVectors(void) char dispatchExceptionAtReset = DE_RESET; void -CloseDownClient(register ClientPtr client) +CloseDownClient(ClientPtr client) { Bool really_close_down = client->clientGone || client->closeDownMode == DestroyAll; @@ -3662,8 +3661,8 @@ KillAllClients() void CloseDownRetainedResources() { - register int i; - register ClientPtr client; + int i; + ClientPtr client; for (i=1; icurrentInputMask = WindowTable[i]->eventMask | wOtherEventMasks (WindowTable[i]); @@ -3956,10 +3955,10 @@ SendConnSetup(register ClientPtr client, char *reason) } int -ProcEstablishConnection(register ClientPtr client) +ProcEstablishConnection(ClientPtr client) { char *reason, *auth_proto, *auth_string; - register xConnClientPrefix *prefix; + xConnClientPrefix *prefix; REQUEST(xReq); prefix = (xConnClientPrefix *)((char *)stuff + sz_xReq); @@ -4008,7 +4007,7 @@ SendErrorToClient(ClientPtr client, unsigned majorCode, unsigned minorCode, void DeleteWindowFromAnySelections(WindowPtr pWin) { - register int i; + int i; for (i = 0; i< NumCurrentSelections; i++) if (CurrentSelections[i].pWin == pWin) @@ -4030,7 +4029,7 @@ DeleteWindowFromAnySelections(WindowPtr pWin) static void DeleteClientFromAnySelections(ClientPtr client) { - register int i; + int i; for (i = 0; i< NumCurrentSelections; i++) if (CurrentSelections[i].client == client) diff --git a/dix/dixfonts.c b/dix/dixfonts.c index 5f087a31a..62ad575c9 100644 --- a/dix/dixfonts.c +++ b/dix/dixfonts.c @@ -1145,9 +1145,9 @@ static XID clearGC[] = { CT_NONE }; #define clearGCmask (GCClipMask) int -doPolyText(ClientPtr client, register PTclosurePtr c) +doPolyText(ClientPtr client, PTclosurePtr c) { - register FontPtr pFont = c->pGC->font, oldpFont; + FontPtr pFont = c->pGC->font, oldpFont; Font fid, oldfid; int err = Success, lgerr; /* err is in X error, not font error, space */ enum { NEVER_SLEPT, START_SLEEP, SLEEPING } client_state = NEVER_SLEPT; @@ -1447,7 +1447,7 @@ PolyText(ClientPtr client, DrawablePtr pDraw, GC *pGC, unsigned char *pElt, #undef FontShiftSize int -doImageText(ClientPtr client, register ITclosurePtr c) +doImageText(ClientPtr client, ITclosurePtr c) { int err = Success, lgerr; /* err is in X error, not font error, space */ FontPathElementPtr fpe; diff --git a/dix/dixutils.c b/dix/dixutils.c index e530360fe..c0728da71 100644 --- a/dix/dixutils.c +++ b/dix/dixutils.c @@ -168,7 +168,7 @@ ISOLatin1ToLower (unsigned char source) _X_EXPORT void CopyISOLatin1Lowered(unsigned char *dest, unsigned char *source, int length) { - register int i; + int i; for (i = 0; i < length; i++, source++, dest++) *dest = ISOLatin1ToLower (*source); @@ -392,8 +392,8 @@ AlterSaveSetForClient(ClientPtr client, WindowPtr pWin, unsigned mode, void DeleteWindowFromAnySaveSet(WindowPtr pWin) { - register int i; - register ClientPtr client; + int i; + ClientPtr client; for (i = 0; i< currentMaxClients; i++) { @@ -434,7 +434,7 @@ static Bool handlerDeleted; void BlockHandler(pointer pTimeout, pointer pReadmask) { - register int i, j; + int i, j; ++inHandler; for (i = 0; i < screenInfo.numScreens; i++) @@ -468,7 +468,7 @@ BlockHandler(pointer pTimeout, pointer pReadmask) void WakeupHandler(int result, pointer pReadmask) { - register int i, j; + int i, j; ++inHandler; for (i = numHandlers - 1; i >= 0; i--) diff --git a/dix/events.c b/dix/events.c index 0053f42d4..c0b62b826 100644 --- a/dix/events.c +++ b/dix/events.c @@ -761,8 +761,8 @@ CheckPhysLimits( static void CheckVirtualMotion( - register QdEventPtr qe, - register WindowPtr pWin) + QdEventPtr qe, + WindowPtr pWin) { #ifdef PANORAMIX if(!noPanoramiXExtension) { @@ -875,7 +875,7 @@ ChangeToCursor(CursorPtr cursor) /* returns true if b is a descendent of a */ Bool -IsParent(register WindowPtr a, register WindowPtr b) +IsParent(WindowPtr a, WindowPtr b) { for (b = b->parent; b; b = b->parent) if (b == a) return TRUE; @@ -885,8 +885,8 @@ IsParent(register WindowPtr a, register WindowPtr b) static void PostNewCursor(void) { - register WindowPtr win; - register GrabPtr grab = inputInfo.pointer->grab; + WindowPtr win; + GrabPtr grab = inputInfo.pointer->grab; if (syncEvents.playingEvents) return; @@ -952,7 +952,7 @@ XineramaGetCursorScreen() #define TIMESLOP (5 * 60 * 1000) /* 5 minutes */ static void -MonthChangedOrBadTime(register xEvent *xE) +MonthChangedOrBadTime(xEvent *xE) { /* If the ddx/OS is careless about not processing timestamped events from * different sources in sorted order, then it's possible for time to go @@ -971,7 +971,7 @@ MonthChangedOrBadTime(register xEvent *xE) lastDeviceEventTime = currentTime; } void -NoticeEventTime(register xEvent *xE) +NoticeEventTime(xEvent *xE) { if (!syncEvents.playingEvents) NoticeTime(xE); @@ -984,8 +984,8 @@ NoticeEventTime(register xEvent *xE) void EnqueueEvent(xEvent *xE, DeviceIntPtr device, int count) { - register QdEventPtr tail = *syncEvents.pendtail; - register QdEventPtr qe; + QdEventPtr tail = *syncEvents.pendtail; + QdEventPtr qe; xEvent *qxE; NoticeTime(xE); @@ -1059,8 +1059,8 @@ EnqueueEvent(xEvent *xE, DeviceIntPtr device, int count) static void PlayReleasedEvents(void) { - register QdEventPtr *prev, qe; - register DeviceIntPtr dev; + QdEventPtr *prev, qe; + DeviceIntPtr dev; prev = &syncEvents.pending; while ( (qe = *prev) ) @@ -1104,7 +1104,7 @@ PlayReleasedEvents(void) } static void -FreezeThaw(register DeviceIntPtr dev, Bool frozen) +FreezeThaw(DeviceIntPtr dev, Bool frozen) { dev->sync.frozen = frozen; if (frozen) @@ -1116,13 +1116,13 @@ FreezeThaw(register DeviceIntPtr dev, Bool frozen) void ComputeFreezes() { - register DeviceIntPtr replayDev = syncEvents.replayDev; - register int i; + DeviceIntPtr replayDev = syncEvents.replayDev; + int i; WindowPtr w; - register xEvent *xE; + xEvent *xE; int count; GrabPtr grab; - register DeviceIntPtr dev; + DeviceIntPtr dev; for (dev = inputInfo.devices; dev; dev = dev->next) FreezeThaw(dev, dev->sync.other || (dev->sync.state >= FROZEN)); @@ -1198,10 +1198,10 @@ ScreenRestructured (ScreenPtr pScreen) #endif void -CheckGrabForSyncs(register DeviceIntPtr thisDev, Bool thisMode, Bool otherMode) +CheckGrabForSyncs(DeviceIntPtr thisDev, Bool thisMode, Bool otherMode) { - register GrabPtr grab = thisDev->grab; - register DeviceIntPtr dev; + GrabPtr grab = thisDev->grab; + DeviceIntPtr dev; if (thisMode == GrabModeSync) thisDev->sync.state = FROZEN_NO_EVENT; @@ -1232,7 +1232,7 @@ CheckGrabForSyncs(register DeviceIntPtr thisDev, Bool thisMode, Bool otherMode) } void -ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab, +ActivatePointerGrab(DeviceIntPtr mouse, GrabPtr grab, TimeStamp time, Bool autoGrab) { WindowPtr oldWin = (mouse->grab) ? mouse->grab->window @@ -1260,10 +1260,10 @@ ActivatePointerGrab(register DeviceIntPtr mouse, register GrabPtr grab, } void -DeactivatePointerGrab(register DeviceIntPtr mouse) +DeactivatePointerGrab(DeviceIntPtr mouse) { - register GrabPtr grab = mouse->grab; - register DeviceIntPtr dev; + GrabPtr grab = mouse->grab; + DeviceIntPtr dev; mouse->valuator->motionHintWindow = NullWindow; mouse->grab = NullGrab; @@ -1284,7 +1284,7 @@ DeactivatePointerGrab(register DeviceIntPtr mouse) } void -ActivateKeyboardGrab(register DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, Bool passive) +ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, Bool passive) { WindowPtr oldWin; @@ -1310,11 +1310,11 @@ ActivateKeyboardGrab(register DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, } void -DeactivateKeyboardGrab(register DeviceIntPtr keybd) +DeactivateKeyboardGrab(DeviceIntPtr keybd) { - register GrabPtr grab = keybd->grab; - register DeviceIntPtr dev; - register WindowPtr focusWin = keybd->focus ? keybd->focus->win + GrabPtr grab = keybd->grab; + DeviceIntPtr dev; + WindowPtr focusWin = keybd->focus ? keybd->focus->win : sprite.win; if (focusWin == FollowKeyboardWin) @@ -1338,7 +1338,7 @@ AllowSome(ClientPtr client, TimeStamp time, DeviceIntPtr thisDev, int newState) { Bool thisGrabbed, otherGrabbed, othersFrozen, thisSynced; TimeStamp grabTime; - register DeviceIntPtr dev; + DeviceIntPtr dev; thisGrabbed = thisDev->grab && SameClient(thisDev->grab, client); thisSynced = FALSE; @@ -1442,7 +1442,7 @@ AllowSome(ClientPtr client, TimeStamp time, DeviceIntPtr thisDev, int newState) } int -ProcAllowEvents(register ClientPtr client) +ProcAllowEvents(ClientPtr client) { TimeStamp time; DeviceIntPtr mouse = inputInfo.pointer; @@ -1487,7 +1487,7 @@ ProcAllowEvents(register ClientPtr client) void ReleaseActiveGrabs(ClientPtr client) { - register DeviceIntPtr dev; + DeviceIntPtr dev; Bool done; /* XXX CloseDownClient should remove passive grabs before @@ -1589,12 +1589,12 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, } int -DeliverEventsToWindow(register WindowPtr pWin, xEvent *pEvents, int count, +DeliverEventsToWindow(WindowPtr pWin, xEvent *pEvents, int count, Mask filter, GrabPtr grab, int mskidx) { int deliveries = 0, nondeliveries = 0; int attempt; - register InputClients *other; + InputClients *other; ClientPtr client = NullClient; Mask deliveryMask = 0; /* If a grab occurs due to a button press, then this mask is the mask of the grab. */ @@ -1708,10 +1708,10 @@ XineramaTryClientEventsResult( #endif int -MaybeDeliverEventsToClient(register WindowPtr pWin, xEvent *pEvents, +MaybeDeliverEventsToClient(WindowPtr pWin, xEvent *pEvents, int count, Mask filter, ClientPtr dontClient) { - register OtherClients *other; + OtherClients *other; if (pWin->eventMask & filter) @@ -1799,8 +1799,8 @@ FixUpEventFromWindow( } int -DeliverDeviceEvents(register WindowPtr pWin, register xEvent *xE, GrabPtr grab, - register WindowPtr stopAt, DeviceIntPtr dev, int count) +DeliverDeviceEvents(WindowPtr pWin, xEvent *xE, GrabPtr grab, + WindowPtr stopAt, DeviceIntPtr dev, int count) { Window child = None; int type = xE->u.u.type; @@ -1809,7 +1809,7 @@ DeliverDeviceEvents(register WindowPtr pWin, register xEvent *xE, GrabPtr grab, if (type & EXTENSION_EVENT_BASE) { - register OtherInputMasks *inputMasks; + OtherInputMasks *inputMasks; int mskidx = dev->id; inputMasks = wOtherInputMasks(pWin); @@ -1863,8 +1863,8 @@ DeliverDeviceEvents(register WindowPtr pWin, register xEvent *xE, GrabPtr grab, /* not useful for events that propagate up the tree or extension events */ _X_EXPORT int -DeliverEvents(register WindowPtr pWin, register xEvent *xE, int count, - register WindowPtr otherParent) +DeliverEvents(WindowPtr pWin, xEvent *xE, int count, + WindowPtr otherParent) { Mask filter; int deliveries; @@ -1929,7 +1929,7 @@ PointInBorderSize(WindowPtr pWin, int x, int y) static WindowPtr XYToWindow(int x, int y) { - register WindowPtr pWin; + WindowPtr pWin; BoxRec box; spriteTraceGood = 1; /* root window still there */ @@ -2092,9 +2092,9 @@ void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff) #endif void -DefineInitialRootWindow(register WindowPtr win) +DefineInitialRootWindow(WindowPtr win) { - register ScreenPtr pScreen = win->drawable.pScreen; + ScreenPtr pScreen = win->drawable.pScreen; sprite.hotPhys.pScreen = pScreen; sprite.hotPhys.x = pScreen->width / 2; @@ -2411,13 +2411,13 @@ BorderSizeNotEmpty(WindowPtr pWin) static Bool CheckPassiveGrabsOnWindow( WindowPtr pWin, - register DeviceIntPtr device, - register xEvent *xE, + DeviceIntPtr device, + xEvent *xE, int count) { - register GrabPtr grab = wPassiveGrabs(pWin); + GrabPtr grab = wPassiveGrabs(pWin); GrabRec tempGrab; - register xEvent *dxE; + xEvent *dxE; if (!grab) return FALSE; @@ -2513,12 +2513,12 @@ tried. PRH */ Bool -CheckDeviceGrabs(register DeviceIntPtr device, register xEvent *xE, +CheckDeviceGrabs(DeviceIntPtr device, xEvent *xE, int checkFirst, int count) { - register int i; - register WindowPtr pWin = NULL; - register FocusClassPtr focus = device->focus; + int i; + WindowPtr pWin = NULL; + FocusClassPtr focus = device->focus; if (((xE->u.u.type == ButtonPress) #if defined(XINPUT) && defined(XKB) @@ -2585,13 +2585,13 @@ DeliverFocusedEvent(DeviceIntPtr keybd, xEvent *xE, WindowPtr window, int count) } void -DeliverGrabbedEvent(register xEvent *xE, register DeviceIntPtr thisDev, +DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev, Bool deactivateGrab, int count) { - register GrabPtr grab = thisDev->grab; + GrabPtr grab = thisDev->grab; int deliveries = 0; - register DeviceIntPtr dev; - register xEvent *dxE; + DeviceIntPtr dev; + xEvent *dxE; if (grab->ownerEvents) { @@ -2668,19 +2668,19 @@ DeliverGrabbedEvent(register xEvent *xE, register DeviceIntPtr thisDev, void #ifdef XKB -CoreProcessKeyboardEvent (register xEvent *xE, register DeviceIntPtr keybd, int count) +CoreProcessKeyboardEvent (xEvent *xE, DeviceIntPtr keybd, int count) #else -ProcessKeyboardEvent (register xEvent *xE, register DeviceIntPtr keybd, int count) +ProcessKeyboardEvent (xEvent *xE, DeviceIntPtr keybd, int count) #endif { int key, bit; - register BYTE *kptr; - register int i; - register CARD8 modifiers; - register CARD16 mask; + BYTE *kptr; + int i; + CARD8 modifiers; + CARD16 mask; GrabPtr grab = keybd->grab; Bool deactivateGrab = FALSE; - register KeyClassPtr keyc = keybd->key; + KeyClassPtr keyc = keybd->key; #ifdef XEVIE static Window rootWin = 0; @@ -2832,11 +2832,11 @@ drawable.id:0; CoreProcessKeyEvent to be called, as in for example Mouse Keys. */ void -FixKeyState (register xEvent *xE, register DeviceIntPtr keybd) +FixKeyState (xEvent *xE, DeviceIntPtr keybd) { int key, bit; - register BYTE *kptr; - register KeyClassPtr keyc = keybd->key; + BYTE *kptr; + KeyClassPtr keyc = keybd->key; key = xE->u.u.detail; kptr = &keyc->down[key >> 3]; @@ -2863,14 +2863,14 @@ FixKeyState (register xEvent *xE, register DeviceIntPtr keybd) void #ifdef XKB -CoreProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count) +CoreProcessPointerEvent (xEvent *xE, DeviceIntPtr mouse, int count) #else -ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count) +ProcessPointerEvent (xEvent *xE, DeviceIntPtr mouse, int count) #endif { - register GrabPtr grab = mouse->grab; + GrabPtr grab = mouse->grab; Bool deactivateGrab = FALSE; - register ButtonClassPtr butc = mouse->button; + ButtonClassPtr butc = mouse->button; #ifdef XKB XkbSrvInfoPtr xkbi= inputInfo.keyboard->key->xkbInfo; #endif @@ -2914,8 +2914,8 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count } if (xE->u.u.type != MotionNotify) { - register int key; - register BYTE *kptr; + int key; + BYTE *kptr; int bit; XE_KBPTR.rootX = sprite.hot.x; @@ -2976,10 +2976,10 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count void RecalculateDeliverableEvents(pWin) - register WindowPtr pWin; + WindowPtr pWin; { - register OtherClients *others; - register WindowPtr pChild; + OtherClients *others; + WindowPtr pChild; pChild = pWin; while (1) @@ -3018,8 +3018,8 @@ RecalculateDeliverableEvents(pWin) int OtherClientGone(pointer value, XID id) { - register OtherClientsPtr other, prev; - register WindowPtr pWin = (WindowPtr)value; + OtherClientsPtr other, prev; + WindowPtr pWin = (WindowPtr)value; prev = 0; for (other = wOtherClients(pWin); other; other = other->next) @@ -3045,7 +3045,7 @@ OtherClientGone(pointer value, XID id) } int -EventSelectForWindow(register WindowPtr pWin, register ClientPtr client, Mask mask) +EventSelectForWindow(WindowPtr pWin, ClientPtr client, Mask mask) { Mask check; OtherClients * others; @@ -3117,10 +3117,10 @@ maskSet: } int -EventSuppressForWindow(register WindowPtr pWin, register ClientPtr client, +EventSuppressForWindow(WindowPtr pWin, ClientPtr client, Mask mask, Bool *checkOptional) { - register int i, free; + int i, free; if (mask & ~PropagateMask) { @@ -3174,8 +3174,8 @@ EventSuppressForWindow(register WindowPtr pWin, register ClientPtr client, static WindowPtr CommonAncestor( - register WindowPtr a, - register WindowPtr b) + WindowPtr a, + WindowPtr b) { for (b = b->parent; b; b = b->parent) if (IsParent(b, a)) return b; @@ -3187,14 +3187,14 @@ EnterLeaveEvent( int type, int mode, int detail, - register WindowPtr pWin, + WindowPtr pWin, Window child) { xEvent event; - register DeviceIntPtr keybd = inputInfo.keyboard; + DeviceIntPtr keybd = inputInfo.keyboard; WindowPtr focus; - register DeviceIntPtr mouse = inputInfo.pointer; - register GrabPtr grab = mouse->grab; + DeviceIntPtr mouse = inputInfo.pointer; + GrabPtr grab = mouse->grab; Mask mask; if ((pWin == mouse->valuator->motionHintWindow) && @@ -3278,7 +3278,7 @@ EnterNotifies(WindowPtr ancestor, WindowPtr child, int mode, int detail) static void LeaveNotifies(WindowPtr child, WindowPtr ancestor, int mode, int detail) { - register WindowPtr pWin; + WindowPtr pWin; if (ancestor == child) return; @@ -3318,7 +3318,7 @@ DoEnterLeaveEvents(WindowPtr fromWin, WindowPtr toWin, int mode) } static void -FocusEvent(DeviceIntPtr dev, int type, int mode, int detail, register WindowPtr pWin) +FocusEvent(DeviceIntPtr dev, int type, int mode, int detail, WindowPtr pWin) { xEvent event; @@ -3388,7 +3388,7 @@ FocusOutEvents( int mode, int detail, Bool doAncestor) { - register WindowPtr pWin; + WindowPtr pWin; for (pWin = child; pWin != ancestor; pWin = pWin->parent) FocusEvent(dev, FocusOut, mode, detail, pWin); @@ -3531,7 +3531,7 @@ SetInputFocus( Time ctime, Bool followOK) { - register FocusClassPtr focus; + FocusClassPtr focus; WindowPtr focusWin; int mode, rc; TimeStamp time; @@ -3579,7 +3579,7 @@ SetInputFocus( else { int depth = 0; - register WindowPtr pWin; + WindowPtr pWin; for (pWin = focusWin; pWin; pWin = pWin->parent) depth++; if (depth > focus->traceSize) @@ -3745,7 +3745,7 @@ int ProcChangeActivePointerGrab(ClientPtr client) { DeviceIntPtr device = inputInfo.pointer; - register GrabPtr grab = device->grab; + GrabPtr grab = device->grab; CursorPtr newCursor, oldCursor; REQUEST(xChangeActivePointerGrabReq); TimeStamp time; @@ -3807,12 +3807,12 @@ ProcUngrabPointer(ClientPtr client) } int -GrabDevice(register ClientPtr client, register DeviceIntPtr dev, +GrabDevice(ClientPtr client, DeviceIntPtr dev, unsigned this_mode, unsigned other_mode, Window grabWindow, unsigned ownerEvents, Time ctime, Mask mask, CARD8 *status) { WindowPtr pWin; - register GrabPtr grab; + GrabPtr grab; TimeStamp time; int rc; @@ -4433,7 +4433,7 @@ CheckCursorConfinement(WindowPtr pWin) Mask EventMaskForClient(WindowPtr pWin, ClientPtr client) { - register OtherClientsPtr other; + OtherClientsPtr other; if (wClient (pWin) == client) return pWin->eventMask; diff --git a/dix/extension.c b/dix/extension.c index 29cae8676..dc1a76f3a 100644 --- a/dix/extension.c +++ b/dix/extension.c @@ -81,11 +81,11 @@ extern unsigned totalExtensionSize; static void InitExtensionPrivates(ExtensionEntry *ext) { - register char *ptr; + char *ptr; DevUnion *ppriv; - register unsigned *sizes; - register unsigned size; - register int i; + unsigned *sizes; + unsigned size; + int i; if (totalExtensionSize == sizeof(ExtensionEntry)) ppriv = (DevUnion *)NULL; @@ -115,7 +115,7 @@ AddExtension(char *name, int NumEvents, int NumErrors, unsigned short (*MinorOpcodeProc)(ClientPtr c3)) { int i; - register ExtensionEntry *ext, **newexts; + ExtensionEntry *ext, **newexts; if (!MainProc || !SwappedMainProc || !CloseDownProc || !MinorOpcodeProc) return((ExtensionEntry *) NULL); @@ -282,7 +282,7 @@ MinorOpcodeOfRequest(ClientPtr client) void CloseDownExtensions() { - register int i,j; + int i,j; for (i = NumExtensions - 1; i >= 0; i--) { @@ -300,7 +300,7 @@ CloseDownExtensions() lastError = FirstExtensionError; for (i=0; inum) { @@ -363,7 +363,7 @@ ProcListExtensions(ClientPtr client) if ( NumExtensions ) { - register int i, j; + int i, j; for (i=0; ipScreen->myNum]; if (spentry->num) { @@ -431,8 +431,8 @@ RegisterProc(char *name, GC *pGC, ExtensionLookupProc proc) Bool RegisterScreenProc(char *name, ScreenPtr pScreen, ExtensionLookupProc proc) { - register ScreenProcEntry *spentry; - register ProcEntryPtr procEntry = (ProcEntryPtr)NULL; + ScreenProcEntry *spentry; + ProcEntryPtr procEntry = (ProcEntryPtr)NULL; char *newname; int i; diff --git a/dix/gc.c b/dix/gc.c index 5106fcda2..89b246d3c 100644 --- a/dix/gc.c +++ b/dix/gc.c @@ -144,12 +144,12 @@ ValidateGC(DrawablePtr pDraw, GC *pGC) assert(pUnion); _var = (_type)pUnion->ptr; pUnion++; } _X_EXPORT int -dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC32, ChangeGCValPtr pUnion) +dixChangeGC(ClientPtr client, GC *pGC, BITS32 mask, CARD32 *pC32, ChangeGCValPtr pUnion) { - register BITS32 index2; - register int error = 0; - PixmapPtr pPixmap; - BITS32 maskQ; + BITS32 index2; + int error = 0; + PixmapPtr pPixmap; + BITS32 maskQ; assert( (pC32 && !pUnion) || (!pC32 && pUnion) ); pGC->serialNumber |= GC_CHANGE_SERIAL_BIT; @@ -522,7 +522,7 @@ dixChangeGC(ClientPtr client, register GC *pGC, register BITS32 mask, CARD32 *pC /* Publically defined entry to ChangeGC. Just calls dixChangeGC and tells * it that all of the entries are constants or IDs */ _X_EXPORT int -ChangeGC(register GC *pGC, register BITS32 mask, XID *pval) +ChangeGC(GC *pGC, BITS32 mask, XID *pval) { return (dixChangeGC(NullClient, pGC, mask, pval, NULL)); } @@ -548,7 +548,7 @@ NOTE: 32 bits long */ _X_EXPORT int -DoChangeGC(register GC *pGC, register BITS32 mask, XID *pval, int fPointer) +DoChangeGC(GC *pGC, BITS32 mask, XID *pval, int fPointer) { if (fPointer) /* XXX might be a problem on 64 bit big-endian servers */ @@ -572,11 +572,11 @@ static GCPtr AllocateGC(ScreenPtr pScreen) { GCPtr pGC; - register char *ptr; - register DevUnion *ppriv; - register unsigned *sizes; - register unsigned size; - register int i; + char *ptr; + DevUnion *ppriv; + unsigned *sizes; + unsigned size; + int i; pGC = (GCPtr)xalloc(pScreen->totalGCSize); if (pGC) @@ -602,7 +602,7 @@ AllocateGC(ScreenPtr pScreen) _X_EXPORT GCPtr CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus) { - register GCPtr pGC; + GCPtr pGC; pGC = AllocateGC(pDrawable->pScreen); if (!pGC) @@ -724,11 +724,11 @@ CreateDefaultTile (GCPtr pGC) } _X_EXPORT int -CopyGC(register GC *pgcSrc, register GC *pgcDst, register BITS32 mask) +CopyGC(GC *pgcSrc, GC *pgcDst, BITS32 mask) { - register BITS32 index2; - BITS32 maskQ; - int error = 0; + BITS32 index2; + BITS32 maskQ; + int error = 0; if (pgcSrc == pgcDst) return Success; @@ -934,7 +934,7 @@ go with CreateGC() or ChangeGC().) _X_EXPORT GCPtr CreateScratchGC(ScreenPtr pScreen, unsigned depth) { - register GCPtr pGC; + GCPtr pGC; pGC = AllocateGC(pScreen); if (!pGC) @@ -986,8 +986,8 @@ CreateScratchGC(ScreenPtr pScreen, unsigned depth) void FreeGCperDepth(int screenNum) { - register int i; - register ScreenPtr pScreen; + int i; + ScreenPtr pScreen; GCPtr *ppGC; pScreen = screenInfo.screens[screenNum]; @@ -1002,8 +1002,8 @@ FreeGCperDepth(int screenNum) Bool CreateGCperDepth(int screenNum) { - register int i; - register ScreenPtr pScreen; + int i; + ScreenPtr pScreen; DepthPtr pDepth; GCPtr *ppGC; @@ -1035,7 +1035,7 @@ CreateGCperDepth(int screenNum) Bool CreateDefaultStipple(int screenNum) { - register ScreenPtr pScreen; + ScreenPtr pScreen; XID tmpval[3]; xRectangle rect; CARD16 w, h; @@ -1077,10 +1077,10 @@ FreeDefaultStipple(int screenNum) } _X_EXPORT int -SetDashes(register GCPtr pGC, unsigned offset, unsigned ndash, unsigned char *pdash) +SetDashes(GCPtr pGC, unsigned offset, unsigned ndash, unsigned char *pdash) { - register long i; - register unsigned char *p, *indash; + long i; + unsigned char *p, *indash; BITS32 maskQ = 0; i = ndash; @@ -1135,8 +1135,8 @@ SetDashes(register GCPtr pGC, unsigned offset, unsigned ndash, unsigned char *pd _X_EXPORT int VerifyRectOrder(int nrects, xRectangle *prects, int ordering) { - register xRectangle *prectP, *prectN; - register int i; + xRectangle *prectP, *prectN; + int i; switch(ordering) { @@ -1220,10 +1220,10 @@ SetClipRects(GCPtr pGC, int xOrigin, int yOrigin, int nrects, you use it often enough it will become real.) */ _X_EXPORT GCPtr -GetScratchGC(register unsigned depth, register ScreenPtr pScreen) +GetScratchGC(unsigned depth, ScreenPtr pScreen) { - register int i; - register GCPtr pGC; + int i; + GCPtr pGC; for (i=0; i<=pScreen->numDepths; i++) if ( pScreen->GCperDepth[i]->depth == depth && @@ -1269,10 +1269,10 @@ mark it as available. if not, free it for real */ _X_EXPORT void -FreeScratchGC(register GCPtr pGC) +FreeScratchGC(GCPtr pGC) { - register ScreenPtr pScreen = pGC->pScreen; - register int i; + ScreenPtr pScreen = pGC->pScreen; + int i; for (i=0; i<=pScreen->numDepths; i++) { diff --git a/dix/glyphcurs.c b/dix/glyphcurs.c index c1c545fa9..70b1ff8f7 100644 --- a/dix/glyphcurs.c +++ b/dix/glyphcurs.c @@ -74,10 +74,10 @@ cursor metrics. */ int -ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, unsigned char **ppbits) +ServerBitsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm, unsigned char **ppbits) { - register ScreenPtr pScreen; - register GCPtr pGC; + ScreenPtr pScreen; + GCPtr pGC; xRectangle rect; PixmapPtr ppix; long nby; @@ -140,7 +140,7 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns Bool -CursorMetricsFromGlyph(register FontPtr pfont, unsigned ch, register CursorMetricPtr cm) +CursorMetricsFromGlyph(FontPtr pfont, unsigned ch, CursorMetricPtr cm) { CharInfoPtr pci; unsigned long nglyphs; diff --git a/dix/grabs.c b/dix/grabs.c index 0c2b05e89..714fea3e5 100644 --- a/dix/grabs.c +++ b/dix/grabs.c @@ -128,7 +128,7 @@ FreeGrab(GrabPtr pGrab) int DeletePassiveGrab(pointer value, XID id) { - register GrabPtr g, prev; + GrabPtr g, prev; GrabPtr pGrab = (GrabPtr)value; /* it is OK if the grab isn't found */ @@ -153,8 +153,8 @@ DeletePassiveGrab(pointer value, XID id) static Mask * DeleteDetailFromMask(Mask *pDetailMask, unsigned short detail) { - register Mask *mask; - register int i; + Mask *mask; + int i; mask = (Mask *)xalloc(sizeof(Mask) * MasksPerDetailMask); if (mask) @@ -305,7 +305,7 @@ AddPassiveGrabToList(GrabPtr pGrab) Bool DeletePassiveGrabFromList(GrabPtr pMinuendGrab) { - register GrabPtr grab; + GrabPtr grab; GrabPtr *deletes, *adds; Mask ***updates, **details; int i, ndels, nadds, nups; diff --git a/dix/privates.c b/dix/privates.c index a61c3cbb6..a66fc3df0 100644 --- a/dix/privates.c +++ b/dix/privates.c @@ -225,7 +225,7 @@ AllocateWindowPrivateIndex() } _X_EXPORT Bool -AllocateWindowPrivate(register ScreenPtr pScreen, int index2, unsigned amount) +AllocateWindowPrivate(ScreenPtr pScreen, int index2, unsigned amount) { unsigned oldamount; @@ -275,7 +275,7 @@ AllocateGCPrivateIndex() } _X_EXPORT Bool -AllocateGCPrivate(register ScreenPtr pScreen, int index2, unsigned amount) +AllocateGCPrivate(ScreenPtr pScreen, int index2, unsigned amount) { unsigned oldamount; @@ -324,7 +324,7 @@ AllocatePixmapPrivateIndex() } _X_EXPORT Bool -AllocatePixmapPrivate(register ScreenPtr pScreen, int index2, unsigned amount) +AllocatePixmapPrivate(ScreenPtr pScreen, int index2, unsigned amount) { unsigned oldamount; diff --git a/dix/property.c b/dix/property.c index d40284901..034d86f63 100644 --- a/dix/property.c +++ b/dix/property.c @@ -76,7 +76,7 @@ static void PrintPropertys(WindowPtr pWin) { PropertyPtr pProp; - register int j; + int j; pProp = pWin->userProps; while (pProp) @@ -97,7 +97,7 @@ ProcRotateProperties(ClientPtr client) int i, j, delta, rc; REQUEST(xRotatePropertiesReq); WindowPtr pWin; - register Atom * atoms; + Atom * atoms; PropertyPtr * props; /* array of pointer */ PropertyPtr pProp; xEvent event; @@ -622,7 +622,7 @@ ProcListProperties(ClientPtr client) } int -ProcDeleteProperty(register ClientPtr client) +ProcDeleteProperty(ClientPtr client) { WindowPtr pWin; REQUEST(xDeletePropertyReq); diff --git a/dix/resource.c b/dix/resource.c index 4468f4575..7092b2fdb 100644 --- a/dix/resource.c +++ b/dix/resource.c @@ -257,7 +257,7 @@ ClientResourceRec clientTable[MAXCLIENTS]; Bool InitClientResources(ClientPtr client) { - register int i, j; + int i, j; if (client == serverClient) { @@ -314,7 +314,7 @@ InitClientResources(ClientPtr client) static int -Hash(int client, register XID id) +Hash(int client, XID id) { id &= RESOURCE_ID_MASK; switch (clientTable[client].hashsize) @@ -337,12 +337,12 @@ Hash(int client, register XID id) static XID AvailableID( - register int client, - register XID id, - register XID maxid, - register XID goodid) + int client, + XID id, + XID maxid, + XID goodid) { - register ResourcePtr res; + ResourcePtr res; if ((goodid >= id) && (goodid <= maxid)) return goodid; @@ -360,10 +360,10 @@ AvailableID( _X_EXPORT void GetXIDRange(int client, Bool server, XID *minp, XID *maxp) { - register XID id, maxid; - register ResourcePtr *resp; - register ResourcePtr res; - register int i; + XID id, maxid; + ResourcePtr *resp; + ResourcePtr res; + int i; XID goodid; id = (Mask)client << CLIENTOFFSET; @@ -436,7 +436,7 @@ GetXIDList(ClientPtr pClient, unsigned count, XID *pids) */ _X_EXPORT XID -FakeClientID(register int client) +FakeClientID(int client) { XID id, maxid; @@ -460,8 +460,8 @@ _X_EXPORT Bool AddResource(XID id, RESTYPE type, pointer value) { int client; - register ClientResourceRec *rrec; - register ResourcePtr res, *head; + ClientResourceRec *rrec; + ResourcePtr res, *head; #ifdef XSERVER_DTRACE XSERVER_RESOURCE_ALLOC(id, type, value, TypeNameString(type)); @@ -498,10 +498,10 @@ AddResource(XID id, RESTYPE type, pointer value) static void RebuildTable(int client) { - register int j; - register ResourcePtr res, next; + int j; + ResourcePtr res, next; ResourcePtr **tails, *resources; - register ResourcePtr **tptr, *rptr; + ResourcePtr **tptr, *rptr; /* * For now, preserve insertion order, since some ddx layers depend @@ -548,9 +548,9 @@ _X_EXPORT void FreeResource(XID id, RESTYPE skipDeleteFuncType) { int cid; - register ResourcePtr res; - register ResourcePtr *prev, *head; - register int *eltptr; + ResourcePtr res; + ResourcePtr *prev, *head; + int *eltptr; int elements; Bool gotOne = FALSE; @@ -600,8 +600,8 @@ _X_EXPORT void FreeResourceByType(XID id, RESTYPE type, Bool skipFree) { int cid; - register ResourcePtr res; - register ResourcePtr *prev, *head; + ResourcePtr res; + ResourcePtr *prev, *head; if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) { head = &clientTable[cid].resources[Hash(cid, id)]; @@ -644,7 +644,7 @@ _X_EXPORT Bool ChangeResourceValue (XID id, RESTYPE rtype, pointer value) { int cid; - register ResourcePtr res; + ResourcePtr res; if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) { @@ -675,10 +675,10 @@ FindClientResourcesByType( FindResType func, pointer cdata ){ - register ResourcePtr *resources; - register ResourcePtr this, next; + ResourcePtr *resources; + ResourcePtr this, next; int i, elements; - register int *eltptr; + int *eltptr; if (!client) client = serverClient; @@ -706,10 +706,10 @@ FindAllClientResources( FindAllRes func, pointer cdata ){ - register ResourcePtr *resources; - register ResourcePtr this, next; + ResourcePtr *resources; + ResourcePtr this, next; int i, elements; - register int *eltptr; + int *eltptr; if (!client) client = serverClient; @@ -796,8 +796,8 @@ FreeClientNeverRetainResources(ClientPtr client) void FreeClientResources(ClientPtr client) { - register ResourcePtr *resources; - register ResourcePtr this; + ResourcePtr *resources; + ResourcePtr this; int j; /* This routine shouldn't be called with a null client, but just in @@ -856,7 +856,7 @@ FreeAllResources() } _X_EXPORT Bool -LegalNewID(XID id, register ClientPtr client) +LegalNewID(XID id, ClientPtr client) { #ifdef PANORAMIX @@ -887,7 +887,7 @@ _X_EXPORT pointer SecurityLookupIDByType(ClientPtr client, XID id, RESTYPE rtype, Mask mode) { int cid; - register ResourcePtr res; + ResourcePtr res; pointer retval = NULL; if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && @@ -914,7 +914,7 @@ _X_EXPORT pointer SecurityLookupIDByClass(ClientPtr client, XID id, RESTYPE classes, Mask mode) { int cid; - register ResourcePtr res = NULL; + ResourcePtr res = NULL; pointer retval = NULL; if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && diff --git a/dix/swaprep.c b/dix/swaprep.c index 08ae6eb1a..6f4b277d9 100644 --- a/dix/swaprep.c +++ b/dix/swaprep.c @@ -73,10 +73,10 @@ static void SwapFont(xQueryFontReply *pr, Bool hasGlyphs); * \param size size in bytes */ _X_EXPORT void -Swap32Write(ClientPtr pClient, int size, register CARD32 *pbuf) +Swap32Write(ClientPtr pClient, int size, CARD32 *pbuf) { - register int i; - register char n; + int i; + char n; size >>= 2; for(i = 0; i < size; i++) @@ -97,7 +97,7 @@ CopySwap32Write(ClientPtr pClient, int size, CARD32 *pbuf) { int bufsize = size; CARD32 *pbufT; - register CARD32 *from, *to, *fromLast, *toLast; + CARD32 *from, *to, *fromLast, *toLast; CARD32 tmpbuf[1]; /* Allocate as big a buffer as we can... */ @@ -145,7 +145,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf) { int bufsize = size; short *pbufT; - register short *from, *to, *fromLast, *toLast; + short *from, *to, *fromLast, *toLast; short tmpbuf[2]; /* Allocate as big a buffer as we can... */ @@ -189,7 +189,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf) void SGenericReply(ClientPtr pClient, int size, xGenericReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); (void)WriteToClient(pClient, size, (char *) pRep); @@ -200,7 +200,7 @@ void SGetWindowAttributesReply(ClientPtr pClient, int size, xGetWindowAttributesReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -218,7 +218,7 @@ SGetWindowAttributesReply(ClientPtr pClient, int size, void SGetGeometryReply(ClientPtr pClient, int size, xGetGeometryReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->root, n); @@ -233,7 +233,7 @@ SGetGeometryReply(ClientPtr pClient, int size, xGetGeometryReply *pRep) void SQueryTreeReply(ClientPtr pClient, int size, xQueryTreeReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -246,7 +246,7 @@ SQueryTreeReply(ClientPtr pClient, int size, xQueryTreeReply *pRep) void SInternAtomReply(ClientPtr pClient, int size, xInternAtomReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->atom, n); @@ -256,7 +256,7 @@ SInternAtomReply(ClientPtr pClient, int size, xInternAtomReply *pRep) void SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -268,7 +268,7 @@ SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply *pRep) void SGetPropertyReply(ClientPtr pClient, int size, xGetPropertyReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -281,7 +281,7 @@ SGetPropertyReply(ClientPtr pClient, int size, xGetPropertyReply *pRep) void SListPropertiesReply(ClientPtr pClient, int size, xListPropertiesReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -293,7 +293,7 @@ void SGetSelectionOwnerReply(ClientPtr pClient, int size, xGetSelectionOwnerReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->owner, n); @@ -304,7 +304,7 @@ SGetSelectionOwnerReply(ClientPtr pClient, int size, void SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->root, n); @@ -320,7 +320,7 @@ SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply *pRep) void SwapTimecoord(xTimecoord* pCoord) { - register char n; + char n; swapl(&pCoord->time, n); swaps(&pCoord->x, n); @@ -346,7 +346,7 @@ SwapTimeCoordWrite(ClientPtr pClient, int size, xTimecoord *pRep) void SGetMotionEventsReply(ClientPtr pClient, int size, xGetMotionEventsReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -357,7 +357,7 @@ SGetMotionEventsReply(ClientPtr pClient, int size, xGetMotionEventsReply *pRep) void STranslateCoordsReply(ClientPtr pClient, int size, xTranslateCoordsReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->child, n); @@ -369,7 +369,7 @@ STranslateCoordsReply(ClientPtr pClient, int size, xTranslateCoordsReply *pRep) void SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->focus, n); @@ -380,7 +380,7 @@ SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply *pRep) void SQueryKeymapReply(ClientPtr pClient, int size, xQueryKeymapReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -390,7 +390,7 @@ SQueryKeymapReply(ClientPtr pClient, int size, xQueryKeymapReply *pRep) static void SwapCharInfo(xCharInfo *pInfo) { - register char n; + char n; swaps(&pInfo->leftSideBearing, n); swaps(&pInfo->rightSideBearing, n); @@ -403,7 +403,7 @@ SwapCharInfo(xCharInfo *pInfo) static void SwapFontInfo(xQueryFontReply *pr) { - register char n; + char n; swaps(&pr->minCharOrByte2, n); swaps(&pr->maxCharOrByte2, n); @@ -423,7 +423,7 @@ SwapFont(xQueryFontReply *pr, Bool hasGlyphs) xCharInfo * pxci; unsigned nchars, nprops; char *pby; - register char n; + char n; swaps(&pr->sequenceNumber, n); swapl(&pr->length, n); @@ -458,7 +458,7 @@ SQueryFontReply(ClientPtr pClient, int size, xQueryFontReply *pRep) void SQueryTextExtentsReply(ClientPtr pClient, int size, xQueryTextExtentsReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swaps(&pRep->fontAscent, n); @@ -474,7 +474,7 @@ SQueryTextExtentsReply(ClientPtr pClient, int size, xQueryTextExtentsReply *pRep void SListFontsReply(ClientPtr pClient, int size, xListFontsReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -493,7 +493,7 @@ SListFontsWithInfoReply(ClientPtr pClient, int size, void SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -504,7 +504,7 @@ SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply *pRep) void SGetImageReply(ClientPtr pClient, int size, xGetImageReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -517,7 +517,7 @@ void SListInstalledColormapsReply(ClientPtr pClient, int size, xListInstalledColormapsReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -531,7 +531,7 @@ SAllocColorReply(pClient, size, pRep) int size; xAllocColorReply *pRep; { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swaps(&pRep->red, n); @@ -544,7 +544,7 @@ SAllocColorReply(pClient, size, pRep) void SAllocNamedColorReply(ClientPtr pClient, int size, xAllocNamedColorReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->pixel, n); @@ -560,7 +560,7 @@ SAllocNamedColorReply(ClientPtr pClient, int size, xAllocNamedColorReply *pRep) void SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -573,7 +573,7 @@ SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply *pRep) void SAllocColorPlanesReply(ClientPtr pClient, int size, xAllocColorPlanesReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -587,7 +587,7 @@ SAllocColorPlanesReply(ClientPtr pClient, int size, xAllocColorPlanesReply *pRep void SwapRGB(xrgb *prgb) { - register char n; + char n; swaps(&prgb->red, n); swaps(&prgb->green, n); @@ -613,7 +613,7 @@ SQColorsExtend(ClientPtr pClient, int size, xrgb *prgb) void SQueryColorsReply(ClientPtr pClient, int size, xQueryColorsReply* pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -624,7 +624,7 @@ SQueryColorsReply(ClientPtr pClient, int size, xQueryColorsReply* pRep) void SLookupColorReply(ClientPtr pClient, int size, xLookupColorReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swaps(&pRep->exactRed, n); @@ -639,7 +639,7 @@ SLookupColorReply(ClientPtr pClient, int size, xLookupColorReply *pRep) void SQueryBestSizeReply(ClientPtr pClient, int size, xQueryBestSizeReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swaps(&pRep->width, n); @@ -650,7 +650,7 @@ SQueryBestSizeReply(ClientPtr pClient, int size, xQueryBestSizeReply *pRep) void SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -661,7 +661,7 @@ void SGetKeyboardMappingReply(ClientPtr pClient, int size, xGetKeyboardMappingReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -672,7 +672,7 @@ void SGetPointerMappingReply(ClientPtr pClient, int size, xGetPointerMappingReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -683,7 +683,7 @@ void SGetModifierMappingReply(ClientPtr pClient, int size, xGetModifierMappingReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -693,7 +693,7 @@ SGetModifierMappingReply(ClientPtr pClient, int size, void SGetKeyboardControlReply(ClientPtr pClient, int size, xGetKeyboardControlReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); @@ -706,7 +706,7 @@ SGetKeyboardControlReply(ClientPtr pClient, int size, xGetKeyboardControlReply * void SGetPointerControlReply(ClientPtr pClient, int size, xGetPointerControlReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swaps(&pRep->accelNumerator, n); @@ -718,7 +718,7 @@ SGetPointerControlReply(ClientPtr pClient, int size, xGetPointerControlReply *pR void SGetScreenSaverReply(ClientPtr pClient, int size, xGetScreenSaverReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swaps(&pRep->timeout, n); @@ -734,7 +734,7 @@ SLHostsExtend(ClientPtr pClient, int size, char *buf) while (bufT < endbuf) { xHostEntry *host = (xHostEntry *) bufT; int len = host->length; - register char n; + char n; swaps (&host->length, n); bufT += sizeof (xHostEntry) + (((len + 3) >> 2) << 2); } @@ -744,7 +744,7 @@ SLHostsExtend(ClientPtr pClient, int size, char *buf) void SListHostsReply(ClientPtr pClient, int size, xListHostsReply *pRep) { - register char n; + char n; swaps(&pRep->sequenceNumber, n); swapl(&pRep->length, n); diff --git a/dix/swapreq.c b/dix/swapreq.c index a6a211515..ad60d17da 100644 --- a/dix/swapreq.c +++ b/dix/swapreq.c @@ -63,9 +63,9 @@ SOFTWARE. /* Byte swap a list of longs */ _X_EXPORT void -SwapLongs (register CARD32 *list, register unsigned long count) +SwapLongs (CARD32 *list, unsigned long count) { - register char n; + char n; while (count >= 8) { swapl(list+0, n); @@ -89,9 +89,9 @@ SwapLongs (register CARD32 *list, register unsigned long count) /* Byte swap a list of shorts */ _X_EXPORT void -SwapShorts (register short *list, register unsigned long count) +SwapShorts (short *list, unsigned long count) { - register char n; + char n; while (count >= 16) { swaps(list+0, n); @@ -124,9 +124,9 @@ SwapShorts (register short *list, register unsigned long count) /* The following is used for all requests that have no fields to be swapped (except "length") */ int -SProcSimpleReq(register ClientPtr client) +SProcSimpleReq(ClientPtr client) { - register char n; + char n; REQUEST(xReq); swaps(&stuff->length, n); @@ -137,9 +137,9 @@ SProcSimpleReq(register ClientPtr client) only a single 32-bit field to be swapped, coming right after the "length" field */ int -SProcResourceReq(register ClientPtr client) +SProcResourceReq(ClientPtr client) { - register char n; + char n; REQUEST(xResourceReq); swaps(&stuff->length, n); @@ -149,9 +149,9 @@ SProcResourceReq(register ClientPtr client) } int -SProcCreateWindow(register ClientPtr client) +SProcCreateWindow(ClientPtr client) { - register char n; + char n; REQUEST(xCreateWindowReq); swaps(&stuff->length, n); @@ -171,9 +171,9 @@ SProcCreateWindow(register ClientPtr client) } int -SProcChangeWindowAttributes(register ClientPtr client) +SProcChangeWindowAttributes(ClientPtr client) { - register char n; + char n; REQUEST(xChangeWindowAttributesReq); swaps(&stuff->length, n); @@ -185,9 +185,9 @@ SProcChangeWindowAttributes(register ClientPtr client) } int -SProcReparentWindow(register ClientPtr client) +SProcReparentWindow(ClientPtr client) { - register char n; + char n; REQUEST(xReparentWindowReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xReparentWindowReq); @@ -199,9 +199,9 @@ SProcReparentWindow(register ClientPtr client) } int -SProcConfigureWindow(register ClientPtr client) +SProcConfigureWindow(ClientPtr client) { - register char n; + char n; REQUEST(xConfigureWindowReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xConfigureWindowReq); @@ -214,9 +214,9 @@ SProcConfigureWindow(register ClientPtr client) int -SProcInternAtom(register ClientPtr client) +SProcInternAtom(ClientPtr client) { - register char n; + char n; REQUEST(xInternAtomReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xInternAtomReq); @@ -225,9 +225,9 @@ SProcInternAtom(register ClientPtr client) } int -SProcChangeProperty(register ClientPtr client) +SProcChangeProperty(ClientPtr client) { - register char n; + char n; REQUEST(xChangePropertyReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xChangePropertyReq); @@ -249,9 +249,9 @@ SProcChangeProperty(register ClientPtr client) } int -SProcDeleteProperty(register ClientPtr client) +SProcDeleteProperty(ClientPtr client) { - register char n; + char n; REQUEST(xDeletePropertyReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xDeletePropertyReq); @@ -262,9 +262,9 @@ SProcDeleteProperty(register ClientPtr client) } int -SProcGetProperty(register ClientPtr client) +SProcGetProperty(ClientPtr client) { - register char n; + char n; REQUEST(xGetPropertyReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xGetPropertyReq); @@ -277,9 +277,9 @@ SProcGetProperty(register ClientPtr client) } int -SProcSetSelectionOwner(register ClientPtr client) +SProcSetSelectionOwner(ClientPtr client) { - register char n; + char n; REQUEST(xSetSelectionOwnerReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xSetSelectionOwnerReq); @@ -290,9 +290,9 @@ SProcSetSelectionOwner(register ClientPtr client) } int -SProcConvertSelection(register ClientPtr client) +SProcConvertSelection(ClientPtr client) { - register char n; + char n; REQUEST(xConvertSelectionReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xConvertSelectionReq); @@ -305,9 +305,9 @@ SProcConvertSelection(register ClientPtr client) } int -SProcSendEvent(register ClientPtr client) +SProcSendEvent(ClientPtr client) { - register char n; + char n; xEvent eventT; EventSwapPtr proc; REQUEST(xSendEventReq); @@ -327,9 +327,9 @@ SProcSendEvent(register ClientPtr client) } int -SProcGrabPointer(register ClientPtr client) +SProcGrabPointer(ClientPtr client) { - register char n; + char n; REQUEST(xGrabPointerReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xGrabPointerReq); @@ -342,9 +342,9 @@ SProcGrabPointer(register ClientPtr client) } int -SProcGrabButton(register ClientPtr client) +SProcGrabButton(ClientPtr client) { - register char n; + char n; REQUEST(xGrabButtonReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xGrabButtonReq); @@ -357,9 +357,9 @@ SProcGrabButton(register ClientPtr client) } int -SProcUngrabButton(register ClientPtr client) +SProcUngrabButton(ClientPtr client) { - register char n; + char n; REQUEST(xUngrabButtonReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xUngrabButtonReq); @@ -369,9 +369,9 @@ SProcUngrabButton(register ClientPtr client) } int -SProcChangeActivePointerGrab(register ClientPtr client) +SProcChangeActivePointerGrab(ClientPtr client) { - register char n; + char n; REQUEST(xChangeActivePointerGrabReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xChangeActivePointerGrabReq); @@ -382,9 +382,9 @@ SProcChangeActivePointerGrab(register ClientPtr client) } int -SProcGrabKeyboard(register ClientPtr client) +SProcGrabKeyboard(ClientPtr client) { - register char n; + char n; REQUEST(xGrabKeyboardReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xGrabKeyboardReq); @@ -394,9 +394,9 @@ SProcGrabKeyboard(register ClientPtr client) } int -SProcGrabKey(register ClientPtr client) +SProcGrabKey(ClientPtr client) { - register char n; + char n; REQUEST(xGrabKeyReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xGrabKeyReq); @@ -406,9 +406,9 @@ SProcGrabKey(register ClientPtr client) } int -SProcUngrabKey(register ClientPtr client) +SProcUngrabKey(ClientPtr client) { - register char n; + char n; REQUEST(xUngrabKeyReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xUngrabKeyReq); @@ -418,9 +418,9 @@ SProcUngrabKey(register ClientPtr client) } int -SProcGetMotionEvents(register ClientPtr client) +SProcGetMotionEvents(ClientPtr client) { - register char n; + char n; REQUEST(xGetMotionEventsReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xGetMotionEventsReq); @@ -431,9 +431,9 @@ SProcGetMotionEvents(register ClientPtr client) } int -SProcTranslateCoords(register ClientPtr client) +SProcTranslateCoords(ClientPtr client) { - register char n; + char n; REQUEST(xTranslateCoordsReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xTranslateCoordsReq); @@ -445,9 +445,9 @@ SProcTranslateCoords(register ClientPtr client) } int -SProcWarpPointer(register ClientPtr client) +SProcWarpPointer(ClientPtr client) { - register char n; + char n; REQUEST(xWarpPointerReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xWarpPointerReq); @@ -463,9 +463,9 @@ SProcWarpPointer(register ClientPtr client) } int -SProcSetInputFocus(register ClientPtr client) +SProcSetInputFocus(ClientPtr client) { - register char n; + char n; REQUEST(xSetInputFocusReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xSetInputFocusReq); @@ -475,9 +475,9 @@ SProcSetInputFocus(register ClientPtr client) } int -SProcOpenFont(register ClientPtr client) +SProcOpenFont(ClientPtr client) { - register char n; + char n; REQUEST(xOpenFontReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xOpenFontReq); @@ -487,9 +487,9 @@ SProcOpenFont(register ClientPtr client) } int -SProcListFonts(register ClientPtr client) +SProcListFonts(ClientPtr client) { - register char n; + char n; REQUEST(xListFontsReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xListFontsReq); @@ -499,9 +499,9 @@ SProcListFonts(register ClientPtr client) } int -SProcListFontsWithInfo(register ClientPtr client) +SProcListFontsWithInfo(ClientPtr client) { - register char n; + char n; REQUEST(xListFontsWithInfoReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xListFontsWithInfoReq); @@ -511,9 +511,9 @@ SProcListFontsWithInfo(register ClientPtr client) } int -SProcSetFontPath(register ClientPtr client) +SProcSetFontPath(ClientPtr client) { - register char n; + char n; REQUEST(xSetFontPathReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xSetFontPathReq); @@ -522,9 +522,9 @@ SProcSetFontPath(register ClientPtr client) } int -SProcCreatePixmap(register ClientPtr client) +SProcCreatePixmap(ClientPtr client) { - register char n; + char n; REQUEST(xCreatePixmapReq); swaps(&stuff->length, n); @@ -537,9 +537,9 @@ SProcCreatePixmap(register ClientPtr client) } int -SProcCreateGC(register ClientPtr client) +SProcCreateGC(ClientPtr client) { - register char n; + char n; REQUEST(xCreateGCReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xCreateGCReq); @@ -551,9 +551,9 @@ SProcCreateGC(register ClientPtr client) } int -SProcChangeGC(register ClientPtr client) +SProcChangeGC(ClientPtr client) { - register char n; + char n; REQUEST(xChangeGCReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xChangeGCReq); @@ -564,9 +564,9 @@ SProcChangeGC(register ClientPtr client) } int -SProcCopyGC(register ClientPtr client) +SProcCopyGC(ClientPtr client) { - register char n; + char n; REQUEST(xCopyGCReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xCopyGCReq); @@ -577,9 +577,9 @@ SProcCopyGC(register ClientPtr client) } int -SProcSetDashes(register ClientPtr client) +SProcSetDashes(ClientPtr client) { - register char n; + char n; REQUEST(xSetDashesReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xSetDashesReq); @@ -591,9 +591,9 @@ SProcSetDashes(register ClientPtr client) } int -SProcSetClipRectangles(register ClientPtr client) +SProcSetClipRectangles(ClientPtr client) { - register char n; + char n; REQUEST(xSetClipRectanglesReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xSetClipRectanglesReq); @@ -605,9 +605,9 @@ SProcSetClipRectangles(register ClientPtr client) } int -SProcClearToBackground(register ClientPtr client) +SProcClearToBackground(ClientPtr client) { - register char n; + char n; REQUEST(xClearAreaReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xClearAreaReq); @@ -620,9 +620,9 @@ SProcClearToBackground(register ClientPtr client) } int -SProcCopyArea(register ClientPtr client) +SProcCopyArea(ClientPtr client) { - register char n; + char n; REQUEST(xCopyAreaReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xCopyAreaReq); @@ -639,9 +639,9 @@ SProcCopyArea(register ClientPtr client) } int -SProcCopyPlane(register ClientPtr client) +SProcCopyPlane(ClientPtr client) { - register char n; + char n; REQUEST(xCopyPlaneReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xCopyPlaneReq); @@ -661,9 +661,9 @@ SProcCopyPlane(register ClientPtr client) /* The following routine is used for all Poly drawing requests (except FillPoly, which uses a different request format) */ int -SProcPoly(register ClientPtr client) +SProcPoly(ClientPtr client) { - register char n; + char n; REQUEST(xPolyPointReq); swaps(&stuff->length, n); @@ -678,9 +678,9 @@ SProcPoly(register ClientPtr client) is longer than xPolyPointReq, and we don't want to swap the difference as shorts! */ int -SProcFillPoly(register ClientPtr client) +SProcFillPoly(ClientPtr client) { - register char n; + char n; REQUEST(xFillPolyReq); swaps(&stuff->length, n); @@ -692,9 +692,9 @@ SProcFillPoly(register ClientPtr client) } int -SProcPutImage(register ClientPtr client) +SProcPutImage(ClientPtr client) { - register char n; + char n; REQUEST(xPutImageReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xPutImageReq); @@ -710,9 +710,9 @@ SProcPutImage(register ClientPtr client) } int -SProcGetImage(register ClientPtr client) +SProcGetImage(ClientPtr client) { - register char n; + char n; REQUEST(xGetImageReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xGetImageReq); @@ -728,9 +728,9 @@ SProcGetImage(register ClientPtr client) /* ProcPolyText used for both PolyText8 and PolyText16 */ int -SProcPolyText(register ClientPtr client) +SProcPolyText(ClientPtr client) { - register char n; + char n; REQUEST(xPolyTextReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xPolyTextReq); @@ -744,9 +744,9 @@ SProcPolyText(register ClientPtr client) /* ProcImageText used for both ImageText8 and ImageText16 */ int -SProcImageText(register ClientPtr client) +SProcImageText(ClientPtr client) { - register char n; + char n; REQUEST(xImageTextReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xImageTextReq); @@ -758,9 +758,9 @@ SProcImageText(register ClientPtr client) } int -SProcCreateColormap(register ClientPtr client) +SProcCreateColormap(ClientPtr client) { - register char n; + char n; REQUEST(xCreateColormapReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xCreateColormapReq); @@ -772,9 +772,9 @@ SProcCreateColormap(register ClientPtr client) int -SProcCopyColormapAndFree(register ClientPtr client) +SProcCopyColormapAndFree(ClientPtr client) { - register char n; + char n; REQUEST(xCopyColormapAndFreeReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xCopyColormapAndFreeReq); @@ -785,9 +785,9 @@ SProcCopyColormapAndFree(register ClientPtr client) } int -SProcAllocColor(register ClientPtr client) +SProcAllocColor(ClientPtr client) { - register char n; + char n; REQUEST(xAllocColorReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xAllocColorReq); @@ -799,9 +799,9 @@ SProcAllocColor(register ClientPtr client) } int -SProcAllocNamedColor(register ClientPtr client) +SProcAllocNamedColor(ClientPtr client) { - register char n; + char n; REQUEST(xAllocNamedColorReq); swaps(&stuff->length, n); @@ -812,9 +812,9 @@ SProcAllocNamedColor(register ClientPtr client) } int -SProcAllocColorCells(register ClientPtr client) +SProcAllocColorCells(ClientPtr client) { - register char n; + char n; REQUEST(xAllocColorCellsReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xAllocColorCellsReq); @@ -825,9 +825,9 @@ SProcAllocColorCells(register ClientPtr client) } int -SProcAllocColorPlanes(register ClientPtr client) +SProcAllocColorPlanes(ClientPtr client) { - register char n; + char n; REQUEST(xAllocColorPlanesReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xAllocColorPlanesReq); @@ -840,9 +840,9 @@ SProcAllocColorPlanes(register ClientPtr client) } int -SProcFreeColors(register ClientPtr client) +SProcFreeColors(ClientPtr client) { - register char n; + char n; REQUEST(xFreeColorsReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xFreeColorsReq); @@ -856,7 +856,7 @@ SProcFreeColors(register ClientPtr client) _X_EXPORT void SwapColorItem(xColorItem *pItem) { - register char n; + char n; swapl(&pItem->pixel, n); swaps(&pItem->red, n); @@ -865,9 +865,9 @@ SwapColorItem(xColorItem *pItem) } int -SProcStoreColors(register ClientPtr client) +SProcStoreColors(ClientPtr client) { - register char n; + char n; long count; xColorItem *pItem; @@ -882,9 +882,9 @@ SProcStoreColors(register ClientPtr client) } int -SProcStoreNamedColor (register ClientPtr client) +SProcStoreNamedColor (ClientPtr client) { - register char n; + char n; REQUEST(xStoreNamedColorReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xStoreNamedColorReq); @@ -895,9 +895,9 @@ SProcStoreNamedColor (register ClientPtr client) } int -SProcQueryColors (register ClientPtr client) +SProcQueryColors (ClientPtr client) { - register char n; + char n; REQUEST(xQueryColorsReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xQueryColorsReq); @@ -907,9 +907,9 @@ SProcQueryColors (register ClientPtr client) } int -SProcLookupColor (register ClientPtr client) +SProcLookupColor (ClientPtr client) { - register char n; + char n; REQUEST(xLookupColorReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xLookupColorReq); @@ -919,9 +919,9 @@ SProcLookupColor (register ClientPtr client) } int -SProcCreateCursor (register ClientPtr client) +SProcCreateCursor (ClientPtr client) { - register char n; + char n; REQUEST(xCreateCursorReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xCreateCursorReq); @@ -940,9 +940,9 @@ SProcCreateCursor (register ClientPtr client) } int -SProcCreateGlyphCursor (register ClientPtr client) +SProcCreateGlyphCursor (ClientPtr client) { - register char n; + char n; REQUEST(xCreateGlyphCursorReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xCreateGlyphCursorReq); @@ -962,9 +962,9 @@ SProcCreateGlyphCursor (register ClientPtr client) int -SProcRecolorCursor (register ClientPtr client) +SProcRecolorCursor (ClientPtr client) { - register char n; + char n; REQUEST(xRecolorCursorReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xRecolorCursorReq); @@ -979,9 +979,9 @@ SProcRecolorCursor (register ClientPtr client) } int -SProcQueryBestSize (register ClientPtr client) +SProcQueryBestSize (ClientPtr client) { - register char n; + char n; REQUEST(xQueryBestSizeReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xQueryBestSizeReq); @@ -993,9 +993,9 @@ SProcQueryBestSize (register ClientPtr client) } int -SProcQueryExtension (register ClientPtr client) +SProcQueryExtension (ClientPtr client) { - register char n; + char n; REQUEST(xQueryExtensionReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xQueryExtensionReq); @@ -1004,9 +1004,9 @@ SProcQueryExtension (register ClientPtr client) } int -SProcChangeKeyboardMapping (register ClientPtr client) +SProcChangeKeyboardMapping (ClientPtr client) { - register char n; + char n; REQUEST(xChangeKeyboardMappingReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xChangeKeyboardMappingReq); @@ -1016,9 +1016,9 @@ SProcChangeKeyboardMapping (register ClientPtr client) int -SProcChangeKeyboardControl (register ClientPtr client) +SProcChangeKeyboardControl (ClientPtr client) { - register char n; + char n; REQUEST(xChangeKeyboardControlReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xChangeKeyboardControlReq); @@ -1028,9 +1028,9 @@ SProcChangeKeyboardControl (register ClientPtr client) } int -SProcChangePointerControl (register ClientPtr client) +SProcChangePointerControl (ClientPtr client) { - register char n; + char n; REQUEST(xChangePointerControlReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xChangePointerControlReq); @@ -1042,9 +1042,9 @@ SProcChangePointerControl (register ClientPtr client) int -SProcSetScreenSaver (register ClientPtr client) +SProcSetScreenSaver (ClientPtr client) { - register char n; + char n; REQUEST(xSetScreenSaverReq); swaps(&stuff->length, n); REQUEST_SIZE_MATCH(xSetScreenSaverReq); @@ -1054,9 +1054,9 @@ SProcSetScreenSaver (register ClientPtr client) } int -SProcChangeHosts (register ClientPtr client) +SProcChangeHosts (ClientPtr client) { - register char n; + char n; REQUEST(xChangeHostsReq); swaps(&stuff->length, n); @@ -1066,9 +1066,9 @@ SProcChangeHosts (register ClientPtr client) } -int SProcRotateProperties (register ClientPtr client) +int SProcRotateProperties (ClientPtr client) { - register char n; + char n; REQUEST(xRotatePropertiesReq); swaps(&stuff->length, n); REQUEST_AT_LEAST_SIZE(xRotatePropertiesReq); @@ -1080,9 +1080,9 @@ int SProcRotateProperties (register ClientPtr client) } int -SProcNoOperation(register ClientPtr client) +SProcNoOperation(ClientPtr client) { - register char n; + char n; REQUEST(xReq); swaps(&stuff->length, n); return ((* ProcVector[X_NoOperation])(client)); @@ -1091,7 +1091,7 @@ SProcNoOperation(register ClientPtr client) void SwapConnClientPrefix(xConnClientPrefix *pCCP) { - register char n; + char n; swaps(&pCCP->majorVersion, n); swaps(&pCCP->minorVersion, n); diff --git a/dix/window.c b/dix/window.c index e33140dd4..2a82f2e0a 100644 --- a/dix/window.c +++ b/dix/window.c @@ -220,10 +220,10 @@ PrintWindowTree(void) #endif _X_EXPORT int -TraverseTree(register WindowPtr pWin, VisitWindowProcPtr func, pointer data) +TraverseTree(WindowPtr pWin, VisitWindowProcPtr func, pointer data) { - register int result; - register WindowPtr pChild; + int result; + WindowPtr pChild; if (!(pChild = pWin)) return(WT_NOMATCH); @@ -269,7 +269,7 @@ Bool enableBackingStore = FALSE; Bool disableSaveUnders = FALSE; static void -SetWindowToDefaults(register WindowPtr pWin) +SetWindowToDefaults(WindowPtr pWin) { pWin->prevSib = NullWindow; pWin->firstChild = NullWindow; @@ -313,8 +313,8 @@ MakeRootTile(WindowPtr pWin) GCPtr pGC; unsigned char back[128]; int len = BitmapBytePad(sizeof(long)); - register unsigned char *from, *to; - register int i, j; + unsigned char *from, *to; + int i, j; pWin->background.pixmap = (*pScreen->CreatePixmap)(pScreen, 4, 4, pScreen->rootDepth); @@ -353,11 +353,11 @@ WindowPtr AllocateWindow(ScreenPtr pScreen) { WindowPtr pWin; - register char *ptr; - register DevUnion *ppriv; - register unsigned *sizes; - register unsigned size; - register int i; + char *ptr; + DevUnion *ppriv; + unsigned *sizes; + unsigned size; + int i; pWin = (WindowPtr)xalloc(pScreen->totalWindowSize); if (pWin) @@ -540,9 +540,9 @@ InitRootWindow(WindowPtr pWin) */ void -ClippedRegionFromBox(register WindowPtr pWin, RegionPtr Rgn, - register int x, register int y, - register int w, register int h) +ClippedRegionFromBox(WindowPtr pWin, RegionPtr Rgn, + int x, int y, + int w, int h) { ScreenPtr pScreen; BoxRec box; @@ -579,7 +579,7 @@ RegisterRealChildHeadProc (RealChildHeadProc proc) WindowPtr -RealChildHead(register WindowPtr pWin) +RealChildHead(WindowPtr pWin) { if (realChildHeadProc) { return realChildHeadProc (pWin); @@ -599,19 +599,19 @@ RealChildHead(register WindowPtr pWin) *****/ _X_EXPORT WindowPtr -CreateWindow(Window wid, register WindowPtr pParent, int x, int y, unsigned w, - unsigned h, unsigned bw, unsigned class, register Mask vmask, XID *vlist, +CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w, + unsigned h, unsigned bw, unsigned class, Mask vmask, XID *vlist, int depth, ClientPtr client, VisualID visual, int *error) { - register WindowPtr pWin; + WindowPtr pWin; WindowPtr pHead; - register ScreenPtr pScreen; + ScreenPtr pScreen; xEvent event; int idepth, ivisual; Bool fOK; DepthPtr pDepth; PixmapFormatRec *format; - register WindowOptPtr ancwopt; + WindowOptPtr ancwopt; if (class == CopyFromParent) class = pParent->drawable.class; @@ -836,9 +836,9 @@ CreateWindow(Window wid, register WindowPtr pParent, int x, int y, unsigned w, } static void -FreeWindowResources(register WindowPtr pWin) +FreeWindowResources(WindowPtr pWin) { - register ScreenPtr pScreen = pWin->drawable.pScreen; + ScreenPtr pScreen = pWin->drawable.pScreen; DeleteWindowFromAnySaveSet(pWin); DeleteWindowFromAnySelections(pWin); @@ -869,7 +869,7 @@ FreeWindowResources(register WindowPtr pWin) static void CrushTree(WindowPtr pWin) { - register WindowPtr pChild, pSib, pParent; + WindowPtr pChild, pSib, pParent; UnrealizeWindowProcPtr UnrealizeWindow; xEvent event; @@ -926,8 +926,8 @@ CrushTree(WindowPtr pWin) int DeleteWindow(pointer value, XID wid) { - register WindowPtr pParent; - register WindowPtr pWin = (WindowPtr)value; + WindowPtr pParent; + WindowPtr pWin = (WindowPtr)value; xEvent event; UnmapWindow(pWin, FALSE); @@ -959,7 +959,7 @@ DeleteWindow(pointer value, XID wid) } void -DestroySubwindows(register WindowPtr pWin, ClientPtr client) +DestroySubwindows(WindowPtr pWin, ClientPtr client) { /* XXX * The protocol is quite clear that each window should be @@ -986,10 +986,10 @@ DestroySubwindows(register WindowPtr pWin, ClientPtr client) *****/ _X_EXPORT int -ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) +ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) { - register Mask index2; - register XID *pVlist; + Mask index2; + XID *pVlist; PixmapPtr pPixmap; Pixmap pixID; CursorPtr pCursor, pOldCursor; @@ -999,9 +999,9 @@ ChangeWindowAttributes(register WindowPtr pWin, Mask vmask, XID *vlist, ClientPt ColormapPtr pCmap; xEvent xE; int result; - register ScreenPtr pScreen; + ScreenPtr pScreen; Mask vmaskCopy = 0; - register Mask tmask; + Mask tmask; unsigned int val; int error; Bool checkOptional = FALSE; @@ -1520,7 +1520,7 @@ PatchUp: *****/ void -GetWindowAttributes(register WindowPtr pWin, ClientPtr client, xGetWindowAttributesReply *wa) +GetWindowAttributes(WindowPtr pWin, ClientPtr client, xGetWindowAttributesReply *wa) { wa->type = X_Reply; wa->bitGravity = pWin->bitGravity; @@ -1556,9 +1556,9 @@ GetWindowAttributes(register WindowPtr pWin, ClientPtr client, xGetWindowAttribu _X_EXPORT WindowPtr -MoveWindowInStack(register WindowPtr pWin, register WindowPtr pNextSib) +MoveWindowInStack(WindowPtr pWin, WindowPtr pNextSib) { - register WindowPtr pParent = pWin->parent; + WindowPtr pParent = pWin->parent; WindowPtr pFirstChange = pWin; /* highest window where list changes */ if (pWin->nextSib != pNextSib) @@ -1640,7 +1640,7 @@ MoveWindowInStack(register WindowPtr pWin, register WindowPtr pNextSib) } _X_EXPORT RegionPtr -CreateUnclippedWinSize (register WindowPtr pWin) +CreateUnclippedWinSize (WindowPtr pWin) { RegionPtr pRgn; BoxRec box; @@ -1668,7 +1668,7 @@ CreateUnclippedWinSize (register WindowPtr pWin) } _X_EXPORT void -SetWinSize (register WindowPtr pWin) +SetWinSize (WindowPtr pWin) { #ifdef COMPOSITE if (pWin->redirectDraw) @@ -1707,7 +1707,7 @@ SetWinSize (register WindowPtr pWin) } _X_EXPORT void -SetBorderSize (register WindowPtr pWin) +SetBorderSize (WindowPtr pWin) { int bw; @@ -1759,9 +1759,9 @@ SetBorderSize (register WindowPtr pWin) */ _X_EXPORT void -GravityTranslate (register int x, register int y, int oldx, int oldy, +GravityTranslate (int x, int y, int oldx, int oldy, int dw, int dh, unsigned gravity, - register int *destx, register int *desty) + int *destx, int *desty) { switch (gravity) { case NorthGravity: @@ -1809,10 +1809,10 @@ GravityTranslate (register int x, register int y, int oldx, int oldy, /* XXX need to retile border on each window with ParentRelative origin */ _X_EXPORT void -ResizeChildrenWinSize(register WindowPtr pWin, int dx, int dy, int dw, int dh) +ResizeChildrenWinSize(WindowPtr pWin, int dx, int dy, int dw, int dh) { - register ScreenPtr pScreen; - register WindowPtr pSib, pChild; + ScreenPtr pScreen; + WindowPtr pSib, pChild; Bool resized = (dw || dh); pScreen = pWin->drawable.pScreen; @@ -1904,10 +1904,10 @@ ResizeChildrenWinSize(register WindowPtr pWin, int dx, int dy, int dw, int dh) static int IsSiblingAboveMe( - register WindowPtr pMe, - register WindowPtr pSib) + WindowPtr pMe, + WindowPtr pSib) { - register WindowPtr pWin; + WindowPtr pWin; pWin = pMe->parent->firstChild; while (pWin) @@ -1923,8 +1923,8 @@ IsSiblingAboveMe( static BoxPtr WindowExtents( - register WindowPtr pWin, - register BoxPtr pBox) + WindowPtr pWin, + BoxPtr pBox) { pBox->x1 = pWin->drawable.x - wBorderWidth (pWin); pBox->y1 = pWin->drawable.y - wBorderWidth (pWin); @@ -1940,7 +1940,7 @@ WindowExtents( static RegionPtr MakeBoundingRegion ( - register WindowPtr pWin, + WindowPtr pWin, BoxPtr pBox) { RegionPtr pRgn; @@ -1966,7 +1966,7 @@ ShapeOverlap ( BoxPtr pSibBox) { RegionPtr pWinRgn, pSibRgn; - register ScreenPtr pScreen; + ScreenPtr pScreen; Bool ret; if (!IS_SHAPED(pWin) && !IS_SHAPED(pSib)) @@ -1986,11 +1986,11 @@ static Bool AnyWindowOverlapsMe( WindowPtr pWin, WindowPtr pHead, - register BoxPtr box) + BoxPtr box) { - register WindowPtr pSib; + WindowPtr pSib; BoxRec sboxrec; - register BoxPtr sbox; + BoxPtr sbox; for (pSib = pWin->prevSib; pSib != pHead; pSib = pSib->prevSib) { @@ -2011,11 +2011,11 @@ AnyWindowOverlapsMe( static Bool IOverlapAnyWindow( WindowPtr pWin, - register BoxPtr box) + BoxPtr box) { - register WindowPtr pSib; + WindowPtr pSib; BoxRec sboxrec; - register BoxPtr sbox; + BoxPtr sbox; for (pSib = pWin->nextSib; pSib; pSib = pSib->nextSib) { @@ -2063,8 +2063,8 @@ IOverlapAnyWindow( static WindowPtr WhereDoIGoInTheStack( - register WindowPtr pWin, - register WindowPtr pSib, + WindowPtr pWin, + WindowPtr pSib, short x, short y, unsigned short w, @@ -2072,7 +2072,7 @@ WhereDoIGoInTheStack( int smode) { BoxRec box; - register ScreenPtr pScreen; + ScreenPtr pScreen; WindowPtr pHead, pFirst; if ((pWin == pWin->parent->firstChild) && @@ -2169,8 +2169,8 @@ WhereDoIGoInTheStack( static void ReflectStackChange( - register WindowPtr pWin, - register WindowPtr pSib, + WindowPtr pWin, + WindowPtr pSib, VTKind kind) { /* Note that pSib might be NULL */ @@ -2222,17 +2222,17 @@ ReflectStackChange( *****/ int -ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientPtr client) +ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) { #define RESTACK_WIN 0 #define MOVE_WIN 1 #define RESIZE_WIN 2 #define REBORDER_WIN 3 - register WindowPtr pSib = NullWindow; - register WindowPtr pParent = pWin->parent; + WindowPtr pSib = NullWindow; + WindowPtr pParent = pWin->parent; Window sibwid = 0; Mask index2, tmask; - register XID *pVlist; + XID *pVlist; short x, y, beforeX, beforeY; unsigned short w = pWin->drawable.width, h = pWin->drawable.height, @@ -2509,7 +2509,7 @@ ActuallyDoSomething: int CirculateWindow(WindowPtr pParent, int direction, ClientPtr client) { - register WindowPtr pWin, pHead, pFirst; + WindowPtr pWin, pHead, pFirst; xEvent event; BoxRec box; @@ -2579,14 +2579,14 @@ CompareWIDs( *****/ int -ReparentWindow(register WindowPtr pWin, register WindowPtr pParent, +ReparentWindow(WindowPtr pWin, WindowPtr pParent, int x, int y, ClientPtr client) { WindowPtr pPrev, pPriorParent; Bool WasMapped = (Bool)(pWin->mapped); xEvent event; int bw = wBorderWidth (pWin); - register ScreenPtr pScreen; + ScreenPtr pScreen; pScreen = pWin->drawable.pScreen; if (TraverseTree(pWin, CompareWIDs, (pointer)&pParent->drawable.id) == WT_STOPWALKING) @@ -2673,7 +2673,7 @@ ReparentWindow(register WindowPtr pWin, register WindowPtr pParent, static void RealizeTree(WindowPtr pWin) { - register WindowPtr pChild; + WindowPtr pChild; RealizeWindowProcPtr Realize; Realize = pWin->drawable.pScreen->RealizeWindow; @@ -2712,11 +2712,11 @@ RealizeTree(WindowPtr pWin) *****/ _X_EXPORT int -MapWindow(register WindowPtr pWin, ClientPtr client) +MapWindow(WindowPtr pWin, ClientPtr client) { - register ScreenPtr pScreen; + ScreenPtr pScreen; - register WindowPtr pParent; + WindowPtr pParent; #ifdef DO_SAVE_UNDERS Bool dosave = FALSE; #endif @@ -2832,18 +2832,18 @@ MapWindow(register WindowPtr pWin, ClientPtr client) *****/ void -MapSubwindows(register WindowPtr pParent, ClientPtr client) +MapSubwindows(WindowPtr pParent, ClientPtr client) { - register WindowPtr pWin; - WindowPtr pFirstMapped = NullWindow; + WindowPtr pWin; + WindowPtr pFirstMapped = NullWindow; #ifdef DO_SAVE_UNDERS - WindowPtr pFirstSaveUndered = NullWindow; + WindowPtr pFirstSaveUndered = NullWindow; #endif - register ScreenPtr pScreen; - register Mask parentRedirect; - register Mask parentNotify; - xEvent event; - Bool anyMarked; + ScreenPtr pScreen; + Mask parentRedirect; + Mask parentNotify; + xEvent event; + Bool anyMarked; #ifdef DO_SAVE_UNDERS Bool dosave = FALSE; #endif @@ -2952,7 +2952,7 @@ UnrealizeTree( WindowPtr pWin, Bool fromConfigure) { - register WindowPtr pChild; + WindowPtr pChild; UnrealizeWindowProcPtr Unrealize; MarkUnrealizedWindowProcPtr MarkUnrealizedWindow; @@ -3011,9 +3011,9 @@ UnrealizeTree( *****/ _X_EXPORT int -UnmapWindow(register WindowPtr pWin, Bool fromConfigure) +UnmapWindow(WindowPtr pWin, Bool fromConfigure) { - register WindowPtr pParent; + WindowPtr pParent; xEvent event; Bool wasRealized = (Bool)pWin->realized; Bool wasViewable = (Bool)pWin->viewable; @@ -3070,9 +3070,9 @@ UnmapWindow(register WindowPtr pWin, Bool fromConfigure) *****/ void -UnmapSubwindows(register WindowPtr pWin) +UnmapSubwindows(WindowPtr pWin) { - register WindowPtr pChild, pHead; + WindowPtr pChild, pHead; xEvent event; Bool wasRealized = (Bool)pWin->realized; Bool wasViewable = (Bool)pWin->viewable; @@ -3161,10 +3161,10 @@ UnmapSubwindows(register WindowPtr pWin) void -HandleSaveSet(register ClientPtr client) +HandleSaveSet(ClientPtr client) { - register WindowPtr pParent, pWin; - register int j; + WindowPtr pParent, pWin; + int j; for (j=0; jnumSaved; j++) { @@ -3207,7 +3207,7 @@ HandleSaveSet(register ClientPtr client) * \param box "return" value */ Bool -VisibleBoundingBoxFromPoint(register WindowPtr pWin, int x, int y, BoxPtr box) +VisibleBoundingBoxFromPoint(WindowPtr pWin, int x, int y, BoxPtr box) { if (!pWin->realized) return (FALSE); @@ -3221,7 +3221,7 @@ VisibleBoundingBoxFromPoint(register WindowPtr pWin, int x, int y, BoxPtr box) * \param x,y in root */ Bool -PointInWindowIsVisible(register WindowPtr pWin, int x, int y) +PointInWindowIsVisible(WindowPtr pWin, int x, int y) { BoxRec box; @@ -3240,9 +3240,9 @@ PointInWindowIsVisible(register WindowPtr pWin, int x, int y) _X_EXPORT RegionPtr -NotClippedByChildren(register WindowPtr pWin) +NotClippedByChildren(WindowPtr pWin) { - register ScreenPtr pScreen; + ScreenPtr pScreen; RegionPtr pReg; pScreen = pWin->drawable.pScreen; @@ -3588,7 +3588,7 @@ TileScreenSaver(int i, int kind) */ _X_EXPORT WindowPtr -FindWindowWithOptional (register WindowPtr w) +FindWindowWithOptional (WindowPtr w) { do w = w->parent; @@ -3605,10 +3605,10 @@ FindWindowWithOptional (register WindowPtr w) */ _X_EXPORT void -CheckWindowOptionalNeed (register WindowPtr w) +CheckWindowOptionalNeed (WindowPtr w) { - register WindowOptPtr optional; - register WindowOptPtr parentOptional; + WindowOptPtr optional; + WindowOptPtr parentOptional; if (!w->parent) return; @@ -3659,10 +3659,10 @@ CheckWindowOptionalNeed (register WindowPtr w) */ _X_EXPORT Bool -MakeWindowOptional (register WindowPtr pWin) +MakeWindowOptional (WindowPtr pWin) { - register WindowOptPtr optional; - register WindowOptPtr parentOptional; + WindowOptPtr optional; + WindowOptPtr parentOptional; if (pWin->optional) return TRUE; @@ -3701,7 +3701,7 @@ MakeWindowOptional (register WindowPtr pWin) } void -DisposeWindowOptional (register WindowPtr pWin) +DisposeWindowOptional (WindowPtr pWin) { if (!pWin->optional) return; From 405483496538f1c82cbd7fe1e76c5d94e1a90525 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 9 Mar 2007 14:16:23 +1030 Subject: [PATCH 31/39] mi: remove 'register' keywords. --- mi/miarc.c | 100 ++++++++-------- mi/mibitblt.c | 12 +- mi/mibstore.c | 62 +++++----- mi/micmap.c | 18 +-- mi/miexpose.c | 32 +++--- mi/mifillarc.c | 56 ++++----- mi/mifillrct.c | 20 ++-- mi/mifpolycon.c | 8 +- mi/miglblt.c | 20 ++-- mi/miline.h | 2 +- mi/mioverlay.c | 10 +- mi/mipoly.c | 8 +- mi/mipolycon.c | 8 +- mi/mipolygen.c | 12 +- mi/mipolypnt.c | 2 +- mi/mipolyutil.c | 42 +++---- mi/mipushpxl.c | 10 +- mi/miregion.c | 298 ++++++++++++++++++++++++------------------------ mi/miscrinit.c | 4 +- mi/mispans.c | 56 ++++----- mi/misprite.c | 10 +- mi/mivaltree.c | 30 ++--- mi/miwideline.c | 216 +++++++++++++++++------------------ mi/miwindow.c | 48 ++++---- mi/mizerarc.c | 28 ++--- 25 files changed, 556 insertions(+), 556 deletions(-) diff --git a/mi/miarc.c b/mi/miarc.c index 2b3a0cbbc..8b6d8c0a9 100644 --- a/mi/miarc.c +++ b/mi/miarc.c @@ -246,7 +246,7 @@ typedef struct _miPolyArc { static CARD32 gcvals[6]; static void fillSpans(DrawablePtr pDrawable, GCPtr pGC); -static void newFinalSpan(int y, register int xmin, register int xmax); +static void newFinalSpan(int y, int xmin, int xmax); static void drawArc(xArc *tarc, int l, int a0, int a1, miArcFacePtr right, miArcFacePtr left); static void drawZeroArc(DrawablePtr pDraw, GCPtr pGC, xArc *tarc, int lw, @@ -284,7 +284,7 @@ miArcSegment( { int l = pGC->lineWidth; int a0, a1, startAngle, endAngle; - miArcFacePtr temp; + miArcFacePtr temp; if (!l) l = 1; @@ -432,8 +432,8 @@ static RESTYPE cacheType; /*ARGSUSED*/ int miFreeArcCache (data, id) - pointer data; - XID id; + pointer data; + XID id; { int k; arcCacheRec *cent; @@ -461,11 +461,11 @@ miComputeCircleSpans( xArc *parc, miArcSpanData *spdata) { - register miArcSpan *span; + miArcSpan *span; int doinner; - register int x, y, e; + int x, y, e; int xk, yk, xm, ym, dx, dy; - register int slw, inslw; + int slw, inslw; int inx = 0, iny, ine = 0; int inxk = 0, inyk = 0, inxm = 0, inym = 0; @@ -529,7 +529,7 @@ miComputeEllipseSpans( xArc *parc, miArcSpanData *spdata) { - register miArcSpan *span; + miArcSpan *span; double w, h, r, xorg; double Hs, Hf, WH, K, Vk, Nk, Fk, Vr, N, Nc, Z, rs; double A, T, b, d, x, y, t, inx, outx = 0.0, hepp, hepm; @@ -859,13 +859,13 @@ tailX( static miArcSpanData * miComputeWideEllipse( - int lw, - register xArc *parc, - Bool *mustFree) + int lw, + xArc *parc, + Bool *mustFree) { - register miArcSpanData *spdata; - register arcCacheRec *cent, *lruent; - register int k; + miArcSpanData *spdata; + arcCacheRec *cent, *lruent; + int k; arcCacheRec fakeent; if (!lw) @@ -943,14 +943,14 @@ miFillWideEllipse( xArc *parc) { DDXPointPtr points; - register DDXPointPtr pts; + DDXPointPtr pts; int *widths; - register int *wids; + int *wids; miArcSpanData *spdata; Bool mustFree; - register miArcSpan *span; - register int xorg, yorgu, yorgl; - register int n; + miArcSpan *span; + int xorg, yorgu, yorgl; + int n; yorgu = parc->height + pGC->lineWidth; n = (sizeof(int) * 2) * yorgu; @@ -1077,20 +1077,20 @@ miPolyArc(pDraw, pGC, narcs, parcs) int narcs; xArc *parcs; { - register int i; - xArc *parc; - int xMin, xMax, yMin, yMax; - int pixmapWidth = 0, pixmapHeight = 0; - int xOrg = 0, yOrg = 0; - int width; - Bool fTricky; - DrawablePtr pDrawTo; - CARD32 fg, bg; - GCPtr pGCTo; - miPolyArcPtr polyArcs; - int cap[2], join[2]; - int iphase; - int halfWidth; + int i; + xArc *parc; + int xMin, xMax, yMin, yMax; + int pixmapWidth = 0, pixmapHeight = 0; + int xOrg = 0, yOrg = 0; + int width; + Bool fTricky; + DrawablePtr pDrawTo; + CARD32 fg, bg; + GCPtr pGCTo; + miPolyArcPtr polyArcs; + int cap[2], join[2]; + int iphase; + int halfWidth; width = pGC->lineWidth; if(width == 0 && pGC->lineStyle == LineSolid) @@ -3139,9 +3139,9 @@ static struct finalSpanChunk *chunks; struct finalSpan * realAllocSpan () { - register struct finalSpanChunk *newChunk; - register struct finalSpan *span; - register int i; + struct finalSpanChunk *newChunk; + struct finalSpan *span; + int i; newChunk = (struct finalSpanChunk *) xalloc (sizeof (struct finalSpanChunk)); if (!newChunk) @@ -3179,14 +3179,14 @@ fillSpans ( DrawablePtr pDrawable, GCPtr pGC) { - register struct finalSpan *span; - register DDXPointPtr xSpan; - register int *xWidth; - register int i; - register struct finalSpan **f; - register int spany; - DDXPointPtr xSpans; - int *xWidths; + struct finalSpan *span; + DDXPointPtr xSpan; + int *xWidth; + int i; + struct finalSpan **f; + int spany; + DDXPointPtr xSpans; + int *xWidths; if (nspans == 0) return; @@ -3280,13 +3280,13 @@ realFindSpan (int y) static void newFinalSpan ( int y, - register int xmin, - register int xmax) + int xmin, + int xmax) { - register struct finalSpan *x; - register struct finalSpan **f; - struct finalSpan *oldx; - struct finalSpan *prev; + struct finalSpan *x; + struct finalSpan **f; + struct finalSpan *oldx; + struct finalSpan *prev; f = findSpan (y); if (!f) diff --git a/mi/mibitblt.c b/mi/mibitblt.c index bf0e29ac0..e4b14078f 100644 --- a/mi/mibitblt.c +++ b/mi/mibitblt.c @@ -76,12 +76,12 @@ extern int ffs(int); _X_EXPORT RegionPtr miCopyArea(pSrcDrawable, pDstDrawable, pGC, xIn, yIn, widthSrc, heightSrc, xOut, yOut) - register DrawablePtr pSrcDrawable; - register DrawablePtr pDstDrawable; - GCPtr pGC; - int xIn, yIn; - int widthSrc, heightSrc; - int xOut, yOut; + DrawablePtr pSrcDrawable; + DrawablePtr pDstDrawable; + GCPtr pGC; + int xIn, yIn; + int widthSrc, heightSrc; + int xOut, yOut; { DDXPointPtr ppt, pptFirst; unsigned int *pwidthFirst, *pwidth, *pbits; diff --git a/mi/mibstore.c b/mi/mibstore.c index 6653c2345..70839ce31 100644 --- a/mi/mibstore.c +++ b/mi/mibstore.c @@ -152,11 +152,11 @@ static void miBSClearBackingRegion(WindowPtr pWin, RegionPtr pRgn); #define copyData(src,dst,n,morecopy) \ { \ - register short *srcCopy = (short *)(src); \ - register short *dstCopy = (short *)(dst); \ - register int i; \ - register int bsx = pBackingStore->x; \ - register int bsy = pBackingStore->y; \ + short *srcCopy = (short *)(src); \ + short *dstCopy = (short *)(dst); \ + int i; \ + int bsx = pBackingStore->x; \ + int bsy = pBackingStore->y; \ for (i = n; --i >= 0; ) \ { \ *dstCopy++ = *srcCopy++ - bsx; \ @@ -1010,7 +1010,7 @@ miBSSetSpans(pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted) DrawablePtr pDrawable; GCPtr pGC; char *psrc; - register DDXPointPtr ppt; + DDXPointPtr ppt; int *pwidth; int nspans; int fSorted; @@ -1150,8 +1150,8 @@ miBSDoCopy( } *boxes; /* Array of box/drawable pairs covering * source box. */ int *sequence; /* Sequence of boxes to move */ - register int i, j, k, l, y; - register BoxPtr pBox; + int i, j, k, l, y; + BoxPtr pBox; int dx, dy, nrects; Bool graphicsExposures; CopyPlaneProcPtr pixCopyProc; @@ -1591,7 +1591,7 @@ static RegionPtr miBSCopyPlane (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty, plane) DrawablePtr pSrc; DrawablePtr pDst; - register GC *pGC; + GC *pGC; int srcx, srcy; int w, @@ -1901,9 +1901,9 @@ miBSPolyArc(pDrawable, pGC, narcs, parcs) static void miBSFillPolygon(pDrawable, pGC, shape, mode, count, pPts) DrawablePtr pDrawable; - register GCPtr pGC; + GCPtr pGC; int shape, mode; - register int count; + int count; DDXPointPtr pPts; { DDXPointPtr pPtsCopy; @@ -2546,8 +2546,8 @@ static void miBSAllocate(pWin) WindowPtr pWin; { - register miBSWindowPtr pBackingStore; - register ScreenPtr pScreen; + miBSWindowPtr pBackingStore; + ScreenPtr pScreen; if (pWin->drawable.pScreen->backingStoreSupport == NotUseful) return; @@ -2648,7 +2648,7 @@ miBSFree(pWin) WindowPtr pWin; { miBSWindowPtr pBackingStore; - register ScreenPtr pScreen; + ScreenPtr pScreen; pScreen = pWin->drawable.pScreen; @@ -2792,9 +2792,9 @@ miResizeBackingStore( */ static void miBSSaveDoomedAreas(pWin, pObscured, dx, dy) - register WindowPtr pWin; - RegionPtr pObscured; - int dx, dy; + WindowPtr pWin; + RegionPtr pObscured; + int dx, dy; { miBSWindowPtr pBackingStore; ScreenPtr pScreen; @@ -2899,14 +2899,14 @@ miBSSaveDoomedAreas(pWin, pObscured, dx, dy) */ static RegionPtr miBSRestoreAreas(pWin, prgnExposed) - register WindowPtr pWin; + WindowPtr pWin; RegionPtr prgnExposed; { PixmapPtr pBackingPixmap; miBSWindowPtr pBackingStore; RegionPtr prgnSaved; RegionPtr prgnRestored; - register ScreenPtr pScreen; + ScreenPtr pScreen; RegionPtr exposures = prgnExposed; pScreen = pWin->drawable.pScreen; @@ -3097,15 +3097,15 @@ miBSTranslateBackingStore(pWin, windx, windy, oldClip, oldx, oldy) int oldx; /* old window position */ int oldy; { - register miBSWindowPtr pBackingStore; - register RegionPtr pSavedRegion; - register RegionPtr newSaved, doomed; - register ScreenPtr pScreen; - BoxRec extents; - int scrdx; /* bit translation distance on screen */ - int scrdy; - int dx; /* distance window moved on screen */ - int dy; + miBSWindowPtr pBackingStore; + RegionPtr pSavedRegion; + RegionPtr newSaved, doomed; + ScreenPtr pScreen; + BoxRec extents; + int scrdx; /* bit translation distance on screen */ + int scrdy; + int dx; /* distance window moved on screen */ + int dy; pScreen = pWin->drawable.pScreen; pBackingStore = (miBSWindowPtr)(pWin->backStorage); @@ -3815,9 +3815,9 @@ miBSExposeCopy (pSrc, pDst, pGC, prgnExposed, srcx, srcy, dstx, dsty, plane) miBSWindowPtr pBackingStore; CopyPlaneProcPtr copyProc; GCPtr pScratchGC; - register BoxPtr pBox; - register int i; - register int dx, dy; + BoxPtr pBox; + int i; + int dx, dy; BITS32 gcMask; if (!REGION_NOTEMPTY(pGC->pScreen, prgnExposed)) diff --git a/mi/micmap.c b/mi/micmap.c index 987affe96..977c587a0 100644 --- a/mi/micmap.c +++ b/mi/micmap.c @@ -125,8 +125,8 @@ miResolveColor(unsigned short *pred, unsigned short *pgreen, _X_EXPORT Bool miInitializeColormap(ColormapPtr pmap) { - register unsigned i; - register VisualPtr pVisual; + unsigned i; + VisualPtr pVisual; unsigned lim, maxent, shift; pVisual = pmap->pVisual; @@ -211,13 +211,13 @@ _X_EXPORT int miExpandDirectColors(ColormapPtr pmap, int ndef, xColorItem *indefs, xColorItem *outdefs) { - register int red, green, blue; - int maxred, maxgreen, maxblue; - int stepred, stepgreen, stepblue; - VisualPtr pVisual; - register int pixel; - register int nresult; - register int i; + int red, green, blue; + int maxred, maxgreen, maxblue; + int stepred, stepgreen, stepblue; + VisualPtr pVisual; + int pixel; + int nresult; + int i; pVisual = pmap->pVisual; diff --git a/mi/miexpose.c b/mi/miexpose.c index 1ca5fc965..df04bd291 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -130,15 +130,15 @@ exposing is done by the backing store's GraphicsExpose function, of course. _X_EXPORT RegionPtr miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty, plane) - register DrawablePtr pSrcDrawable; - register DrawablePtr pDstDrawable; + DrawablePtr pSrcDrawable; + DrawablePtr pDstDrawable; GCPtr pGC; int srcx, srcy; int width, height; int dstx, dsty; unsigned long plane; { - register ScreenPtr pscr; + ScreenPtr pscr; RegionPtr prgnSrcClip; /* drawable-relative source clip */ RegionRec rgnSrcRec; RegionPtr prgnDstClip; /* drawable-relative dest clip */ @@ -387,9 +387,9 @@ miSendGraphicsExpose (client, pRgn, drawable, major, minor) if (pRgn && !REGION_NIL(pRgn)) { xEvent *pEvent; - register xEvent *pe; - register BoxPtr pBox; - register int i; + xEvent *pe; + BoxPtr pBox; + int i; int numRects; numRects = REGION_NUM_RECTS(pRgn); @@ -431,12 +431,12 @@ void miSendExposures(pWin, pRgn, dx, dy) WindowPtr pWin; RegionPtr pRgn; - register int dx, dy; + int dx, dy; { - register BoxPtr pBox; + BoxPtr pBox; int numRects; - register xEvent *pEvent, *pe; - register int i; + xEvent *pEvent, *pe; + int i; pBox = REGION_RECTS(pRgn); numRects = REGION_NUM_RECTS(pRgn); @@ -493,7 +493,7 @@ miSendExposures(pWin, pRgn, dx, dy) _X_EXPORT void miWindowExposures(pWin, prgn, other_exposed) WindowPtr pWin; - register RegionPtr prgn, other_exposed; + RegionPtr prgn, other_exposed; { RegionPtr exposures = prgn; if (pWin->backStorage && prgn) @@ -629,7 +629,7 @@ tossGC ( _X_EXPORT void miPaintWindow(pWin, prgn, what) -register WindowPtr pWin; +WindowPtr pWin; RegionPtr prgn; int what; { @@ -657,10 +657,10 @@ int what; BoxRec box; WindowPtr pBgWin; GCPtr pGC; - register int i; - register BoxPtr pbox; - register ScreenPtr pScreen = pWin->drawable.pScreen; - register xRectangle *prect; + int i; + BoxPtr pbox; + ScreenPtr pScreen = pWin->drawable.pScreen; + xRectangle *prect; int numRects; gcmask = 0; diff --git a/mi/mifillarc.c b/mi/mifillarc.c index 66063166a..46c073851 100644 --- a/mi/mifillarc.c +++ b/mi/mifillarc.c @@ -54,8 +54,8 @@ Author: Bob Scheifler, MIT X Consortium _X_EXPORT void miFillArcSetup(arc, info) - register xArc *arc; - register miFillArcRec *info; + xArc *arc; + miFillArcRec *info; { info->y = arc->height >> 1; info->dy = arc->height & 1; @@ -109,8 +109,8 @@ miFillArcSetup(arc, info) void miFillArcDSetup(arc, info) - register xArc *arc; - register miFillArcDRec *info; + xArc *arc; + miFillArcDRec *info; { /* h^2 * (2x - 2xorg)^2 = w^2 * h^2 - w^2 * (2y - 2yorg)^2 */ /* even: xorg = yorg = 0 odd: xorg = .5, yorg = -.5 */ @@ -141,13 +141,13 @@ miFillArcDSetup(arc, info) static void miGetArcEdge( - register xArc *arc, - register miSliceEdgePtr edge, + xArc *arc, + miSliceEdgePtr edge, int k, Bool top, Bool left ) { - register int xady, y; + int xady, y; y = arc->height >> 1; if (!(arc->width & 1)) @@ -271,13 +271,13 @@ miEllipseAngleToSlope (angle, width, height, dxp, dyp, d_dxp, d_dyp) static void miGetPieEdge( - register xArc *arc, - register int angle, - register miSliceEdgePtr edge, + xArc *arc, + int angle, + miSliceEdgePtr edge, Bool top, Bool left ) { - register int k; + int k; int dx, dy; miEllipseAngleToSlope (angle, arc->width, arc->height, &dx, &dy, 0, 0); @@ -316,11 +316,11 @@ miGetPieEdge( _X_EXPORT void miFillArcSliceSetup(arc, slice, pGC) - register xArc *arc; - register miArcSliceRec *slice; + xArc *arc; + miArcSliceRec *slice; GCPtr pGC; { - register int angle1, angle2; + int angle1, angle2; angle1 = arc->angle1; if (arc->angle2 < 0) @@ -550,14 +550,14 @@ miFillEllipseI( GCPtr pGC, xArc *arc ) { - register int x, y, e; + int x, y, e; int yk, xk, ym, xm, dx, dy, xorg, yorg; int slw; miFillArcRec info; DDXPointPtr points; - register DDXPointPtr pts; + DDXPointPtr pts; int *widths; - register int *wids; + int *wids; points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * arc->height); if (!points) @@ -593,14 +593,14 @@ miFillEllipseD( GCPtr pGC, xArc *arc ) { - register int x, y; + int x, y; int xorg, yorg, dx, dy, slw; double e, yk, xk, ym, xm; miFillArcDRec info; DDXPointPtr points; - register DDXPointPtr pts; + DDXPointPtr pts; int *widths; - register int *wids; + int *wids; points = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec) * arc->height); if (!points) @@ -659,14 +659,14 @@ miFillArcSliceI( xArc *arc ) { int yk, xk, ym, xm, dx, dy, xorg, yorg, slw; - register int x, y, e; + int x, y, e; miFillArcRec info; miArcSliceRec slice; int ya, xl, xr, xc; DDXPointPtr points; - register DDXPointPtr pts; + DDXPointPtr pts; int *widths; - register int *wids; + int *wids; miFillArcSetup(arc, &info); miFillArcSliceSetup(arc, &slice, pGC); @@ -721,16 +721,16 @@ miFillArcSliceD( GCPtr pGC, xArc *arc ) { - register int x, y; + int x, y; int dx, dy, xorg, yorg, slw; double e, yk, xk, ym, xm; miFillArcDRec info; miArcSliceRec slice; int ya, xl, xr, xc; DDXPointPtr points; - register DDXPointPtr pts; + DDXPointPtr pts; int *widths; - register int *wids; + int *wids; miFillArcDSetup(arc, &info); miFillArcSliceSetup(arc, &slice, pGC); @@ -790,8 +790,8 @@ miPolyFillArc(pDraw, pGC, narcs, parcs) int narcs; xArc *parcs; { - register int i; - register xArc *arc; + int i; + xArc *arc; for(i = narcs, arc = parcs; --i >= 0; arc++) { diff --git a/mi/mifillrct.c b/mi/mifillrct.c index 78e89d69c..ca7e86445 100644 --- a/mi/mifillrct.c +++ b/mi/mifillrct.c @@ -74,16 +74,16 @@ miPolyFillRect(pDrawable, pGC, nrectFill, prectInit) xRectangle *prectInit; /* Pointer to first rectangle to fill */ { int i; - register int height; - register int width; - register xRectangle *prect; - int xorg; - register int yorg; - int maxheight; - DDXPointPtr pptFirst; - register DDXPointPtr ppt; - int *pwFirst; - register int *pw; + int height; + int width; + xRectangle *prect; + int xorg; + int yorg; + int maxheight; + DDXPointPtr pptFirst; + DDXPointPtr ppt; + int *pwFirst; + int *pw; if (pGC->miTranslate) { diff --git a/mi/mifpolycon.c b/mi/mifpolycon.c index 57229f639..7bc1bb278 100644 --- a/mi/mifpolycon.c +++ b/mi/mifpolycon.c @@ -55,7 +55,7 @@ SOFTWARE. #include "pixmapstr.h" #include "mifpoly.h" -static int GetFPolyYBounds(register SppPointPtr pts, int n, double yFtrans, +static int GetFPolyYBounds(SppPointPtr pts, int n, double yFtrans, int *by, int *ty); #ifdef ICEILTEMPDECL @@ -101,7 +101,7 @@ miFillSppPoly(dst, pgc, count, ptsIn, xTrans, yTrans, xFtrans, yFtrans) *width, *FirstWidth, /* output buffer */ *Marked; /* set if this vertex has been used */ - register int left, right, /* indices to first endpoints */ + int left, right, /* indices to first endpoints */ nextleft, nextright; /* indices to second endpoints */ DDXPointPtr ptsOut, @@ -251,13 +251,13 @@ miFillSppPoly(dst, pgc, count, ptsIn, xTrans, yTrans, xFtrans, yFtrans) static int GetFPolyYBounds( - register SppPointPtr pts, + SppPointPtr pts, int n, double yFtrans, int *by, int *ty) { - register SppPointPtr ptMin; + SppPointPtr ptMin; double ymin, ymax; SppPointPtr ptsStart = pts; diff --git a/mi/miglblt.c b/mi/miglblt.c index db299a8ae..4db3eb62f 100644 --- a/mi/miglblt.c +++ b/mi/miglblt.c @@ -92,18 +92,18 @@ miPolyGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) { int width, height; PixmapPtr pPixmap; - int nbyLine; /* bytes per line of padded pixmap */ + int nbyLine; /* bytes per line of padded pixmap */ FontPtr pfont; GCPtr pGCtmp; - register int i; - register int j; - unsigned char *pbits; /* buffer for PutImage */ - register unsigned char *pb; /* temp pointer into buffer */ - register CharInfoPtr pci; /* currect char info */ - register unsigned char *pglyph; /* pointer bits in glyph */ - int gWidth, gHeight; /* width and height of glyph */ - register int nbyGlyphWidth; /* bytes per scanline of glyph */ - int nbyPadGlyph; /* server padded line of glyph */ + int i; + int j; + unsigned char *pbits; /* buffer for PutImage */ + unsigned char *pb; /* temp pointer into buffer */ + CharInfoPtr pci; /* currect char info */ + unsigned char *pglyph; /* pointer bits in glyph */ + int gWidth, gHeight; /* width and height of glyph */ + int nbyGlyphWidth; /* bytes per scanline of glyph */ + int nbyPadGlyph; /* server padded line of glyph */ XID gcvals[3]; diff --git a/mi/miline.h b/mi/miline.h index 7028485f0..b97b8cf9d 100644 --- a/mi/miline.h +++ b/mi/miline.h @@ -109,7 +109,7 @@ extern void miSetZeroLineBias( } #define SWAPINT(i, j) \ -{ register int _t = i; i = j; j = _t; } +{ int _t = i; i = j; j = _t; } #define SWAPPT(i, j) \ { DDXPointRec _t; _t = i; i = j; j = _t; } diff --git a/mi/mioverlay.c b/mi/mioverlay.c index c02ea2dc5..5724a6fed 100644 --- a/mi/mioverlay.c +++ b/mi/mioverlay.c @@ -1019,7 +1019,7 @@ miOverlayMoveWindow( static void miOverlayWindowExposures( WindowPtr pWin, - register RegionPtr prgn, + RegionPtr prgn, RegionPtr other_exposed ){ RegionPtr exposures = prgn; @@ -1106,7 +1106,7 @@ miOverlayRecomputeExposures ( WindowPtr pWin, pointer value ){ - register ScreenPtr pScreen; + ScreenPtr pScreen; miOverlayTwoRegions *pValid = (miOverlayTwoRegions*)value; miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); @@ -1161,10 +1161,10 @@ miOverlayResizeWindow( DDXPointRec oldpt; RegionPtr oldRegion = NULL, oldRegion2 = NULL; WindowPtr pFirstChange; - register WindowPtr pChild; + WindowPtr pChild; RegionPtr gravitate[StaticGravity + 1]; RegionPtr gravitate2[StaticGravity + 1]; - register unsigned g; + unsigned g; int nx, ny; /* destination x,y */ int newx, newy; /* new inner window position */ RegionPtr pRegion = NULL; @@ -1669,7 +1669,7 @@ miOverlayChangeBorderWidth( unsigned int width ){ int oldwidth; - register ScreenPtr pScreen; + ScreenPtr pScreen; Bool WasViewable = (Bool)(pWin->viewable); Bool HadBorder; #ifdef DO_SAVE_UNDERS diff --git a/mi/mipoly.c b/mi/mipoly.c index b514b5ed2..ea0406f88 100644 --- a/mi/mipoly.c +++ b/mi/mipoly.c @@ -70,14 +70,14 @@ SOFTWARE. _X_EXPORT void miFillPolygon(dst, pgc, shape, mode, count, pPts) DrawablePtr dst; - register GCPtr pgc; + GCPtr pgc; int shape, mode; - register int count; + int count; DDXPointPtr pPts; { int i; - register int xorg, yorg; - register DDXPointPtr ppt; + int xorg, yorg; + DDXPointPtr ppt; if (count == 0) return; diff --git a/mi/mipolycon.c b/mi/mipolycon.c index b5ab89364..e2d666e51 100644 --- a/mi/mipolycon.c +++ b/mi/mipolycon.c @@ -78,9 +78,9 @@ miFillConvexPoly(dst, pgc, count, ptsIn) int count; /* number of points */ DDXPointPtr ptsIn; /* the points */ { - register int xl = 0, xr = 0; /* x vals of left and right edges */ - register int dl = 0, dr = 0; /* decision variables */ - register int ml = 0, m1l = 0;/* left edge slope and slope+1 */ + int xl = 0, xr = 0; /* x vals of left and right edges */ + int dl = 0, dr = 0; /* decision variables */ + int ml = 0, m1l = 0;/* left edge slope and slope+1 */ int mr = 0, m1r = 0; /* right edge slope and slope+1 */ int incr1l = 0, incr2l = 0; /* left edge error increments */ int incr1r = 0, incr2r = 0; /* right edge error increments */ @@ -221,7 +221,7 @@ miFillConvexPoly(dst, pgc, count, ptsIn) static int getPolyYBounds(DDXPointPtr pts, int n, int *by, int *ty) { - register DDXPointPtr ptMin; + DDXPointPtr ptMin; int ymin, ymax; DDXPointPtr ptsStart = pts; diff --git a/mi/mipolygen.c b/mi/mipolygen.c index 34da21f9e..0d2ecc430 100644 --- a/mi/mipolygen.c +++ b/mi/mipolygen.c @@ -72,12 +72,12 @@ miFillGeneralPoly(dst, pgc, count, ptsIn) int count; /* number of points */ DDXPointPtr ptsIn; /* the points */ { - register EdgeTableEntry *pAET; /* the Active Edge Table */ - register int y; /* the current scanline */ - register int nPts = 0; /* number of pts in buffer */ - register EdgeTableEntry *pWETE; /* Winding Edge Table */ - register ScanLineList *pSLL; /* Current ScanLineList */ - register DDXPointPtr ptsOut; /* ptr to output buffers */ + EdgeTableEntry *pAET; /* the Active Edge Table */ + int y; /* the current scanline */ + int nPts = 0; /* number of pts in buffer */ + EdgeTableEntry *pWETE; /* Winding Edge Table */ + ScanLineList *pSLL; /* Current ScanLineList */ + DDXPointPtr ptsOut; /* ptr to output buffers */ int *width; DDXPointRec FirstPoint[NUMPTSTOBUFFER]; /* the output buffers */ int FirstWidth[NUMPTSTOBUFFER]; diff --git a/mi/mipolypnt.c b/mi/mipolypnt.c index 245bda317..afe3f724a 100644 --- a/mi/mipolypnt.c +++ b/mi/mipolypnt.c @@ -70,7 +70,7 @@ miPolyPoint(pDrawable, pGC, mode, npt, pptInit) XID fsOld, fsNew; int *pwidthInit, *pwidth; int i; - register xPoint *ppt; + xPoint *ppt; /* make pointlist origin relative */ if (mode == CoordModePrevious) diff --git a/mi/mipolyutil.c b/mi/mipolyutil.c index 5443ba5c3..fe72e557f 100644 --- a/mi/mipolyutil.c +++ b/mi/mipolyutil.c @@ -81,8 +81,8 @@ miInsertEdgeInET(ET, ETE, scanline, SLLBlock, iSLLBlock) ScanLineListBlock **SLLBlock; int *iSLLBlock; { - register EdgeTableEntry *start, *prev; - register ScanLineList *pSLL, *pPrevSLL; + EdgeTableEntry *start, *prev; + ScanLineList *pSLL, *pPrevSLL; ScanLineListBlock *tmpSLLBlock; /* @@ -166,15 +166,15 @@ miInsertEdgeInET(ET, ETE, scanline, SLLBlock, iSLLBlock) Bool miCreateETandAET(count, pts, ET, AET, pETEs, pSLLBlock) - register int count; - register DDXPointPtr pts; + int count; + DDXPointPtr pts; EdgeTable *ET; EdgeTableEntry *AET; - register EdgeTableEntry *pETEs; + EdgeTableEntry *pETEs; ScanLineListBlock *pSLLBlock; { - register DDXPointPtr top, bottom; - register DDXPointPtr PrevPt, CurrPt; + DDXPointPtr top, bottom; + DDXPointPtr PrevPt, CurrPt; int iSLLBlock = 0; int dy; @@ -262,10 +262,10 @@ miCreateETandAET(count, pts, ET, AET, pETEs, pSLLBlock) void miloadAET(AET, ETEs) - register EdgeTableEntry *AET, *ETEs; + EdgeTableEntry *AET, *ETEs; { - register EdgeTableEntry *pPrevAET; - register EdgeTableEntry *tmp; + EdgeTableEntry *pPrevAET; + EdgeTableEntry *tmp; pPrevAET = AET; AET = AET->next; @@ -310,11 +310,11 @@ miloadAET(AET, ETEs) */ void micomputeWAET(AET) - register EdgeTableEntry *AET; + EdgeTableEntry *AET; { - register EdgeTableEntry *pWETE; - register int inside = 1; - register int isInside = 0; + EdgeTableEntry *pWETE; + int inside = 1; + int isInside = 0; AET->nextWETE = (EdgeTableEntry *)NULL; pWETE = AET; @@ -349,12 +349,12 @@ micomputeWAET(AET) int miInsertionSort(AET) - register EdgeTableEntry *AET; + EdgeTableEntry *AET; { - register EdgeTableEntry *pETEchase; - register EdgeTableEntry *pETEinsert; - register EdgeTableEntry *pETEchaseBackTMP; - register int changed = 0; + EdgeTableEntry *pETEchase; + EdgeTableEntry *pETEinsert; + EdgeTableEntry *pETEchaseBackTMP; + int changed = 0; AET = AET->next; while (AET) @@ -386,9 +386,9 @@ miInsertionSort(AET) */ void miFreeStorage(pSLLBlock) - register ScanLineListBlock *pSLLBlock; + ScanLineListBlock *pSLLBlock; { - register ScanLineListBlock *tmpSLLBlock; + ScanLineListBlock *tmpSLLBlock; while (pSLLBlock) { diff --git a/mi/mipushpxl.c b/mi/mipushpxl.c index 6526aa02b..3695f30da 100644 --- a/mi/mipushpxl.c +++ b/mi/mipushpxl.c @@ -85,11 +85,11 @@ miPushPixels(pGC, pBitMap, pDrawable, dx, dy, xOrg, yOrg) int dx, dy, xOrg, yOrg; { int h, dxDivPPW, ibEnd; - MiBits *pwLineStart; - register MiBits *pw, *pwEnd; - register MiBits msk; - register int ib, w; - register int ipt; /* index into above arrays */ + MiBits *pwLineStart; + MiBits *pw, *pwEnd; + MiBits msk; + int ib, w; + int ipt; /* index into above arrays */ Bool fInBox; DDXPointRec pt[NPT], ptThisLine; int width[NPT]; diff --git a/mi/miregion.c b/mi/miregion.c index 0db46dcf5..542209982 100644 --- a/mi/miregion.c +++ b/mi/miregion.c @@ -228,7 +228,7 @@ miPrintRegion(rgn) RegionPtr rgn; { int num, size; - register int i; + int i; BoxPtr rects; num = REGION_NUM_RECTS(rgn); @@ -275,7 +275,7 @@ Bool miValidRegion(reg) RegionPtr reg; { - register int i, numRects; + int i, numRects; if ((reg->extents.x1 > reg->extents.x2) || (reg->extents.y1 > reg->extents.y2)) @@ -289,7 +289,7 @@ miValidRegion(reg) return (!reg->data); else { - register BoxPtr pboxP, pboxN; + BoxPtr pboxP, pboxN; BoxRec box; pboxP = REGION_RECTS(reg); @@ -331,7 +331,7 @@ miRegionCreate(rect, size) BoxPtr rect; int size; { - register RegionPtr pReg; + RegionPtr pReg; pReg = (RegionPtr)xalloc(sizeof(RegionRec)); if (!pReg) @@ -414,7 +414,7 @@ miRegionBreak (pReg) _X_EXPORT Bool miRectAlloc( - register RegionPtr pRgn, + RegionPtr pRgn, int n) { RegDataPtr data; @@ -455,8 +455,8 @@ miRectAlloc( _X_EXPORT Bool miRegionCopy(dst, src) - register RegionPtr dst; - register RegionPtr src; + RegionPtr dst; + RegionPtr src; { good(dst); good(src); @@ -508,14 +508,14 @@ miRegionCopy(dst, src) */ INLINE static int miCoalesce ( - register RegionPtr pReg, /* Region to coalesce */ + RegionPtr pReg, /* Region to coalesce */ int prevStart, /* Index of start of previous band */ int curStart) /* Index of start of current band */ { - register BoxPtr pPrevBox; /* Current box in previous band */ - register BoxPtr pCurBox; /* Current box in current band */ - register int numRects; /* Number rectangles in both bands */ - register int y2; /* Bottom of current band */ + BoxPtr pPrevBox; /* Current box in previous band */ + BoxPtr pCurBox; /* Current box in current band */ + int numRects; /* Number rectangles in both bands */ + int y2; /* Bottom of current band */ /* * Figure out how many rectangles are in the band. */ @@ -592,14 +592,14 @@ miCoalesce ( INLINE static Bool miAppendNonO ( - register RegionPtr pReg, - register BoxPtr r, - BoxPtr rEnd, - register int y1, - register int y2) + RegionPtr pReg, + BoxPtr r, + BoxPtr rEnd, + int y1, + int y2) { - register BoxPtr pNextRect; - register int newRects; + BoxPtr pNextRect; + int newRects; newRects = rEnd - r; @@ -691,25 +691,25 @@ miRegionOp( /* in region 2 ? */ Bool *pOverlap) { - register BoxPtr r1; /* Pointer into first region */ - register BoxPtr r2; /* Pointer into 2d region */ - BoxPtr r1End; /* End of 1st region */ - BoxPtr r2End; /* End of 2d region */ - short ybot; /* Bottom of intersection */ - short ytop; /* Top of intersection */ - RegDataPtr oldData; /* Old data for newReg */ - int prevBand; /* Index of start of - * previous band in newReg */ - int curBand; /* Index of start of current - * band in newReg */ - register BoxPtr r1BandEnd; /* End of current band in r1 */ - register BoxPtr r2BandEnd; /* End of current band in r2 */ - short top; /* Top of non-overlapping band */ - short bot; /* Bottom of non-overlapping band*/ - register int r1y1; /* Temps for r1->y1 and r2->y1 */ - register int r2y1; - int newSize; - int numRects; + BoxPtr r1; /* Pointer into first region */ + BoxPtr r2; /* Pointer into 2d region */ + BoxPtr r1End; /* End of 1st region */ + BoxPtr r2End; /* End of 2d region */ + short ybot; /* Bottom of intersection */ + short ytop; /* Top of intersection */ + RegDataPtr oldData; /* Old data for newReg */ + int prevBand; /* Index of start of + * previous band in newReg */ + int curBand; /* Index of start of current + * band in newReg */ + BoxPtr r1BandEnd; /* End of current band in r1 */ + BoxPtr r2BandEnd; /* End of current band in r2 */ + short top; /* Top of non-overlapping band */ + short bot; /* Bottom of non-overlapping band*/ + int r1y1; /* Temps for r1->y1 and r2->y1 */ + int r2y1; + int newSize; + int numRects; /* * Break any region computed from a broken region @@ -915,9 +915,9 @@ miRegionOp( */ void miSetExtents (pReg) - register RegionPtr pReg; + RegionPtr pReg; { - register BoxPtr pBox, pBoxEnd; + BoxPtr pBox, pBoxEnd; if (!pReg->data) return; @@ -974,18 +974,18 @@ miSetExtents (pReg) /*ARGSUSED*/ static Bool miIntersectO ( - register RegionPtr pReg, - register BoxPtr r1, + RegionPtr pReg, + BoxPtr r1, BoxPtr r1End, - register BoxPtr r2, + BoxPtr r2, BoxPtr r2End, short y1, short y2, Bool *pOverlap) { - register int x1; - register int x2; - register BoxPtr pNextRect; + int x1; + int x2; + BoxPtr pNextRect; pNextRect = REGION_TOP(pReg); @@ -1022,9 +1022,9 @@ miIntersectO ( _X_EXPORT Bool miIntersect(newReg, reg1, reg2) - register RegionPtr newReg; /* destination Region */ - register RegionPtr reg1; - register RegionPtr reg2; /* source regions */ + RegionPtr newReg; /* destination Region */ + RegionPtr reg1; + RegionPtr reg2; /* source regions */ { good(reg1); good(reg2); @@ -1117,18 +1117,18 @@ miIntersect(newReg, reg1, reg2) */ static Bool miUnionO ( - register RegionPtr pReg, - register BoxPtr r1, - BoxPtr r1End, - register BoxPtr r2, - BoxPtr r2End, - short y1, - short y2, - Bool *pOverlap) + RegionPtr pReg, + BoxPtr r1, + BoxPtr r1End, + BoxPtr r2, + BoxPtr r2End, + short y1, + short y2, + Bool *pOverlap) { - register BoxPtr pNextRect; - register int x1; /* left and right side of current union */ - register int x2; + BoxPtr pNextRect; + int x1; /* left and right side of current union */ + int x2; assert (y1 < y2); assert(r1 != r1End && r2 != r2End); @@ -1178,8 +1178,8 @@ miUnionO ( _X_EXPORT Bool miUnion(newReg, reg1, reg2) RegionPtr newReg; /* destination Region */ - register RegionPtr reg1; - register RegionPtr reg2; /* source regions */ + RegionPtr reg1; + RegionPtr reg2; /* source regions */ { Bool overlap; /* result ignored */ @@ -1276,8 +1276,8 @@ miUnion(newReg, reg1, reg2) */ _X_EXPORT Bool miRegionAppend(dstrgn, rgn) - register RegionPtr dstrgn; - register RegionPtr rgn; + RegionPtr dstrgn; + RegionPtr rgn; { int numRects, dnumRects, size; BoxPtr new, old; @@ -1307,7 +1307,7 @@ miRegionAppend(dstrgn, rgn) dstrgn->extents = rgn->extents; else if (dstrgn->extents.x2 > dstrgn->extents.x1) { - register BoxPtr first, last; + BoxPtr first, last; first = old; last = REGION_BOXPTR(dstrgn) + (dnumRects - 1); @@ -1371,13 +1371,13 @@ miRegionAppend(dstrgn, rgn) static void QuickSortRects( - register BoxRec rects[], - register int numRects) + BoxRec rects[], + int numRects) { - register int y1; - register int x1; - register int i, j; - register BoxPtr r; + int y1; + int x1; + int i, j; + BoxPtr r; /* Always called with numRects > 1 */ @@ -1472,17 +1472,17 @@ miRegionValidate(badreg, pOverlap) int curBand; } RegionInfo; - int numRects; /* Original numRects for badreg */ - RegionInfo *ri; /* Array of current regions */ - int numRI; /* Number of entries used in ri */ - int sizeRI; /* Number of entries available in ri */ - int i; /* Index into rects */ - register int j; /* Index into ri */ - register RegionInfo *rit; /* &ri[j] */ - register RegionPtr reg; /* ri[j].reg */ - register BoxPtr box; /* Current box in rects */ - register BoxPtr riBox; /* Last box in ri[j].reg */ - register RegionPtr hreg; /* ri[j_half].reg */ + int numRects; /* Original numRects for badreg */ + RegionInfo *ri; /* Array of current regions */ + int numRI; /* Number of entries used in ri */ + int sizeRI; /* Number of entries available in ri */ + int i; /* Index into rects */ + int j; /* Index into ri */ + RegionInfo *rit; /* &ri[j] */ + RegionPtr reg; /* ri[j].reg */ + BoxPtr box; /* Current box in rects */ + BoxPtr riBox; /* Last box in ri[j].reg */ + RegionPtr hreg; /* ri[j_half].reg */ Bool ret = TRUE; *pOverlap = FALSE; @@ -1654,13 +1654,13 @@ bail: _X_EXPORT RegionPtr miRectsToRegion(nrects, prect, ctype) int nrects; - register xRectangle *prect; + xRectangle *prect; int ctype; { - register RegionPtr pRgn; - register RegDataPtr pData; - register BoxPtr pBox; - register int i; + RegionPtr pRgn; + RegDataPtr pData; + BoxPtr pBox; + int i; int x1, y1, x2, y2; pRgn = miRegionCreate(NullBox, 0); @@ -1754,17 +1754,17 @@ miRectsToRegion(nrects, prect, ctype) /*ARGSUSED*/ static Bool miSubtractO ( - register RegionPtr pReg, - register BoxPtr r1, - BoxPtr r1End, - register BoxPtr r2, - BoxPtr r2End, - register short y1, - short y2, - Bool *pOverlap) + RegionPtr pReg, + BoxPtr r1, + BoxPtr r1End, + BoxPtr r2, + BoxPtr r2End, + short y1, + short y2, + Bool *pOverlap) { - register BoxPtr pNextRect; - register int x1; + BoxPtr pNextRect; + int x1; x1 = r1->x1; @@ -1878,9 +1878,9 @@ miSubtractO ( */ _X_EXPORT Bool miSubtract(regD, regM, regS) - register RegionPtr regD; - register RegionPtr regM; - register RegionPtr regS; + RegionPtr regD; + RegionPtr regM; + RegionPtr regS; { Bool overlap; /* result ignored */ @@ -2003,15 +2003,15 @@ miInverse(newReg, reg1, invRect) _X_EXPORT int miRectIn(region, prect) - register RegionPtr region; - register BoxPtr prect; + RegionPtr region; + BoxPtr prect; { - register int x; - register int y; - register BoxPtr pbox; - register BoxPtr pboxEnd; - int partIn, partOut; - int numRects; + int x; + int y; + BoxPtr pbox; + BoxPtr pboxEnd; + int partIn, partOut; + int numRects; good(region); numRects = REGION_NUM_RECTS(region); @@ -2099,13 +2099,13 @@ miRectIn(region, prect) _X_EXPORT void miTranslateRegion(pReg, x, y) - register RegionPtr pReg; - register int x; - register int y; + RegionPtr pReg; + int x; + int y; { int x1, x2, y1, y2; - register int nbox; - register BoxPtr pbox; + int nbox; + BoxPtr pbox; good(pReg); pReg->extents.x1 = x1 = pReg->extents.x1 + x; @@ -2144,7 +2144,7 @@ miTranslateRegion(pReg, x, y) pReg->extents.y2 = MAXSHORT; if (pReg->data && (nbox = pReg->data->numRects)) { - register BoxPtr pboxout; + BoxPtr pboxout; for (pboxout = pbox = REGION_BOXPTR(pReg); nbox--; pbox++) { @@ -2184,8 +2184,8 @@ miTranslateRegion(pReg, x, y) Bool miRegionDataCopy( - register RegionPtr dst, - register RegionPtr src) + RegionPtr dst, + RegionPtr src) { good(dst); good(src); @@ -2226,11 +2226,11 @@ miRegionReset(pReg, pBox) _X_EXPORT Bool miPointInRegion(pReg, x, y, box) - register RegionPtr pReg; - register int x, y; + RegionPtr pReg; + int x, y; BoxPtr box; /* "return" value */ { - register BoxPtr pbox, pboxEnd; + BoxPtr pbox, pboxEnd; int numRects; good(pReg); @@ -2294,8 +2294,8 @@ miRegionExtents(pReg) #define ExchangeSpans(a, b) \ { \ - DDXPointRec tpt; \ - register int tw; \ + DDXPointRec tpt; \ + int tw; \ \ tpt = spans[a]; spans[a] = spans[b]; spans[b] = tpt; \ tw = widths[a]; widths[a] = widths[b]; widths[b] = tw; \ @@ -2307,13 +2307,13 @@ miRegionExtents(pReg) */ static void QuickSortSpans( - register DDXPointRec spans[], - register int widths[], - register int numSpans) + DDXPointRec spans[], + int widths[], + int numSpans) { - register int y; - register int i, j, m; - register DDXPointPtr r; + int y; + int i, j, m; + DDXPointPtr r; /* Always called with numSpans > 1 */ /* Sorts only by y, doesn't bother to sort by x */ @@ -2323,7 +2323,7 @@ static void QuickSortSpans( if (numSpans < 9) { /* Do insertion sort */ - register int yprev; + int yprev; yprev = spans[0].y; i = 1; @@ -2412,18 +2412,18 @@ static void QuickSortSpans( _X_EXPORT int miClipSpans( - RegionPtr prgnDst, - register DDXPointPtr ppt, - register int *pwidth, - int nspans, - register DDXPointPtr pptNew, - int *pwidthNew, - int fSorted) + RegionPtr prgnDst, + DDXPointPtr ppt, + int *pwidth, + int nspans, + DDXPointPtr pptNew, + int *pwidthNew, + int fSorted) { - register DDXPointPtr pptLast; - int *pwidthNewStart; /* the vengeance of Xerox! */ - register int y, x1, x2; - register int numRects; + DDXPointPtr pptLast; + int *pwidthNewStart; /* the vengeance of Xerox! */ + int y, x1, x2; + int numRects; good(prgnDst); pptLast = ppt + nspans; @@ -2435,7 +2435,7 @@ miClipSpans( /* It doesn't pay much to make use of fSorted in this case, so we lump everything together. */ - register int clipx1, clipx2, clipy1, clipy2; + int clipx1, clipx2, clipy1, clipy2; clipx1 = prgnDst->extents.x1; clipy1 = prgnDst->extents.y1; @@ -2467,10 +2467,10 @@ miClipSpans( else if ((numRects = prgnDst->data->numRects)) { /* Have to clip against many boxes */ - BoxPtr pboxBandStart, pboxBandEnd; - register BoxPtr pbox; - register BoxPtr pboxLast; - register int clipy1, clipy2; + BoxPtr pboxBandStart, pboxBandEnd; + BoxPtr pbox; + BoxPtr pboxLast; + int clipy1, clipy2; /* In this case, taking advantage of sorted spans gains more than the sorting costs. */ @@ -2493,7 +2493,7 @@ miClipSpans( x2 = x1 + *pwidth; do { /* For each box in band */ - register int newx1, newx2; + int newx1, newx2; newx1 = x1; newx2 = x2; @@ -2531,10 +2531,10 @@ _X_EXPORT int miFindMaxBand(prgn) RegionPtr prgn; { - register int nbox; - register BoxPtr pbox; - register int nThisBand; - register int nMaxBand = 0; + int nbox; + BoxPtr pbox; + int nThisBand; + int nMaxBand = 0; short yThisBand; good(prgn); diff --git a/mi/miscrinit.c b/mi/miscrinit.c index ac1b82336..7922cb66e 100644 --- a/mi/miscrinit.c +++ b/mi/miscrinit.c @@ -185,7 +185,7 @@ miCreateScreenResources(pScreen) Bool miScreenDevPrivateInit(pScreen, width, pbits) - register ScreenPtr pScreen; + ScreenPtr pScreen; int width; pointer pbits; { @@ -207,7 +207,7 @@ miScreenDevPrivateInit(pScreen, width, pbits) _X_EXPORT Bool miScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width, rootDepth, numDepths, depths, rootVisual, numVisuals, visuals) - register ScreenPtr pScreen; + ScreenPtr pScreen; pointer pbits; /* pointer to screen bits */ int xsize, ysize; /* in pixels */ int dpix, dpiy; /* dots per inch */ diff --git a/mi/mispans.c b/mi/mispans.c index 4c8b6d698..61d72e46c 100644 --- a/mi/mispans.c +++ b/mi/mispans.c @@ -188,8 +188,8 @@ void miAppendSpans(spanGroup, otherGroup, spans) SpanGroup *otherGroup; Spans *spans; { - register int ymin, ymax; - register int spansCount; + int ymin, ymax; + int spansCount; spansCount = spans->count; if (spansCount > 0) { @@ -226,21 +226,21 @@ void miFreeSpanGroup(spanGroup) } static void QuickSortSpansX( - register DDXPointRec points[], - register int widths[], - register int numSpans ) + DDXPointRec points[], + int widths[], + int numSpans ) { - register int x; - register int i, j, m; - register DDXPointPtr r; + int x; + int i, j, m; + DDXPointPtr r; /* Always called with numSpans > 1 */ /* Sorts only by x, as all y should be the same */ #define ExchangeSpans(a, b) \ { \ - DDXPointRec tpt; \ - register int tw; \ + DDXPointRec tpt; \ + int tw; \ \ tpt = points[a]; points[a] = points[b]; points[b] = tpt; \ tw = widths[a]; widths[a] = widths[b]; widths[b] = tw; \ @@ -249,7 +249,7 @@ static void QuickSortSpansX( do { if (numSpans < 9) { /* Do insertion sort */ - register int xprev; + int xprev; xprev = points[0].x; i = 1; @@ -313,14 +313,14 @@ static void QuickSortSpansX( static int UniquifySpansX( - Spans *spans, - register DDXPointRec *newPoints, - register int *newWidths ) + Spans *spans, + DDXPointRec *newPoints, + int *newWidths ) { - register int newx1, newx2, oldpt, i, y; - register DDXPointRec *oldPoints; - register int *oldWidths; - int *startNewWidths; + int newx1, newx2, oldpt, i, y; + DDXPointRec *oldPoints; + int *oldWidths; + int *startNewWidths; /* Always called with numSpans > 1 */ /* Uniquify the spans, and stash them into newPoints and newWidths. Return the @@ -384,16 +384,16 @@ void miFillUniqueSpanGroup(pDraw, pGC, spanGroup) GCPtr pGC; SpanGroup *spanGroup; { - register int i; - register Spans *spans; - register Spans *yspans; - register int *ysizes; - register int ymin, ylength; + int i; + Spans *spans; + Spans *yspans; + int *ysizes; + int ymin, ylength; /* Outgoing spans for one big call to FillSpans */ - register DDXPointPtr points; - register int *widths; - register int count; + DDXPointPtr points; + int *widths; + int count; if (spanGroup->count == 0) return; @@ -545,8 +545,8 @@ void miFillSpanGroup(pDraw, pGC, spanGroup) GCPtr pGC; SpanGroup *spanGroup; { - register int i; - register Spans *spans; + int i; + Spans *spans; for (i = 0, spans = spanGroup->group; i != spanGroup->count; i++, spans++) { (*pGC->ops->FillSpans) diff --git a/mi/misprite.c b/mi/misprite.c index 286c7552a..c0560a4bb 100644 --- a/mi/misprite.c +++ b/mi/misprite.c @@ -320,11 +320,11 @@ miSpriteGetSpans (pDrawable, wMax, ppt, pwidth, nspans, pdstStart) if (pDrawable->type == DRAWABLE_WINDOW && pScreenPriv->isUp) { - register DDXPointPtr pts; - register int *widths; - register int nPts; - register int xorg, - yorg; + DDXPointPtr pts; + int *widths; + int nPts; + int xorg, + yorg; xorg = pDrawable->x; yorg = pDrawable->y; diff --git a/mi/mivaltree.c b/mi/mivaltree.c index 0e5ed61e7..92ea0a8a9 100644 --- a/mi/mivaltree.c +++ b/mi/mivaltree.c @@ -112,13 +112,13 @@ miShapedWindowIn (pScreen, universe, bounding, rect, x, y) ScreenPtr pScreen; RegionPtr universe, bounding; BoxPtr rect; - register int x, y; + int x, y; { - BoxRec box; - register BoxPtr boundBox; - int nbox; - Bool someIn, someOut; - register int t, x1, y1, x2, y2; + BoxRec box; + BoxPtr boundBox; + int nbox; + Bool someIn, someOut; + int t, x1, y1, x2, y2; nbox = REGION_NUM_RECTS (bounding); boundBox = REGION_RECTS (bounding); @@ -202,16 +202,16 @@ miRegisterRedirectBorderClipProc (SetRedirectBorderClipProcPtr setBorderClip, */ static void miComputeClips ( - register WindowPtr pParent, - register ScreenPtr pScreen, - register RegionPtr universe, + WindowPtr pParent, + ScreenPtr pScreen, + RegionPtr universe, VTKind kind, RegionPtr exposed ) /* for intermediate calculations */ { int dx, dy; RegionRec childUniverse; - register WindowPtr pChild; + WindowPtr pChild; int oldVis, newVis; BoxRec borderSize; RegionRec childUnion; @@ -535,10 +535,10 @@ miComputeClips ( static void miTreeObscured( - register WindowPtr pParent ) + WindowPtr pParent ) { - register WindowPtr pChild; - register int oldVis; + WindowPtr pChild; + int oldVis; pChild = pParent; while (1) @@ -609,8 +609,8 @@ miValidateTree (pParent, pChild, kind) RegionRec childUnion; /* the space covered by borderSize for * all marked children */ RegionRec exposed; /* For intermediate calculations */ - register ScreenPtr pScreen; - register WindowPtr pWin; + ScreenPtr pScreen; + WindowPtr pWin; Bool overlap; int viewvals; Bool forward; diff --git a/mi/miwideline.c b/mi/miwideline.c index d57c2eaa7..7f99aca51 100644 --- a/mi/miwideline.c +++ b/mi/miwideline.c @@ -56,10 +56,10 @@ from The Open Group. ICEILTEMPDECL #endif -static void miLineArc(DrawablePtr pDraw, register GCPtr pGC, +static void miLineArc(DrawablePtr pDraw, GCPtr pGC, unsigned long pixel, SpanDataPtr spanData, - register LineFacePtr leftFace, - register LineFacePtr rightFace, + LineFacePtr leftFace, + LineFacePtr rightFace, double xorg, double yorg, Bool isInt); @@ -79,12 +79,12 @@ miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, overall_height, PolyEdgePtr left, right; int left_count, right_count; { - register int left_x = 0, left_e = 0; + int left_x = 0, left_e = 0; int left_stepx = 0; int left_signdx = 0; int left_dy = 0, left_dx = 0; - register int right_x = 0, right_e = 0; + int right_x = 0, right_e = 0; int right_stepx = 0; int right_signdx = 0; int right_dy = 0, right_dx = 0; @@ -92,10 +92,10 @@ miFillPolyHelper (pDrawable, pGC, pixel, spanData, y, overall_height, int height = 0; int left_height = 0, right_height = 0; - register DDXPointPtr ppt; + DDXPointPtr ppt; DDXPointPtr pptInit = NULL; - register int *pwidth; - int *pwidthInit = NULL; + int *pwidth; + int *pwidthInit = NULL; XID oldPixel; int xorg; Spans spanRec; @@ -203,8 +203,8 @@ miFillRectPolyHelper ( int w, int h) { - register DDXPointPtr ppt; - register int *pwidth; + DDXPointPtr ppt; + int *pwidth; XID oldPixel; Spans spanRec; xRectangle rect; @@ -265,10 +265,10 @@ _X_EXPORT /* static */ int miPolyBuildEdge (x0, y0, k, dx, dy, xi, yi, left, edge) double x0, y0; double k; /* x0 * dy - y0 * dx */ - register int dx, dy; + int dx, dy; int xi, yi; int left; - register PolyEdgePtr edge; + PolyEdgePtr edge; { int x, y, e; int xady; @@ -322,23 +322,23 @@ miPolyBuildEdge (x0, y0, k, dx, dy, xi, yi, left, edge) _X_EXPORT /* static */ int miPolyBuildPoly (vertices, slopes, count, xi, yi, left, right, pnleft, pnright, h) - register PolyVertexPtr vertices; - register PolySlopePtr slopes; - int count; - int xi, yi; - PolyEdgePtr left, right; - int *pnleft, *pnright; - int *h; + PolyVertexPtr vertices; + PolySlopePtr slopes; + int count; + int xi, yi; + PolyEdgePtr left, right; + int *pnleft, *pnright; + int *h; { - int top, bottom; - double miny, maxy; - register int i; - int j; - int clockwise; - int slopeoff; - register int s; - register int nright, nleft; - int y, lasty = 0, bottomy, topy = 0; + int top, bottom; + double miny, maxy; + int i; + int j; + int clockwise; + int slopeoff; + int s; + int nright, nleft; + int y, lasty = 0, bottomy, topy = 0; /* find the top of the polygon */ maxy = miny = vertices[0].y; @@ -467,12 +467,12 @@ miLineOnePoint ( static void miLineJoin ( - DrawablePtr pDrawable, - GCPtr pGC, - unsigned long pixel, - SpanDataPtr spanData, - register LineFacePtr pLeft, - register LineFacePtr pRight) + DrawablePtr pDrawable, + GCPtr pGC, + unsigned long pixel, + SpanDataPtr spanData, + LineFacePtr pLeft, + LineFacePtr pRight) { double mx = 0, my = 0; double denom = 0.0; @@ -624,9 +624,9 @@ miLineArcI ( DDXPointPtr points, int *widths) { - register DDXPointPtr tpts, bpts; - register int *twids, *bwids; - register int x, y, e, ex, slw; + DDXPointPtr tpts, bpts; + int *twids, *bwids; + int x, y, e, ex, slw; tpts = points; twids = widths; @@ -717,8 +717,8 @@ miLineArcD ( int edgey2, Bool edgeleft2) { - register DDXPointPtr pts; - register int *wids; + DDXPointPtr pts; + int *wids; double radius, x0, y0, el, er, yk, xlk, xrk, k; int xbase, ybase, y, boty, xl, xr, xcl, xcr; int ymin, ymax; @@ -875,8 +875,8 @@ miLineArcD ( int miRoundJoinFace (face, edge, leftEdge) - register LineFacePtr face; - register PolyEdgePtr edge; + LineFacePtr face; + PolyEdgePtr edge; Bool *leftEdge; { int y; @@ -924,7 +924,7 @@ miRoundJoinFace (face, edge, leftEdge) _X_EXPORT void miRoundJoinClip (pLeft, pRight, edge1, edge2, y1, y2, left1, left2) - register LineFacePtr pLeft, pRight; + LineFacePtr pLeft, pRight; PolyEdgePtr edge1, edge2; int *y1, *y2; Bool *left1, *left2; @@ -949,14 +949,14 @@ miRoundJoinClip (pLeft, pRight, edge1, edge2, y1, y2, left1, left2) _X_EXPORT int miRoundCapClip (face, isInt, edge, leftEdge) - register LineFacePtr face; + LineFacePtr face; Bool isInt; - register PolyEdgePtr edge; + PolyEdgePtr edge; Bool *leftEdge; { - int y; - register int dx, dy; - double xa, ya, k; + int y; + int dx, dy; + double xa, ya, k; Bool left; dx = -face->dy; @@ -999,15 +999,15 @@ miRoundCapClip (face, isInt, edge, leftEdge) static void miLineArc ( - DrawablePtr pDraw, - register GCPtr pGC, - unsigned long pixel, - SpanDataPtr spanData, - register LineFacePtr leftFace, - register LineFacePtr rightFace, - double xorg, - double yorg, - Bool isInt) + DrawablePtr pDraw, + GCPtr pGC, + unsigned long pixel, + SpanDataPtr spanData, + LineFacePtr leftFace, + LineFacePtr rightFace, + double xorg, + double yorg, + Bool isInt) { DDXPointPtr points; int *widths; @@ -1116,14 +1116,14 @@ miLineArc ( void miLineProjectingCap (pDrawable, pGC, pixel, spanData, face, isLeft, xorg, yorg, isInt) - DrawablePtr pDrawable; - register GCPtr pGC; - unsigned long pixel; - SpanDataPtr spanData; - register LineFacePtr face; - Bool isLeft; - double xorg, yorg; - Bool isInt; + DrawablePtr pDrawable; + GCPtr pGC; + unsigned long pixel; + SpanDataPtr spanData; + LineFacePtr face; + Bool isLeft; + double xorg, yorg; + Bool isInt; { int xorgi = 0, yorgi = 0; int lw; @@ -1286,18 +1286,18 @@ miLineProjectingCap (pDrawable, pGC, pixel, spanData, face, isLeft, xorg, yorg, static void miWideSegment ( - DrawablePtr pDrawable, - GCPtr pGC, - unsigned long pixel, - SpanDataPtr spanData, - register int x1, - register int y1, - register int x2, - register int y2, - Bool projectLeft, - Bool projectRight, - register LineFacePtr leftFace, - register LineFacePtr rightFace) + DrawablePtr pDrawable, + GCPtr pGC, + unsigned long pixel, + SpanDataPtr spanData, + int x1, + int y1, + int x2, + int y2, + Bool projectLeft, + Bool projectRight, + LineFacePtr leftFace, + LineFacePtr rightFace) { double l, L, r; double xa, ya; @@ -1508,7 +1508,7 @@ miWideSegment ( SpanDataPtr miSetupSpanData (pGC, spanData, npt) - register GCPtr pGC; + GCPtr pGC; SpanDataPtr spanData; int npt; { @@ -1552,21 +1552,21 @@ miCleanupSpanData (pDrawable, pGC, spanData) _X_EXPORT void miWideLine (pDrawable, pGC, mode, npt, pPts) DrawablePtr pDrawable; - register GCPtr pGC; + GCPtr pGC; int mode; - register int npt; - register DDXPointPtr pPts; + int npt; + DDXPointPtr pPts; { - int x1, y1, x2, y2; - SpanDataRec spanDataRec; - SpanDataPtr spanData; - unsigned long pixel; - Bool projectLeft, projectRight; - LineFaceRec leftFace, rightFace, prevRightFace; - LineFaceRec firstFace; - register int first; - Bool somethingDrawn = FALSE; - Bool selfJoin; + int x1, y1, x2, y2; + SpanDataRec spanDataRec; + SpanDataPtr spanData; + long pixel; + Bool projectLeft, projectRight; + LineFaceRec leftFace, rightFace, prevRightFace; + LineFaceRec firstFace; + int first; + Bool somethingDrawn = FALSE; + Bool selfJoin; spanData = miSetupSpanData (pGC, &spanDataRec, npt); pixel = pGC->fgPixel; @@ -1693,7 +1693,7 @@ miWideLine (pDrawable, pGC, mode, npt, pPts) static void miWideDashSegment ( DrawablePtr pDrawable, - register GCPtr pGC, + GCPtr pGC, SpanDataPtr spanData, int *pDashOffset, int *pDashIndex, @@ -2050,25 +2050,25 @@ miWideDashSegment ( _X_EXPORT void miWideDash (pDrawable, pGC, mode, npt, pPts) DrawablePtr pDrawable; - register GCPtr pGC; + GCPtr pGC; int mode; - register int npt; - register DDXPointPtr pPts; + int npt; + DDXPointPtr pPts; { - int x1, y1, x2, y2; - unsigned long pixel; - Bool projectLeft, projectRight; - LineFaceRec leftFace, rightFace, prevRightFace; - LineFaceRec firstFace; - int first; - int dashIndex, dashOffset; - register int prevDashIndex; - SpanDataRec spanDataRec; - SpanDataPtr spanData; - Bool somethingDrawn = FALSE; - Bool selfJoin; - Bool endIsFg = FALSE, startIsFg = FALSE; - Bool firstIsFg = FALSE, prevIsFg = FALSE; + int x1, y1, x2, y2; + unsigned long pixel; + Bool projectLeft, projectRight; + LineFaceRec leftFace, rightFace, prevRightFace; + LineFaceRec firstFace; + int first; + int dashIndex, dashOffset; + int prevDashIndex; + SpanDataRec spanDataRec; + SpanDataPtr spanData; + Bool somethingDrawn = FALSE; + Bool selfJoin; + Bool endIsFg = FALSE, startIsFg = FALSE; + Bool firstIsFg = FALSE, prevIsFg = FALSE; #if 0 /* XXX backward compatibility */ diff --git a/mi/miwindow.c b/mi/miwindow.c index cd6bb8df3..6ca2e1e38 100644 --- a/mi/miwindow.c +++ b/mi/miwindow.c @@ -160,12 +160,12 @@ miClearToBackground(pWin, x, y, w, h, generateExposures) */ static Bool miCheckSubSaveUnder( - register WindowPtr pParent, /* Parent to check */ + WindowPtr pParent, /* Parent to check */ WindowPtr pFirst, /* first reconfigured window */ RegionPtr pRegion) /* Initial area obscured by saveUnder */ { - register WindowPtr pChild; /* Current child */ - register ScreenPtr pScreen; /* Screen to use */ + WindowPtr pChild; /* Current child */ + ScreenPtr pScreen; /* Screen to use */ RegionRec SubRegion; /* Area of children obscured */ Bool res = FALSE; /* result */ Bool subInited=FALSE;/* SubRegion initialized */ @@ -268,12 +268,12 @@ miCheckSubSaveUnder( */ Bool miChangeSaveUnder(pWin, first) - register WindowPtr pWin; + WindowPtr pWin; WindowPtr first; /* First window to check. * Used when pWin was restacked */ { RegionRec rgn; /* Area obscured by saveUnder windows */ - register ScreenPtr pScreen; + ScreenPtr pScreen; Bool res; if (!deltaSaveUndersViewable && !numSaveUndersViewable) @@ -309,7 +309,7 @@ miPostChangeSaveUnder(pWin, pFirst) WindowPtr pWin; WindowPtr pFirst; { - register WindowPtr pParent, pChild; + WindowPtr pParent, pChild; ChangeWindowAttributesProcPtr ChangeWindowAttributes; if (!(pParent = pWin->parent)) @@ -342,9 +342,9 @@ miPostChangeSaveUnder(pWin, pFirst) void miMarkWindow(pWin) - register WindowPtr pWin; + WindowPtr pWin; { - register ValidatePtr val; + ValidatePtr val; if (pWin->valdata) return; @@ -362,8 +362,8 @@ miMarkOverlappedWindows(pWin, pFirst, ppLayerWin) WindowPtr pFirst; WindowPtr *ppLayerWin; { - register BoxPtr box; - register WindowPtr pChild, pLast; + BoxPtr box; + WindowPtr pChild, pLast; Bool anyMarked = FALSE; MarkWindowProcPtr MarkWindow = pWin->drawable.pScreen->MarkWindow; ScreenPtr pScreen; @@ -449,8 +449,8 @@ _X_EXPORT void miHandleValidateExposures(pWin) WindowPtr pWin; { - register WindowPtr pChild; - register ValidatePtr val; + WindowPtr pChild; + ValidatePtr val; ScreenPtr pScreen; WindowExposuresProcPtr WindowExposures; @@ -487,7 +487,7 @@ miHandleValidateExposures(pWin) void miMoveWindow(pWin, x, y, pNextSib, kind) - register WindowPtr pWin; + WindowPtr pWin; int x,y; WindowPtr pNextSib; VTKind kind; @@ -498,7 +498,7 @@ miMoveWindow(pWin, x, y, pNextSib, kind) RegionPtr oldRegion = NULL; DDXPointRec oldpt; Bool anyMarked = FALSE; - register ScreenPtr pScreen; + ScreenPtr pScreen; WindowPtr windowToValidate; #ifdef DO_SAVE_UNDERS Bool dosave = FALSE; @@ -576,10 +576,10 @@ miMoveWindow(pWin, x, y, pNextSib, kind) static int miRecomputeExposures ( - register WindowPtr pWin, + WindowPtr pWin, pointer value) /* must conform to VisitWindowProcPtr */ { - register ScreenPtr pScreen; + ScreenPtr pScreen; RegionPtr pValid = (RegionPtr)value; if (pWin->valdata) @@ -604,7 +604,7 @@ miRecomputeExposures ( void miSlideAndSizeWindow(pWin, x, y, w, h, pSib) - register WindowPtr pWin; + WindowPtr pWin; int x,y; unsigned int w, h; WindowPtr pSib; @@ -620,11 +620,11 @@ miSlideAndSizeWindow(pWin, x, y, w, h, pSib) DDXPointRec oldpt; RegionPtr oldRegion = NULL; Bool anyMarked = FALSE; - register ScreenPtr pScreen; + ScreenPtr pScreen; WindowPtr pFirstChange; - register WindowPtr pChild; + WindowPtr pChild; RegionPtr gravitate[StaticGravity + 1]; - register unsigned g; + unsigned g; int nx, ny; /* destination x,y */ int newx, newy; /* new inner window position */ RegionPtr pRegion = NULL; @@ -981,10 +981,10 @@ miGetLayerWindow(pWin) _X_EXPORT void miSetShape(pWin) - register WindowPtr pWin; + WindowPtr pWin; { Bool WasViewable = (Bool)(pWin->viewable); - register ScreenPtr pScreen = pWin->drawable.pScreen; + ScreenPtr pScreen = pWin->drawable.pScreen; Bool anyMarked = FALSE; RegionPtr pOldClip = NULL, bsExposed; #ifdef DO_SAVE_UNDERS @@ -1081,12 +1081,12 @@ miSetShape(pWin) _X_EXPORT void miChangeBorderWidth(pWin, width) - register WindowPtr pWin; + WindowPtr pWin; unsigned int width; { int oldwidth; Bool anyMarked = FALSE; - register ScreenPtr pScreen; + ScreenPtr pScreen; Bool WasViewable = (Bool)(pWin->viewable); Bool HadBorder; #ifdef DO_SAVE_UNDERS diff --git a/mi/mizerarc.c b/mi/mizerarc.c index 33e1acc19..f1adc9e2b 100644 --- a/mi/mizerarc.c +++ b/mi/mizerarc.c @@ -97,8 +97,8 @@ static miZeroArcPtRec oob = {65536, 65536, 0}; _X_EXPORT Bool miZeroArcSetup(arc, info, ok360) - register xArc *arc; - register miZeroArcRec *info; + xArc *arc; + miZeroArcRec *info; Bool ok360; { int l; @@ -404,11 +404,11 @@ miZeroArcSetup(arc, info, ok360) DDXPointPtr miZeroArcPts(arc, pts) xArc *arc; - register DDXPointPtr pts; + DDXPointPtr pts; { miZeroArcRec info; - register int x, y, a, b, d, mask; - register int k1, k3, dx, dy; + int x, y, a, b, d, mask; + int k1, k3, dx, dy; Bool do360; do360 = miZeroArcSetup(arc, &info, TRUE); @@ -509,14 +509,14 @@ miZeroArcDashPts( GCPtr pGC, xArc *arc, DashInfo *dinfo, - register DDXPointPtr points, + DDXPointPtr points, int maxPts, - register DDXPointPtr *evenPts, - register DDXPointPtr *oddPts ) + DDXPointPtr *evenPts, + DDXPointPtr *oddPts ) { miZeroArcRec info; - register int x, y, a, b, d, mask; - register int k1, k3, dx, dy; + int x, y, a, b, d, mask; + int k1, k3, dx, dy; int dashRemaining; DDXPointPtr arcPts[4]; DDXPointPtr startPts[5], endPts[5]; @@ -715,11 +715,11 @@ miZeroPolyArc(pDraw, pGC, narcs, parcs) xArc *parcs; { int maxPts = 0; - register int n, maxw = 0; - register xArc *arc; - register int i; + int n, maxw = 0; + xArc *arc; + int i; DDXPointPtr points, pts, oddPts; - register DDXPointPtr pt; + DDXPointPtr pt; int numPts; Bool dospans; int *widths = NULL; From c366b82bd50066019cf82b3464445d5bc27d6f9f Mon Sep 17 00:00:00 2001 From: Jay Estabrook Date: Fri, 9 Mar 2007 12:26:55 +0000 Subject: [PATCH 32/39] Ensure domain is stripped from the bus ID. --- hw/xfree86/dri/dri.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index c183e2a1f..7bd07c003 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -71,6 +71,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "mipointer.h" #include "xf86_OSproc.h" +#define PCI_BUS_NO_DOMAIN(bus) ((bus) & 0xffu) + #if !defined(PANORAMIX) extern Bool noPanoramiXExtension; #endif @@ -2202,8 +2204,8 @@ DRICreatePCIBusID(pciVideoPtr PciInfo) tag = pciTag(PciInfo->bus, PciInfo->device, PciInfo->func); domain = xf86GetPciDomain(tag); - snprintf(busID, 20, "pci:%04x:%02x:%02x.%d", domain, PciInfo->bus, - PciInfo->device, PciInfo->func); + snprintf(busID, 20, "pci:%04x:%02x:%02x.%d", domain, + PCI_BUS_NO_DOMAIN(PciInfo->bus), PciInfo->device, PciInfo->func); return busID; } From 4bf1b280f7cb676ec2b172f26dd2ad9bac2eb2ca Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Fri, 9 Mar 2007 14:18:14 +0000 Subject: [PATCH 33/39] Set pScreen on context --- GL/glx/glxdri.c | 1 + 1 file changed, 1 insertion(+) diff --git a/GL/glx/glxdri.c b/GL/glx/glxdri.c index e03570468..5e683a8ab 100644 --- a/GL/glx/glxdri.c +++ b/GL/glx/glxdri.c @@ -495,6 +495,7 @@ __glXDRIscreenCreateContext(__GLXscreen *baseScreen, context->base.loseCurrent = __glXDRIcontextLoseCurrent; context->base.copy = __glXDRIcontextCopy; context->base.forceCurrent = __glXDRIcontextForceCurrent; + context->base.pScreen = screen->base.pScreen; context->base.textureFromPixmap = &__glXDRItextureFromPixmap; From ae75019ccf1edac9e8be31b6a96293624f672ccb Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 14 Mar 2007 23:59:29 -0700 Subject: [PATCH 34/39] Create driver-independent CRTC-based cursor layer. This moves most of the cursor management code out of the intel driver and into the general server code. Of course, the hope is that this code will be useful for other driver writers as well. Check out xf86Crtc.h for the usage information, making sure you add the needed hooks to the crtc funcs structure for your driver. (cherry picked from commit 4d81c99a4660a0bf9014f789de55edabd185bd14) --- hw/xfree86/Makefile.am | 1 + hw/xfree86/loader/Makefile.am | 3 +- hw/xfree86/loader/loadmod.c | 3 +- hw/xfree86/loader/xf86sym.c | 5 + hw/xfree86/modes/Makefile.am | 4 +- hw/xfree86/modes/xf86Crtc.h | 103 +++++- hw/xfree86/modes/xf86Cursors.c | 595 +++++++++++++++++++++++++++++++++ hw/xfree86/ramdac/Makefile.am | 6 +- hw/xfree86/ramdac/xf86Cursor.h | 3 + 9 files changed, 710 insertions(+), 13 deletions(-) create mode 100644 hw/xfree86/modes/xf86Cursors.c diff --git a/hw/xfree86/Makefile.am b/hw/xfree86/Makefile.am index b66906380..50aa67341 100644 --- a/hw/xfree86/Makefile.am +++ b/hw/xfree86/Makefile.am @@ -56,6 +56,7 @@ XORG_LIBS = \ parser/libxf86config.a \ dixmods/libdixmods.la \ modes/libxf86modes.a \ + ramdac/libramdac.a \ ddc/libddc.a \ i2c/libi2c.a \ @XORG_LIBS@ diff --git a/hw/xfree86/loader/Makefile.am b/hw/xfree86/loader/Makefile.am index ceb66a231..ef9ab9ab3 100644 --- a/hw/xfree86/loader/Makefile.am +++ b/hw/xfree86/loader/Makefile.am @@ -2,7 +2,8 @@ noinst_LIBRARIES = libloader.a INCLUDES = $(XORG_INCS) -I$(srcdir)/../parser -I$(srcdir)/../dixmods/extmod \ -I$(srcdir)/../vbe -I$(top_srcdir)/miext/cw -I$(srcdir)/../int10 \ - -I$(srcdir)/../ddc -I$(srcdir)/../i2c -I$(srcdir)/../modes + -I$(srcdir)/../ddc -I$(srcdir)/../i2c -I$(srcdir)/../modes \ + -I$(srcdir)/../ramdac #AM_LDFLAGS = -r AM_CFLAGS = -DIN_LOADER $(DIX_CFLAGS) $(XORG_CFLAGS) diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c index e4892123b..c220d8a61 100644 --- a/hw/xfree86/loader/loadmod.c +++ b/hw/xfree86/loader/loadmod.c @@ -841,6 +841,7 @@ DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent) static const char *compiled_in_modules[] = { "ddc", "i2c", + "ramdac", NULL }; @@ -861,7 +862,7 @@ doLoadModule(const char *module, const char *path, const char **subdirlist, PatternPtr patterns = NULL; int noncanonical = 0; char *m = NULL; - char **cim; + const char **cim; xf86MsgVerb(X_INFO, 3, "LoadModule: \"%s\"", module); diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c index 6337265a8..bc7c8148b 100644 --- a/hw/xfree86/loader/xf86sym.c +++ b/hw/xfree86/loader/xf86sym.c @@ -1220,6 +1220,11 @@ _X_HIDDEN void *xfree86LookupTab[] = { SYMFUNC(xf86RandR12SetConfig) SYMFUNC(xf86RandR12SetRotations) #endif + SYMFUNC(xf86_cursors_init) + SYMFUNC(xf86_reload_cursors) + SYMFUNC(xf86_show_cursors) + SYMFUNC(xf86_hide_cursors) + SYMFUNC(xf86_cursors_fini) SYMFUNC(xf86DoEDID_DDC1) SYMFUNC(xf86DoEDID_DDC2) diff --git a/hw/xfree86/modes/Makefile.am b/hw/xfree86/modes/Makefile.am index e0b613666..1f82068b3 100644 --- a/hw/xfree86/modes/Makefile.am +++ b/hw/xfree86/modes/Makefile.am @@ -3,6 +3,7 @@ noinst_LIBRARIES = libxf86modes.a libxf86modes_a_SOURCES = \ xf86Crtc.c \ xf86Crtc.h \ + xf86Cursors.c \ xf86cvt.c \ xf86DiDGA.c \ xf86EdidModes.c \ @@ -16,7 +17,8 @@ libxf86modes_a_SOURCES = \ INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \ -I$(srcdir)/../loader -I$(srcdir)/../rac -I$(srcdir)/../parser \ -I$(srcdir)/../scanpci -I$(srcdir)/../vbe -I$(srcdir)/../int10 \ - -I$(srcdir)/../vgahw -I$(srcdir)/../dixmods/extmod + -I$(srcdir)/../vgahw -I$(srcdir)/../ramdac \ + -I$(srcdir)/../dixmods/extmod sdk_HEADERS = \ xf86Crtc.h \ diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index 6152ae4c9..df8a8aad9 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -28,6 +28,7 @@ #include "xf86Rename.h" #endif #include "xf86Modes.h" +#include "xf86Cursor.h" #include "damage.h" /* Compat definitions for older X Servers. */ @@ -37,6 +38,9 @@ #ifndef M_T_DRIVER #define M_T_DRIVER 0x40 #endif +#ifndef HARDWARE_CURSOR_ARGB +#define HARDWARE_CURSOR_ARGB 0x00004000 +#endif typedef struct _xf86Crtc xf86CrtcRec, *xf86CrtcPtr; typedef struct _xf86Output xf86OutputRec, *xf86OutputPtr; @@ -154,6 +158,42 @@ typedef struct _xf86CrtcFuncs { void (*shadow_destroy) (xf86CrtcPtr crtc, PixmapPtr pPixmap, void *data); + /** + * Set cursor colors + */ + void + (*set_cursor_colors) (xf86CrtcPtr crtc, int bg, int fg); + + /** + * Set cursor position + */ + void + (*set_cursor_position) (xf86CrtcPtr crtc, int x, int y); + + /** + * Show cursor + */ + void + (*show_cursor) (xf86CrtcPtr crtc); + + /** + * Hide cursor + */ + void + (*hide_cursor) (xf86CrtcPtr crtc); + + /** + * Load monochrome image + */ + void + (*load_cursor_image) (xf86CrtcPtr crtc, CARD8 *image); + + /** + * Load ARGB image + */ + void + (*load_cursor_argb) (xf86CrtcPtr crtc, CARD32 *image); + /** * Clean up driver-specific bits of the crtc */ @@ -174,12 +214,6 @@ struct _xf86Crtc { */ Bool enabled; - /** Track whether cursor is within CRTC range */ - Bool cursorInRange; - - /** Track state of cursor associated with this CRTC */ - Bool cursorShown; - /** * Active mode * @@ -232,6 +266,19 @@ struct _xf86Crtc { #else void *randr_crtc; #endif + + /** + * Current cursor is ARGB + */ + Bool cursor_argb; + /** + * Track whether cursor is within CRTC range + */ + Bool cursor_in_range; + /** + * Track state of cursor associated with this CRTC + */ + Bool cursor_shown; }; typedef struct _xf86OutputFuncs { @@ -495,6 +542,13 @@ typedef struct _xf86CrtcConfig { const xf86CrtcConfigFuncsRec *funcs; CreateScreenResourcesProcPtr CreateScreenResources; + + /* Cursor information */ + xf86CursorInfoPtr cursor_info; + CursorPtr cursor; + CARD8 *cursor_image; + Bool cursor_on; + CARD32 cursor_fg, cursor_bg; } xf86CrtcConfigRec, *xf86CrtcConfigPtr; extern int xf86CrtcConfigPrivateIndex; @@ -637,4 +691,41 @@ xf86ConnectorGetName(xf86ConnectorType connector); Bool xf86SetDesiredModes (ScrnInfoPtr pScrn); +/** + * Initialize the CRTC-based cursor code. CRTC function vectors must + * contain relevant cursor setting functions. + * + * Driver should call this from ScreenInit function + */ +Bool +xf86_cursors_init (ScreenPtr screen, int max_width, int max_height, int flags); + +/** + * Called when anything on the screen is reconfigured. + * + * Reloads cursor images as needed, then adjusts cursor positions. + * + * Driver should call this from crtc commit function. + */ +void +xf86_reload_cursors (ScreenPtr screen); + +/** + * Called from EnterVT to turn the cursors back on + */ +void +xf86_show_cursors (ScrnInfoPtr scrn); + +/** + * Called by the driver to turn cursors off + */ +void +xf86_hide_cursors (ScrnInfoPtr scrn); + +/** + * Clean up CRTC-based cursor code. Driver must call this at CloseScreen time. + */ +void +xf86_cursors_fini (ScreenPtr screen); + #endif /* _XF86CRTC_H_ */ diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c new file mode 100644 index 000000000..095df4845 --- /dev/null +++ b/hw/xfree86/modes/xf86Cursors.c @@ -0,0 +1,595 @@ +/* + * Copyright © 2007 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifdef HAVE_XORG_CONFIG_H +#include +#else +#ifdef HAVE_CONFIG_H +#include +#endif +#endif + +#include +#include +#include + +#include "xf86.h" +#include "xf86DDC.h" +#include "xf86Crtc.h" +#include "xf86Modes.h" +#include "xf86RandR12.h" +#include "X11/extensions/render.h" +#define DPMS_SERVER +#include "X11/extensions/dpms.h" +#include "X11/Xatom.h" +#ifdef RENDER +#include "picturestr.h" +#endif +#include "cursorstr.h" + +/* + * Given a screen coordinate, rotate back to a cursor source coordinate + */ +static void +xf86_crtc_rotate_coord (Rotation rotation, + int width, + int height, + int x_dst, + int y_dst, + int *x_src, + int *y_src) +{ + if (rotation & RR_Reflect_X) + x_dst = width - x_dst - 1; + if (rotation & RR_Reflect_Y) + y_dst = height - y_dst - 1; + + switch (rotation & 0xf) { + case RR_Rotate_0: + *x_src = x_dst; + *y_src = y_dst; + break; + case RR_Rotate_90: + *x_src = height - y_dst - 1; + *y_src = x_dst; + break; + case RR_Rotate_180: + *x_src = width - x_dst - 1; + *y_src = height - y_dst - 1; + break; + case RR_Rotate_270: + *x_src = y_dst; + *y_src = width - x_dst - 1; + break; + } +} + +/* + * Convert an x coordinate to a position within the cursor bitmap + */ +static int +cursor_bitpos (int flags, int x, Bool mask) +{ + if (flags & HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK) + mask = !mask; + if (flags & HARDWARE_CURSOR_NIBBLE_SWAPPED) + x = (x & ~3) | (3 - (x & 3)); + if (flags & HARDWARE_CURSOR_BIT_ORDER_MSBFIRST) + x = (x & ~7) | (7 - (x & 7)); + if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1) + x = (x << 1) + mask; + else if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_8) + x = ((x & ~7) << 1) | (mask << 3) | (x & 7); + else if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_16) + x = ((x & ~15) << 1) | (mask << 4) | (x & 15); + else if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_32) + x = ((x & ~31) << 1) | (mask << 5) | (x & 31); + else if (flags & HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64) + x = ((x & ~63) << 1) | (mask << 6) | (x & 63); + return x; +} + +/* + * Fetch one bit from a cursor bitmap + */ +static CARD8 +get_bit (CARD8 *image, int stride, int flags, int x, int y, Bool mask) +{ + x = cursor_bitpos (flags, x, mask); + image += y * stride; + return (image[(x >> 3)] >> (x & 7)) & 1; +} + +/* + * Set one bit in a cursor bitmap + */ +static void +set_bit (CARD8 *image, int stride, int flags, int x, int y, Bool mask) +{ + x = cursor_bitpos (flags, x, mask); + image += y * stride; + image[(x >> 3)] |= 1 << (x & 7); +} + +/* + * Load a two color cursor into a driver that supports only ARGB cursors + */ +static void +xf86_crtc_convert_cursor_to_argb (xf86CrtcPtr crtc, unsigned char *src) +{ + ScrnInfoPtr scrn = crtc->scrn; + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; + CARD32 *cursor_image = (CARD32 *) xf86_config->cursor_image; + int x, y; + int xin, yin; + int stride = cursor_info->MaxWidth >> 2; + int flags = cursor_info->Flags; + CARD32 bits; + +#ifdef ARGB_CURSOR + crtc->cursor_argb = FALSE; +#endif + + for (y = 0; y < cursor_info->MaxHeight; y++) + for (x = 0; x < cursor_info->MaxWidth; x++) + { + xf86_crtc_rotate_coord (crtc->rotation, + cursor_info->MaxWidth, + cursor_info->MaxHeight, + x, y, &xin, &yin); + if (get_bit (src, stride, flags, xin, yin, TRUE) == + ((flags & HARDWARE_CURSOR_INVERT_MASK) == 0)) + { + if (get_bit (src, stride, flags, xin, yin, FALSE)) + bits = xf86_config->cursor_fg; + else + bits = xf86_config->cursor_bg; + } + else + bits = 0; + cursor_image[y * cursor_info->MaxWidth + x] = bits; + } + crtc->funcs->load_cursor_argb (crtc, cursor_image); +} + +/* + * Set the colors for a two-color cursor (ignore for ARGB cursors) + */ +static void +xf86_set_cursor_colors (ScrnInfoPtr scrn, int bg, int fg) +{ + ScreenPtr screen = scrn->pScreen; + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + CursorPtr cursor = xf86_config->cursor; + int c; + CARD8 *bits = cursor ? cursor->devPriv[screen->myNum] : NULL; + + /* Save ARGB versions of these colors */ + xf86_config->cursor_fg = (CARD32) fg | 0xff000000; + xf86_config->cursor_bg = (CARD32) bg | 0xff000000; + + for (c = 0; c < xf86_config->num_crtc; c++) + { + xf86CrtcPtr crtc = xf86_config->crtc[c]; + + if (crtc->enabled && !crtc->cursor_argb) + { + if (crtc->funcs->load_cursor_image) + crtc->funcs->set_cursor_colors (crtc, bg, fg); + else if (bits) + xf86_crtc_convert_cursor_to_argb (crtc, bits); + } + } +} + +static void +xf86_crtc_hide_cursor (xf86CrtcPtr crtc) +{ + if (crtc->cursor_shown) + { + crtc->funcs->hide_cursor (crtc); + crtc->cursor_shown = FALSE; + } +} + +void +xf86_hide_cursors (ScrnInfoPtr scrn) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + int c; + + xf86_config->cursor_on = FALSE; + for (c = 0; c < xf86_config->num_crtc; c++) + { + xf86CrtcPtr crtc = xf86_config->crtc[c]; + + if (crtc->enabled) + xf86_crtc_hide_cursor (crtc); + } +} + +static void +xf86_crtc_show_cursor (xf86CrtcPtr crtc) +{ + if (!crtc->cursor_shown && crtc->cursor_in_range) + { + crtc->funcs->show_cursor (crtc); + crtc->cursor_shown = TRUE; + } +} + +void +xf86_show_cursors (ScrnInfoPtr scrn) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + int c; + + xf86_config->cursor_on = TRUE; + for (c = 0; c < xf86_config->num_crtc; c++) + { + xf86CrtcPtr crtc = xf86_config->crtc[c]; + + if (crtc->enabled) + xf86_crtc_show_cursor (crtc); + } +} + +static void +xf86_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y) +{ + ScrnInfoPtr scrn = crtc->scrn; + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; + DisplayModePtr mode = &crtc->mode; + int x_temp; + int y_temp; + Bool in_range; + + /* + * Move to crtc coordinate space + */ + x -= crtc->x; + y -= crtc->y; + + /* + * Rotate + */ + switch ((crtc->rotation) & 0xf) { + case RR_Rotate_0: + break; + case RR_Rotate_90: + x_temp = y; + y_temp = mode->VDisplay - cursor_info->MaxWidth - x; + x = x_temp; + y = y_temp; + break; + case RR_Rotate_180: + x_temp = mode->HDisplay - cursor_info->MaxWidth - x; + y_temp = mode->VDisplay - cursor_info->MaxHeight - y; + x = x_temp; + y = y_temp; + break; + case RR_Rotate_270: + x_temp = mode->HDisplay - cursor_info->MaxHeight - y; + y_temp = x; + x = x_temp; + y = y_temp; + break; + } + + /* + * Reflect + */ + if (crtc->rotation & RR_Reflect_X) + x = mode->HDisplay - cursor_info->MaxWidth - x; + if (crtc->rotation & RR_Reflect_Y) + y = mode->VDisplay - cursor_info->MaxHeight - y; + + /* + * Disable the cursor when it is outside the viewport + */ + in_range = TRUE; + if (x >= mode->HDisplay || y >= mode->VDisplay || + x <= -cursor_info->MaxWidth || y <= -cursor_info->MaxHeight) + { + in_range = FALSE; + x = 0; + y = 0; + } + + crtc->cursor_in_range = in_range; + + if (in_range) + { + crtc->funcs->set_cursor_position (crtc, x, y); + xf86_crtc_show_cursor (crtc); + } + else + xf86_crtc_hide_cursor (crtc); +} + +static void +xf86_set_cursor_position (ScrnInfoPtr scrn, int x, int y) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + int c; + + /* undo what xf86HWCurs did to the coordinates */ + x += scrn->frameX0; + y += scrn->frameY0; + for (c = 0; c < xf86_config->num_crtc; c++) + { + xf86CrtcPtr crtc = xf86_config->crtc[c]; + + if (crtc->enabled) + xf86_crtc_set_cursor_position (crtc, x, y); + } +} + +/* + * Load a two-color cursor into a crtc, performing rotation as needed + */ +static void +xf86_crtc_load_cursor_image (xf86CrtcPtr crtc, CARD8 *src) +{ + ScrnInfoPtr scrn = crtc->scrn; + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; + CARD8 *cursor_image; + +#ifdef ARGB_CURSOR + crtc->cursor_argb = FALSE; +#endif + + if (crtc->rotation == RR_Rotate_0) + cursor_image = src; + else + { + int x, y; + int xin, yin; + int stride = cursor_info->MaxWidth >> 2; + int flags = cursor_info->Flags; + + cursor_image = xf86_config->cursor_image; + memset(cursor_image, 0, cursor_info->MaxWidth * stride); + + for (y = 0; y < cursor_info->MaxHeight; y++) + for (x = 0; x < cursor_info->MaxWidth; x++) + { + xf86_crtc_rotate_coord (crtc->rotation, + cursor_info->MaxWidth, + cursor_info->MaxHeight, + x, y, &xin, &yin); + if (get_bit(src, stride, flags, xin, yin, FALSE)) + set_bit(cursor_image, stride, flags, x, y, FALSE); + if (get_bit(src, stride, flags, xin, yin, TRUE)) + set_bit(cursor_image, stride, flags, x, y, TRUE); + } + } + crtc->funcs->load_cursor_image (crtc, cursor_image); +} + +/* + * Load a cursor image into all active CRTCs + */ +static void +xf86_load_cursor_image (ScrnInfoPtr scrn, unsigned char *src) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + int c; + + for (c = 0; c < xf86_config->num_crtc; c++) + { + xf86CrtcPtr crtc = xf86_config->crtc[c]; + + if (crtc->enabled) + { + if (crtc->funcs->load_cursor_image) + xf86_crtc_load_cursor_image (crtc, src); + else if (crtc->funcs->load_cursor_argb) + xf86_crtc_convert_cursor_to_argb (crtc, src); + } + } +} + +static Bool +xf86_use_hw_cursor (ScreenPtr screen, CursorPtr cursor) +{ + ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; + + xf86_config->cursor = cursor; + + if (cursor->bits->width > cursor_info->MaxWidth || + cursor->bits->height> cursor_info->MaxHeight) + return FALSE; + + return TRUE; +} + +static Bool +xf86_use_hw_cursor_argb (ScreenPtr screen, CursorPtr cursor) +{ + ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; + + xf86_config->cursor = cursor; + + /* Make sure ARGB support is available */ + if ((cursor_info->Flags & HARDWARE_CURSOR_ARGB) == 0) + return FALSE; + + if (cursor->bits->width > cursor_info->MaxWidth || + cursor->bits->height> cursor_info->MaxHeight) + return FALSE; + + return TRUE; +} + +static void +xf86_crtc_load_cursor_argb (xf86CrtcPtr crtc, CursorPtr cursor) +{ + ScrnInfoPtr scrn = crtc->scrn; + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; + CARD32 *cursor_image = (CARD32 *) xf86_config->cursor_image; + CARD32 *cursor_source = (CARD32 *) cursor->bits->argb; + int x, y; + int xin, yin; + CARD32 bits; + int source_width = cursor->bits->width; + int source_height = cursor->bits->height; + int image_width = cursor_info->MaxWidth; + int image_height = cursor_info->MaxHeight; + + for (y = 0; y < image_height; y++) + for (x = 0; x < image_width; x++) + { + xf86_crtc_rotate_coord (crtc->rotation, image_width, image_height, + x, y, &xin, &yin); + if (xin < source_width && yin < source_height) + bits = cursor_source[yin * source_width + xin]; + else + bits = 0; + cursor_image[y * image_width + x] = bits; + } + + crtc->funcs->load_cursor_argb (crtc, cursor_image); +} + +static void +xf86_load_cursor_argb (ScrnInfoPtr scrn, CursorPtr cursor) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + int c; + + for (c = 0; c < xf86_config->num_crtc; c++) + { + xf86CrtcPtr crtc = xf86_config->crtc[c]; + + if (crtc->enabled) + xf86_crtc_load_cursor_argb (crtc, cursor); + } +} + +Bool +xf86_cursors_init (ScreenPtr screen, int max_width, int max_height, int flags) +{ + ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + xf86CursorInfoPtr cursor_info; + + cursor_info = xf86CreateCursorInfoRec(); + if (!cursor_info) + return FALSE; + + xf86_config->cursor_image = xalloc (max_width * max_height * 4); + + if (!xf86_config->cursor_image) + { + xf86DestroyCursorInfoRec (cursor_info); + return FALSE; + } + + xf86_config->cursor_info = cursor_info; + + cursor_info->MaxWidth = max_width; + cursor_info->MaxHeight = max_height; + cursor_info->Flags = flags; + + cursor_info->SetCursorColors = xf86_set_cursor_colors; + cursor_info->SetCursorPosition = xf86_set_cursor_position; + cursor_info->LoadCursorImage = xf86_load_cursor_image; + cursor_info->HideCursor = xf86_hide_cursors; + cursor_info->ShowCursor = xf86_show_cursors; + cursor_info->UseHWCursor = xf86_use_hw_cursor; +#ifdef ARGB_CURSOR + if (flags & HARDWARE_CURSOR_ARGB) + { + cursor_info->UseHWCursorARGB = xf86_use_hw_cursor_argb; + cursor_info->LoadCursorARGB = xf86_load_cursor_argb; + } +#endif + + xf86_config->cursor = NULL; + xf86_hide_cursors (scrn); + + return xf86InitCursor (screen, cursor_info); +} + +/** + * Called when anything on the screen is reconfigured. + * + * Reloads cursor images as needed, then adjusts cursor positions + */ + +void +xf86_reload_cursors (ScreenPtr screen) +{ + ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; + CursorPtr cursor = xf86_config->cursor; + int x, y; + + GetSpritePosition (&x, &y); + if (!(cursor_info->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN)) + (*cursor_info->HideCursor)(scrn); + + if (cursor) + { +#ifdef ARGB_CURSOR + if (cursor->bits->argb && cursor_info->LoadCursorARGB) + (*cursor_info->LoadCursorARGB) (scrn, cursor); + else +#endif + (*cursor_info->LoadCursorImage)(cursor_info->pScrn, + cursor->devPriv[screen->myNum]); + + (*cursor_info->SetCursorPosition)(cursor_info->pScrn, x, y); + (*cursor_info->ShowCursor)(cursor_info->pScrn); + } +} + +/** + * Clean up CRTC-based cursor code + */ +void +xf86_cursors_fini (ScreenPtr screen) +{ + ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + + if (xf86_config->cursor_info) + { + xf86DestroyCursorInfoRec (xf86_config->cursor_info); + xf86_config->cursor_info = NULL; + } + if (xf86_config->cursor_image) + { + xfree (xf86_config->cursor_image); + xf86_config->cursor_image = NULL; + } +} diff --git a/hw/xfree86/ramdac/Makefile.am b/hw/xfree86/ramdac/Makefile.am index 8d944455f..2b84cb4dd 100644 --- a/hw/xfree86/ramdac/Makefile.am +++ b/hw/xfree86/ramdac/Makefile.am @@ -1,8 +1,6 @@ -module_LTLIBRARIES = libramdac.la +noinst_LIBRARIES = libramdac.a -libramdac_la_LDFLAGS = -avoid-version - -libramdac_la_SOURCES = xf86RamDacMod.c xf86RamDac.c xf86RamDacCmap.c \ +libramdac_a_SOURCES = xf86RamDac.c xf86RamDacCmap.c \ xf86Cursor.c xf86HWCurs.c IBM.c BT.c TI.c \ xf86BitOrder.c diff --git a/hw/xfree86/ramdac/xf86Cursor.h b/hw/xfree86/ramdac/xf86Cursor.h index 08cca6b96..469f48f01 100644 --- a/hw/xfree86/ramdac/xf86Cursor.h +++ b/hw/xfree86/ramdac/xf86Cursor.h @@ -44,5 +44,8 @@ void xf86ForceHWCursor (ScreenPtr pScreen, Bool on); #define HARDWARE_CURSOR_NIBBLE_SWAPPED 0x00000800 #define HARDWARE_CURSOR_SHOW_TRANSPARENT 0x00001000 #define HARDWARE_CURSOR_UPDATE_UNHIDDEN 0x00002000 +#ifdef ARGB_CURSOR +#define HARDWARE_CURSOR_ARGB 0x00004000 +#endif #endif /* _XF86CURSOR_H */ From 2fe74ef339c3a4902ae8214f5a0454662895422c Mon Sep 17 00:00:00 2001 From: Matthias Hopf Date: Thu, 15 Mar 2007 16:56:01 +0100 Subject: [PATCH 35/39] Fix calculations in x86 emulator for the long long case (Andreas Schwab). --- hw/xfree86/x86emu/prim_ops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/x86emu/prim_ops.c b/hw/xfree86/x86emu/prim_ops.c index 461e09e3e..b9e7257ca 100644 --- a/hw/xfree86/x86emu/prim_ops.c +++ b/hw/xfree86/x86emu/prim_ops.c @@ -2082,7 +2082,7 @@ Implements the IMUL instruction and side effects. void imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s) { #ifdef __HAS_LONG_LONG__ - s64 res = (s32)d * (s32)s; + s64 res = (s64)(s32)d * (s32)s; *res_lo = (u32)res; *res_hi = (u32)(res >> 32); @@ -2174,7 +2174,7 @@ Implements the MUL instruction and side effects. void mul_long(u32 s) { #ifdef __HAS_LONG_LONG__ - u64 res = (u32)M.x86.R_EAX * (u32)s; + u64 res = (u64)M.x86.R_EAX * s; M.x86.R_EAX = (u32)res; M.x86.R_EDX = (u32)(res >> 32); From 3b71b0f89f1db837da91650baa0ef4bb7ef2e98f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 15 Mar 2007 13:21:00 -0700 Subject: [PATCH 36/39] Set the RandR version returned, rather than just passing the proto's version. --- randr/rrdispatch.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/randr/rrdispatch.c b/randr/rrdispatch.c index 7f98965a4..5525427f6 100644 --- a/randr/rrdispatch.c +++ b/randr/rrdispatch.c @@ -22,6 +22,9 @@ #include "randrstr.h" +#define SERVER_RANDR_MAJOR 1 +#define SERVER_RANDR_MINOR 2 + Bool RRClientKnowsRates (ClientPtr pClient) { @@ -49,8 +52,8 @@ ProcRRQueryVersion (ClientPtr client) * Report the current version; the current * spec says they're all compatible after 1.0 */ - rep.majorVersion = RANDR_MAJOR; - rep.minorVersion = RANDR_MINOR; + rep.majorVersion = SERVER_RANDR_MAJOR; + rep.minorVersion = SERVER_RANDR_MINOR; if (client->swapped) { swaps(&rep.sequenceNumber, n); swapl(&rep.length, n); From 9562b6abe1da566cf73a08c4f4c4339fb67fbc71 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 15 Mar 2007 10:50:45 -0700 Subject: [PATCH 37/39] Allow xf86_reload_cursors during server init. xf86_reload_cursors is supposed to be called from the crtc mode setting commit hook; as that happens during server initialization, check for this case. (cherry picked from commit 5b77bf2d020b1ee56c1c5f2db089a8f7f64a76a6) --- hw/xfree86/modes/xf86Cursors.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c index 095df4845..009cccf89 100644 --- a/hw/xfree86/modes/xf86Cursors.c +++ b/hw/xfree86/modes/xf86Cursors.c @@ -548,12 +548,24 @@ xf86_cursors_init (ScreenPtr screen, int max_width, int max_height, int flags) void xf86_reload_cursors (ScreenPtr screen) { - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; - CursorPtr cursor = xf86_config->cursor; + ScrnInfoPtr scrn; + xf86CrtcConfigPtr xf86_config; + xf86CursorInfoPtr cursor_info; + CursorPtr cursor; int x, y; + /* initial mode setting will not have set a screen yet */ + if (!screen) + return; + scrn = xf86Screens[screen->myNum]; + xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + + /* make sure the cursor code has been initialized */ + cursor_info = xf86_config->cursor_info; + if (!cursor_info) + return; + + cursor = xf86_config->cursor; GetSpritePosition (&x, &y); if (!(cursor_info->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN)) (*cursor_info->HideCursor)(scrn); From 3bffb281260476d2f74f0bf451d85d2f7cacd6c4 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 15 Mar 2007 16:16:16 -0700 Subject: [PATCH 38/39] Don't wedge when rotating more than one CRTC. Rotation block handler was re-registering the rotation damage structure, creating an infinite loop in the damage code. Track registration of the damage structure to avoid this. (cherry picked from commit b14f003b0ed1252766c9e3b1c086ea2809521047) --- hw/xfree86/modes/xf86Crtc.h | 3 ++- hw/xfree86/modes/xf86Rotate.c | 31 ++++++++++++++++++------------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index df8a8aad9..b7515928e 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -529,7 +529,8 @@ typedef struct _xf86CrtcConfig { int maxWidth, maxHeight; /* For crtc-based rotation */ - DamagePtr rotationDamage; + DamagePtr rotation_damage; + Bool rotation_damage_registered; /* DGA */ unsigned int dga_flags; diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index 6826b6277..e82b69e1b 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -251,9 +251,13 @@ xf86RotatePrepare (ScreenPtr pScreen) crtc->rotatedData, crtc->mode.HDisplay, crtc->mode.VDisplay); - /* Hook damage to screen pixmap */ - DamageRegister (&(*pScreen->GetScreenPixmap)(pScreen)->drawable, - xf86_config->rotationDamage); + if (!xf86_config->rotation_damage_registered) + { + /* Hook damage to screen pixmap */ + DamageRegister (&(*pScreen->GetScreenPixmap)(pScreen)->drawable, + xf86_config->rotation_damage); + xf86_config->rotation_damage_registered = TRUE; + } xf86CrtcDamageShadow (crtc); } @@ -265,7 +269,7 @@ xf86RotateRedisplay(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - DamagePtr damage = xf86_config->rotationDamage; + DamagePtr damage = xf86_config->rotation_damage; RegionPtr region; if (!damage) @@ -334,13 +338,14 @@ xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation) crtc->rotatedData = NULL; } - if (xf86_config->rotationDamage) + if (xf86_config->rotation_damage) { /* Free damage structure */ DamageUnregister (&(*pScreen->GetScreenPixmap)(pScreen)->drawable, - xf86_config->rotationDamage); - DamageDestroy (xf86_config->rotationDamage); - xf86_config->rotationDamage = NULL; + xf86_config->rotation_damage); + xf86_config->rotation_damage_registered = FALSE; + DamageDestroy (xf86_config->rotation_damage); + xf86_config->rotation_damage = NULL; /* Free block/wakeup handler */ RemoveBlockAndWakeupHandlers (xf86RotateBlockHandler, xf86RotateWakeupHandler, @@ -382,13 +387,13 @@ xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation) xf86CrtcDamageShadow (crtc); } - if (!xf86_config->rotationDamage) + if (!xf86_config->rotation_damage) { /* Create damage structure */ - xf86_config->rotationDamage = DamageCreate (NULL, NULL, + xf86_config->rotation_damage = DamageCreate (NULL, NULL, DamageReportNone, TRUE, pScreen, pScreen); - if (!xf86_config->rotationDamage) + if (!xf86_config->rotation_damage) goto bail2; /* Assign block/wakeup handler */ @@ -402,8 +407,8 @@ xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation) if (0) { bail3: - DamageDestroy (xf86_config->rotationDamage); - xf86_config->rotationDamage = NULL; + DamageDestroy (xf86_config->rotation_damage); + xf86_config->rotation_damage = NULL; bail2: if (shadow || shadowData) From b167583fe234a536aa6187e17f21da85be4f0b7f Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 15 Nov 2006 17:50:02 +1030 Subject: [PATCH 39/39] o fix minor error in comment for GetPointerEvents() --- dix/getevents.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dix/getevents.c b/dix/getevents.c index 935112d85..77d1e2106 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -470,7 +470,7 @@ GetKeyboardValuatorEvents(xEvent *events, DeviceIntPtr pDev, int type, /** - * Generate a series of xEvents (returned in xE) representing pointer + * Generate a series of xEvents (returned in events) representing pointer * motion, or button presses. Xi and XKB-aware. * * events is not NULL-terminated; the return value is the number of events.