aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/os/access.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-09-09 05:23:48 +0000
committermarha <marha@users.sourceforge.net>2009-09-09 05:23:48 +0000
commit81f91c615982e50bb62708201569c33a3cd3d973 (patch)
tree4f32ecc48a3b7b5e76642f3792338263c53879bd /xorg-server/os/access.c
parentb571a562410f565af2bdde52d9f7f9a23ffae04f (diff)
parenta915739887477b28d924ecc8417ee107d125bd6c (diff)
downloadvcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.gz
vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.tar.bz2
vcxsrv-81f91c615982e50bb62708201569c33a3cd3d973.zip
svn merge https://vcxsrv.svn.sourceforge.net/svnroot/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/os/access.c')
-rw-r--r--xorg-server/os/access.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/xorg-server/os/access.c b/xorg-server/os/access.c
index 50fc5f9f2..8c5b50af0 100644
--- a/xorg-server/os/access.c
+++ b/xorg-server/os/access.c
@@ -216,7 +216,7 @@ typedef struct _host {
int requested;
} HOST;
-#define MakeHost(h,l) (h)=(HOST *) xalloc(sizeof *(h)+(l));\
+#define MakeHost(h,l) (h)=xalloc(sizeof *(h)+(l));\
if (h) { \
(h)->addr=(unsigned char *) ((h) + 1);\
(h)->requested = FALSE; \
@@ -415,8 +415,7 @@ DefineSelf (int fd)
*/
if (family == FamilyInternet &&
!(len == 4 &&
- ((addr[0] == 127 && addr[1] == 0 &&
- addr[2] == 0 && addr[3] == 1) ||
+ ((addr[0] == 127) ||
(addr[0] == 0 && addr[1] == 0 &&
addr[2] == 0 && addr[3] == 0)))
)
@@ -1095,7 +1094,7 @@ ResetHosts (char *display)
}
/* Is client on the local host */
-_X_EXPORT Bool LocalClient(ClientPtr client)
+Bool LocalClient(ClientPtr client)
{
int alen, family, notused;
Xtransaddr *from = NULL;
@@ -1109,12 +1108,12 @@ _X_EXPORT Bool LocalClient(ClientPtr client)
&alen, (pointer *)&addr);
if (family == -1)
{
- xfree ((char *) from);
+ xfree (from);
return FALSE;
}
if (family == FamilyLocal)
{
- xfree ((char *) from);
+ xfree (from);
return TRUE;
}
for (host = selfhosts; host; host = host->next)
@@ -1122,7 +1121,7 @@ _X_EXPORT Bool LocalClient(ClientPtr client)
if (addrEqual (family, addr, alen, host))
return TRUE;
}
- xfree ((char *) from);
+ xfree (from);
}
return FALSE;
}
@@ -1458,11 +1457,11 @@ GetHosts (
for (host = validhosts; host; host = host->next)
{
nHosts++;
- n += (((host->len + 3) >> 2) << 2) + sizeof(xHostEntry);
+ n += pad_to_int32(host->len) + sizeof(xHostEntry);
}
if (n)
{
- *data = ptr = (pointer) xalloc (n);
+ *data = ptr = xalloc (n);
if (!ptr)
{
return(BadAlloc);
@@ -1474,7 +1473,7 @@ GetHosts (
((xHostEntry *)ptr)->length = len;
ptr += sizeof(xHostEntry);
acopy (host->addr, ptr, len);
- ptr += ((len + 3) >> 2) << 2;
+ ptr += pad_to_int32(len);
}
} else {
*data = NULL;
@@ -1721,7 +1720,7 @@ siTypeAdd(const char *typeName, siAddrMatchFunc addrMatch,
}
}
- s = (struct siType *) xalloc(sizeof(struct siType));
+ s = xalloc(sizeof(struct siType));
if (s == NULL)
return BadAlloc;