diff options
author | marha <marha@users.sourceforge.net> | 2013-07-29 08:50:02 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-07-29 08:50:02 +0200 |
commit | 4c8cee9b5a37db30af50aafcbf54b36b9fd9e03a (patch) | |
tree | 30b754ce6f4bb714f948a1bcec554335d402e42b /libX11/src | |
parent | 8647aa1a5029fcd96f134103331ddf3c21bc0a0b (diff) | |
download | vcxsrv-4c8cee9b5a37db30af50aafcbf54b36b9fd9e03a.tar.gz vcxsrv-4c8cee9b5a37db30af50aafcbf54b36b9fd9e03a.tar.bz2 vcxsrv-4c8cee9b5a37db30af50aafcbf54b36b9fd9e03a.zip |
libX11 mesa xserver git update 29 July 2013
xserver commit ff38bbe81ace85bf675bbaa0a9ca5f3b32ede449
libX11 commit 208e586c808e88a2ee819e4450dc27f557afc2bf
mesa commit e847b5ae066bf9a209dad482fcc664f944983633
Diffstat (limited to 'libX11/src')
-rw-r--r-- | libX11/src/Host.c | 53 | ||||
-rw-r--r-- | libX11/src/ModMap.c | 12 |
2 files changed, 17 insertions, 48 deletions
diff --git a/libX11/src/Host.c b/libX11/src/Host.c index da5e2f7d3..b07c9c312 100644 --- a/libX11/src/Host.c +++ b/libX11/src/Host.c @@ -64,13 +64,11 @@ X Window System is a trademark of The Open Group. #endif #include "Xlibint.h" -int -XAddHost ( - register Display *dpy, - XHostAddress *host) +static inline int +changehost (Display *dpy, XHostAddress *host, BYTE mode) { - register xChangeHostsReq *req; - register int length; + xChangeHostsReq *req; + int length; XServerInterpretedAddress *siAddr; int addrlen; @@ -87,7 +85,7 @@ XAddHost ( UnlockDisplay(dpy); return 0; } - req->mode = HostInsert; + req->mode = mode; req->hostFamily = host->family; req->hostLength = addrlen; if (siAddr) { @@ -104,42 +102,19 @@ XAddHost ( } int -XRemoveHost ( +XAddHost ( register Display *dpy, XHostAddress *host) { - register xChangeHostsReq *req; - register int length; - XServerInterpretedAddress *siAddr; - int addrlen; - - siAddr = host->family == FamilyServerInterpreted ? - (XServerInterpretedAddress *)host->address : NULL; - addrlen = siAddr ? - siAddr->typelength + siAddr->valuelength + 1 : host->length; - - length = (addrlen + 3) & ~0x3; /* round up */ + return changehost(dpy, host, HostInsert); +} - LockDisplay(dpy); - GetReqExtra (ChangeHosts, length, req); - if (!req) { - UnlockDisplay(dpy); - return 0; - } - req->mode = HostDelete; - req->hostFamily = host->family; - req->hostLength = addrlen; - if (siAddr) { - char *dest = (char *) NEXTPTR(req,xChangeHostsReq); - memcpy(dest, siAddr->type, siAddr->typelength); - dest[siAddr->typelength] = '\0'; - memcpy(dest + siAddr->typelength + 1,siAddr->value,siAddr->valuelength); - } else { - memcpy((char *) NEXTPTR(req,xChangeHostsReq), host->address, addrlen); - } - UnlockDisplay(dpy); - SyncHandle(); - return 1; +int +XRemoveHost ( + register Display *dpy, + XHostAddress *host) +{ + return changehost(dpy, host, HostDelete); } int diff --git a/libX11/src/ModMap.c b/libX11/src/ModMap.c index 836a67621..2fabc560c 100644 --- a/libX11/src/ModMap.c +++ b/libX11/src/ModMap.c @@ -79,17 +79,11 @@ XSetModifierMapping( int mapSize = modifier_map->max_keypermod << 3; /* 8 modifiers */ LockDisplay(dpy); - GetReqExtra(SetModifierMapping, mapSize, req); - if (!req) { - UnlockDisplay(dpy); - return MappingFailed; - } - + GetReq(SetModifierMapping, req); + req->length += mapSize >> 2; req->numKeyPerModifier = modifier_map->max_keypermod; - memcpy((char *) NEXTPTR(req,xSetModifierMappingReq), - (char *) modifier_map->modifiermap, - mapSize); + Data(dpy, modifier_map->modifiermap, mapSize); (void) _XReply(dpy, (xReply *) & rep, (SIZEOF(xSetModifierMappingReply) - SIZEOF(xReply)) >> 2, xTrue); |