aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/os/access.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2015-06-22 09:36:08 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2015-12-28 12:54:40 +0100
commit68dd0b52e13c844d662192654fb10cb993257a59 (patch)
treea97ab98a06147cd5fb194063a9984dc3973fba55 /nx-X11/programs/Xserver/os/access.c
parente9f44221b2520a1d894b3c125269b5d10438453b (diff)
downloadnx-libs-68dd0b52e13c844d662192654fb10cb993257a59.tar.gz
nx-libs-68dd0b52e13c844d662192654fb10cb993257a59.tar.bz2
nx-libs-68dd0b52e13c844d662192654fb10cb993257a59.zip
Replace 'pointer' type with 'void *'
This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer' is used throughout the X server for other things, and having duplicate names generates compiler warnings. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Eric Anholt <eric@anholt.net> Rebased against NX: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Diffstat (limited to 'nx-X11/programs/Xserver/os/access.c')
-rw-r--r--nx-X11/programs/Xserver/os/access.c92
1 files changed, 46 insertions, 46 deletions
diff --git a/nx-X11/programs/Xserver/os/access.c b/nx-X11/programs/Xserver/os/access.c
index 532a2f82e..07b460f40 100644
--- a/nx-X11/programs/Xserver/os/access.c
+++ b/nx-X11/programs/Xserver/os/access.c
@@ -226,14 +226,14 @@ Bool defeatAccessControl = FALSE;
static int ConvertAddr(struct sockaddr * /*saddr*/,
int * /*len*/,
- pointer * /*addr*/);
+ void ** /*addr*/);
static int CheckAddr(int /*family*/,
- pointer /*pAddr*/,
+ void * /*pAddr*/,
unsigned /*length*/);
static Bool NewHost(int /*family*/,
- pointer /*addr*/,
+ void * /*addr*/,
int /*len*/,
int /* addingLocalHosts */);
@@ -270,7 +270,7 @@ static int LocalHostRequested = FALSE;
static int UsingXdmcp = FALSE;
/* FamilyServerInterpreted implementation */
-static Bool siAddrMatch(int family, pointer addr, int len, HOST *host,
+static Bool siAddrMatch(int family, void * addr, int len, HOST *host,
ClientPtr client);
static int siCheckAddr(const char *addrString, int length);
static void siTypesInitialize(void);
@@ -302,7 +302,7 @@ DisableLocalHost (void)
LocalHostEnabled = FALSE;
for (self = selfhosts; self; self = self->next) {
if (!self->requested) /* Fix for XFree86 bug #156 */
- (void) RemoveHost ((ClientPtr)NULL, self->family, self->len, (pointer)self->addr);
+ (void) RemoveHost ((ClientPtr)NULL, self->family, self->len, (void *)self->addr);
}
}
@@ -441,7 +441,7 @@ DefineSelf (int fd)
}
len = sizeof(struct sockaddr_in);
- family = ConvertAddr (IA_SIN(&ifaddr), &len, (pointer *)&addr);
+ family = ConvertAddr (IA_SIN(&ifaddr), &len, (void **)&addr);
if (family == -1 || family == FamilyLocal)
continue;
for (host = selfhosts;
@@ -602,7 +602,7 @@ DefineSelf (int fd)
default:
goto DefineLocalHost;
}
- family = ConvertAddr ( &(saddr.sa), &len, (pointer *)&addr);
+ family = ConvertAddr ( &(saddr.sa), &len, (void **)&addr);
if ( family != -1 && family != FamilyLocal )
{
for (host = selfhosts;
@@ -812,7 +812,7 @@ DefineSelf (int fd)
#define IFR_IFR_NAME ifr->ifr_name
#endif
- if (ifioctl (fd, IFC_IOCTL_REQ, (pointer) &ifc) < 0)
+ if (ifioctl (fd, IFC_IOCTL_REQ, (void *) &ifc) < 0)
Error ("Getting interface configuration (4)");
cplim = (char *) IFC_IFC_REQ + IFC_IFC_LEN;
@@ -822,7 +822,7 @@ DefineSelf (int fd)
ifr = (ifr_type *) cp;
len = ifraddr_size (IFR_IFR_ADDR);
family = ConvertAddr ((struct sockaddr *) &IFR_IFR_ADDR,
- &len, (pointer *)&addr);
+ &len, (void **)&addr);
#ifdef DNETCONN
/*
* DECnet was handled up above.
@@ -943,13 +943,13 @@ DefineSelf (int fd)
struct ifreq broad_req;
broad_req = *ifr;
- if (ifioctl (fd, SIOCGIFFLAGS, (pointer) &broad_req) != -1 &&
+ if (ifioctl (fd, SIOCGIFFLAGS, (void *) &broad_req) != -1 &&
(broad_req.ifr_flags & IFF_BROADCAST) &&
(broad_req.ifr_flags & IFF_UP)
)
{
broad_req = *ifr;
- if (ifioctl (fd, SIOCGIFBRDADDR, (pointer) &broad_req) != -1)
+ if (ifioctl (fd, SIOCGIFBRDADDR, (void *) &broad_req) != -1)
broad_addr = broad_req.ifr_addr;
else
continue;
@@ -980,7 +980,7 @@ DefineSelf (int fd)
continue;
#endif /* DNETCONN */
len = sizeof(*(ifr->ifa_addr));
- family = ConvertAddr(ifr->ifa_addr, &len, (pointer *)&addr);
+ family = ConvertAddr(ifr->ifa_addr, &len, (void **)&addr);
if (family == -1 || family == FamilyLocal)
continue;
#if defined(IPv6) && defined(AF_INET6)
@@ -1104,13 +1104,13 @@ DefineSelf (int fd)
#ifdef XDMCP
void
-AugmentSelf(pointer from, int len)
+AugmentSelf(void * from, int len)
{
int family;
- pointer addr;
+ void * addr;
register HOST *host;
- family = ConvertAddr(from, &len, (pointer *)&addr);
+ family = ConvertAddr(from, &len, (void **)&addr);
if (family == -1 || family == FamilyLocal)
return;
for (host = selfhosts; host; host = host->next)
@@ -1175,7 +1175,7 @@ ResetHosts (char *display)
krb5_data kbuf;
#endif
int family = 0;
- pointer addr;
+ void *addr;
int len;
siTypesInitialize();
@@ -1284,7 +1284,7 @@ ResetHosts (char *display)
/* node was specified by name */
saddr.sa.sa_family = np->n_addrtype;
len = sizeof(saddr.sa);
- if (ConvertAddr (&saddr.sa, &len, (pointer *)&addr) == FamilyDECnet)
+ if (ConvertAddr (&saddr.sa, &len, (void **)&addr) == FamilyDECnet)
{
bzero ((char *) &dnaddr, sizeof (dnaddr));
dnaddr.a_len = np->n_length;
@@ -1293,7 +1293,7 @@ ResetHosts (char *display)
}
}
if (dnaddrp)
- (void) NewHost(FamilyDECnet, (pointer)dnaddrp,
+ (void) NewHost(FamilyDECnet, (void *)dnaddrp,
(int)(dnaddrp->a_len + sizeof(dnaddrp->a_len)), FALSE);
}
else
@@ -1329,7 +1329,7 @@ ResetHosts (char *display)
if (getaddrinfo(hostname, NULL, NULL, &addresses) == 0) {
for (a = addresses ; a != NULL ; a = a->ai_next) {
len = a->ai_addrlen;
- f = ConvertAddr(a->ai_addr,&len,(pointer *)&addr);
+ f = ConvertAddr(a->ai_addr,&len,(void **)&addr);
if ( (family == f) ||
((family == FamilyWild) && (f != -1)) ) {
NewHost(f, addr, len, FALSE);
@@ -1351,16 +1351,16 @@ ResetHosts (char *display)
{
saddr.sa.sa_family = hp->h_addrtype;
len = sizeof(saddr.sa);
- if ((family = ConvertAddr (&saddr.sa, &len, (pointer *)&addr)) != -1)
+ if ((family = ConvertAddr (&saddr.sa, &len, (void **)&addr)) != -1)
{
#ifdef h_addr /* new 4.3bsd version of gethostent */
char **list;
/* iterate over the addresses */
for (list = hp->h_addr_list; *list; list++)
- (void) NewHost (family, (pointer)*list, len, FALSE);
+ (void) NewHost (family, (void *)*list, len, FALSE);
#else
- (void) NewHost (family, (pointer)hp->h_addr, len, FALSE);
+ (void) NewHost (family, (void *)hp->h_addr, len, FALSE);
#endif
}
}
@@ -1378,7 +1378,7 @@ Bool LocalClient(ClientPtr client)
{
int alen, family, notused;
Xtransaddr *from = NULL;
- pointer addr;
+ void *addr;
register HOST *host;
#ifdef XCSECURITY
@@ -1398,7 +1398,7 @@ Bool LocalClient(ClientPtr client)
&notused, &alen, &from))
{
family = ConvertAddr ((struct sockaddr *) from,
- &alen, (pointer *)&addr);
+ &alen, (void **)&addr);
if (family == -1)
{
xfree ((char *) from);
@@ -1546,7 +1546,7 @@ int
AddHost (ClientPtr client,
int family,
unsigned length, /* of bytes in pAddr */
- pointer pAddr)
+ void *pAddr)
{
int len;
@@ -1596,8 +1596,8 @@ ForEachHostInFamily (int family,
Bool (*func)(
unsigned char * /* addr */,
short /* len */,
- pointer /* closure */),
- pointer closure)
+ void * /* closure */),
+ void * closure)
{
HOST *host;
@@ -1611,7 +1611,7 @@ ForEachHostInFamily (int family,
* called when starting or resetting the server */
static Bool
NewHost (int family,
- pointer addr,
+ void *addr,
int len,
int addingLocalHosts)
{
@@ -1648,7 +1648,7 @@ RemoveHost (
ClientPtr client,
int family,
unsigned length, /* of bytes in pAddr */
- pointer pAddr)
+ void *pAddr)
{
int len;
register HOST *host, **prev;
@@ -1703,7 +1703,7 @@ RemoveHost (
/* Get all hosts in the access control list */
int
GetHosts (
- pointer *data,
+ void * *data,
int *pnHosts,
int *pLen,
BOOL *pEnabled)
@@ -1726,7 +1726,7 @@ GetHosts (
}
if (n)
{
- *data = ptr = (pointer) xalloc (n);
+ *data = ptr = (void *) xalloc (n);
if (!ptr)
{
return(BadAlloc);
@@ -1756,7 +1756,7 @@ GetHosts (
static int
CheckAddr (
int family,
- pointer pAddr,
+ void * pAddr,
unsigned length)
{
int len;
@@ -1813,12 +1813,12 @@ InvalidHost (
ClientPtr client)
{
int family;
- pointer addr;
+ void *addr;
register HOST *selfhost, *host;
if (!AccessEnabled) /* just let them in */
return(0);
- family = ConvertAddr (saddr, &len, (pointer *)&addr);
+ family = ConvertAddr (saddr, &len, (void **)&addr);
if (family == -1)
return 1;
if (family == FamilyLocal)
@@ -1860,7 +1860,7 @@ static int
ConvertAddr (
register struct sockaddr *saddr,
int *len,
- pointer *addr)
+ void **addr)
{
if (*len == 0)
return (FamilyLocal);
@@ -1878,7 +1878,7 @@ ConvertAddr (
return FamilyLocal;
#endif
*len = sizeof (struct in_addr);
- *addr = (pointer) &(((struct sockaddr_in *) saddr)->sin_addr);
+ *addr = (void *) &(((struct sockaddr_in *) saddr)->sin_addr);
return FamilyInternet;
#if defined(IPv6) && defined(AF_INET6)
case AF_INET6:
@@ -1886,11 +1886,11 @@ ConvertAddr (
struct sockaddr_in6 *saddr6 = (struct sockaddr_in6 *) saddr;
if (IN6_IS_ADDR_V4MAPPED(&(saddr6->sin6_addr))) {
*len = sizeof (struct in_addr);
- *addr = (pointer) &(saddr6->sin6_addr.s6_addr[12]);
+ *addr = (void *) &(saddr6->sin6_addr.s6_addr[12]);
return FamilyInternet;
} else {
*len = sizeof (struct in6_addr);
- *addr = (pointer) &(saddr6->sin6_addr);
+ *addr = (void *) &(saddr6->sin6_addr);
return FamilyInternet6;
}
}
@@ -1901,7 +1901,7 @@ ConvertAddr (
{
struct sockaddr_dn *sdn = (struct sockaddr_dn *) saddr;
*len = sdn->sdn_nodeaddrl + sizeof(sdn->sdn_nodeaddrl);
- *addr = (pointer) &(sdn->sdn_add);
+ *addr = (void *) &(sdn->sdn_add);
}
return FamilyDECnet;
#endif
@@ -1953,7 +1953,7 @@ GetAccessControl(void)
* future to enable loading additional host types, but that was not done for
* the initial implementation.
*/
-typedef Bool (*siAddrMatchFunc)(int family, pointer addr, int len,
+typedef Bool (*siAddrMatchFunc)(int family, void * addr, int len,
const char *siAddr, int siAddrlen, ClientPtr client, void *siTypePriv);
typedef int (*siCheckAddrFunc)(const char *addrString, int length,
void *siTypePriv);
@@ -2005,7 +2005,7 @@ siTypeAdd(const char *typeName, siAddrMatchFunc addrMatch,
/* Checks to see if a host matches a server-interpreted host entry */
static Bool
-siAddrMatch(int family, pointer addr, int len, HOST *host, ClientPtr client)
+siAddrMatch(int family, void * addr, int len, HOST *host, ClientPtr client)
{
Bool matches = FALSE;
struct siType *s;
@@ -2105,7 +2105,7 @@ siCheckAddr(const char *addrString, int length)
#endif
static Bool
-siHostnameAddrMatch(int family, pointer addr, int len,
+siHostnameAddrMatch(int family, void * addr, int len,
const char *siAddr, int siAddrLen, ClientPtr client, void *typePriv)
{
Bool res = FALSE;
@@ -2120,7 +2120,7 @@ siHostnameAddrMatch(int family, pointer addr, int len,
struct addrinfo *addresses;
struct addrinfo *a;
int f, hostaddrlen;
- pointer hostaddr;
+ void * hostaddr;
if (siAddrLen >= sizeof(hostname))
return FALSE;
@@ -2149,7 +2149,7 @@ siHostnameAddrMatch(int family, pointer addr, int len,
#endif
char hostname[SI_HOSTNAME_MAXLEN];
int f, hostaddrlen;
- pointer hostaddr;
+ void * hostaddr;
const char **addrlist;
if (siAddrLen >= sizeof(hostname))
@@ -2249,7 +2249,7 @@ siHostnameCheckAddr(const char *valueString, int length, void *typePriv)
#define SI_IPv6_MAXLEN INET6_ADDRSTRLEN
static Bool
-siIPv6AddrMatch(int family, pointer addr, int len,
+siIPv6AddrMatch(int family, void * addr, int len,
const char *siAddr, int siAddrlen, ClientPtr client, void *typePriv)
{
struct in6_addr addr6;
@@ -2367,7 +2367,7 @@ siLocalCredGetId(const char *addr, int len, siLocalCredPrivPtr lcPriv, int *id)
}
static Bool
-siLocalCredAddrMatch(int family, pointer addr, int len,
+siLocalCredAddrMatch(int family, void * addr, int len,
const char *siAddr, int siAddrlen, ClientPtr client, void *typePriv)
{
int connUid, connGid, *connSuppGids, connNumSuppGids, siAddrId;