diff options
author | marha <marha@users.sourceforge.net> | 2013-07-29 08:51:48 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-07-29 08:51:48 +0200 |
commit | 04f3d1515878e535b7e3876264eaa4d43a1e6d54 (patch) | |
tree | 58867d9fa0097be91f1717a693a7ca4b3eb77d71 /libX11/src/Host.c | |
parent | ff986553659472cf191804eadb13c21e8f2b44c0 (diff) | |
parent | 4c8cee9b5a37db30af50aafcbf54b36b9fd9e03a (diff) | |
download | vcxsrv-04f3d1515878e535b7e3876264eaa4d43a1e6d54.tar.gz vcxsrv-04f3d1515878e535b7e3876264eaa4d43a1e6d54.tar.bz2 vcxsrv-04f3d1515878e535b7e3876264eaa4d43a1e6d54.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
libX11 mesa xserver git update 29 July 2013
Diffstat (limited to 'libX11/src/Host.c')
-rw-r--r-- | libX11/src/Host.c | 53 |
1 files changed, 14 insertions, 39 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 |