summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-12-15 01:05:51 -0800
committerKeith Packard <keithp@keithp.com>2014-01-12 10:24:11 -0800
commit60014a4a98ff924ae7f6840781f768c1cc93bbab (patch)
treea956a03a6a7c87cac4d48fb95b66fec313d87fde /os
parent93fa64e17d7bd600ebf18ecab85f5b2d17fe30ce (diff)
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>
Diffstat (limited to 'os')
-rw-r--r--os/WaitFor.c12
-rw-r--r--os/access.c72
-rw-r--r--os/connection.c6
-rw-r--r--os/io.c6
-rw-r--r--os/log.c2
-rw-r--r--os/rpcauth.c4
-rw-r--r--os/utils.c12
-rw-r--r--os/xdmcp.c20
8 files changed, 67 insertions, 67 deletions
diff --git a/os/WaitFor.c b/os/WaitFor.c
index 39fedd9a2..3eb15b9b8 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.c
@@ -118,7 +118,7 @@ struct _OsTimerRec {
CARD32 expires;
CARD32 delta;
OsTimerCallback callback;
- pointer arg;
+ void *arg;
};
static void DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev);
@@ -212,7 +212,7 @@ WaitForSomething(int *pClientsReady)
XFD_COPYSET(&AllSockets, &LastSelectMask);
}
- BlockHandler((pointer) &wt, (pointer) &LastSelectMask);
+ BlockHandler((void *) &wt, (void *) &LastSelectMask);
if (NewOutputPending)
FlushAllOutput();
/* keep this check close to select() call to minimize race */
@@ -226,7 +226,7 @@ WaitForSomething(int *pClientsReady)
i = Select(MaxClients, &LastSelectMask, NULL, NULL, wt);
}
selecterr = GetErrno();
- WakeupHandler(i, (pointer) &LastSelectMask);
+ WakeupHandler(i, (void *) &LastSelectMask);
if (i <= 0) { /* An error or timeout occurred */
if (dispatchException)
return 0;
@@ -303,7 +303,7 @@ WaitForSomething(int *pClientsReady)
XFD_ANDSET(&tmp_set, &LastSelectMask, &WellKnownConnections);
if (XFD_ANYSET(&tmp_set))
QueueWorkProc(EstablishNewConnections, NULL,
- (pointer) &LastSelectMask);
+ (void *) &LastSelectMask);
if (XFD_ANYSET(&devicesReadable) || XFD_ANYSET(&clientsReadable))
break;
@@ -416,7 +416,7 @@ DoTimer(OsTimerPtr timer, CARD32 now, OsTimerPtr *prev)
OsTimerPtr
TimerSet(OsTimerPtr timer, int flags, CARD32 millis,
- OsTimerCallback func, pointer arg)
+ OsTimerCallback func, void *arg)
{
register OsTimerPtr *prev;
CARD32 now = GetTimeInMillis();
@@ -564,7 +564,7 @@ NextDPMSTimeout(INT32 timeout)
#endif /* DPMSExtension */
static CARD32
-ScreenSaverTimeoutExpire(OsTimerPtr timer, CARD32 now, pointer arg)
+ScreenSaverTimeoutExpire(OsTimerPtr timer, CARD32 now, void *arg)
{
INT32 timeout = now - LastEventTime(XIAllDevices).milliseconds;
CARD32 nextTimeout = 0;
diff --git a/os/access.c b/os/access.c
index c55b0ef25..e8c0781f2 100644
--- a/os/access.c
+++ b/os/access.c
@@ -186,7 +186,7 @@ Bool defeatAccessControl = FALSE;
static int ConvertAddr(struct sockaddr * /*saddr */ ,
int * /*len */ ,
- pointer * /*addr */ );
+ void ** /*addr */ );
static int CheckAddr(int /*family */ ,
const void * /*pAddr */ ,
@@ -226,7 +226,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);
@@ -258,7 +258,7 @@ DisableLocalHost(void)
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 *) self->addr);
}
}
@@ -382,7 +382,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;
host && !addrEqual(family, addr, len, host);
@@ -545,7 +545,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)
ErrorF("Getting interface configuration (4): %s\n", strerror(errno));
cplim = (char *) IFC_IFC_REQ + IFC_IFC_LEN;
@@ -554,7 +554,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);
if (family == -1 || family == FamilyLocal)
continue;
#if defined(IPv6) && defined(AF_INET6)
@@ -649,12 +649,12 @@ 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;
@@ -679,7 +679,7 @@ DefineSelf(int fd)
continue;
len = sizeof(*(ifr->ifa_addr));
family = ConvertAddr((struct sockaddr *) ifr->ifa_addr, &len,
- (pointer *) &addr);
+ (void **) &addr);
if (family == -1 || family == FamilyLocal)
continue;
#if defined(IPv6) && defined(AF_INET6)
@@ -775,13 +775,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) {
@@ -835,7 +835,7 @@ ResetHosts(const char *display)
} saddr;
#endif
int family = 0;
- pointer addr;
+ void *addr;
int len;
siTypesInitialize();
@@ -927,7 +927,7 @@ ResetHosts(const char *display)
for (a = addresses; a != NULL; a = a->ai_next) {
len = a->ai_addrlen;
f = ConvertAddr(a->ai_addr, &len,
- (pointer *) &addr);
+ (void **) &addr);
if ((family == f) ||
((family == FamilyWild) && (f != -1))) {
NewHost(f, addr, len, FALSE);
@@ -950,15 +950,15 @@ ResetHosts(const char *display)
len = sizeof(saddr.sa);
if ((family =
ConvertAddr(&saddr.sa, &len,
- (pointer *) &addr)) != -1) {
+ (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,
+ (void) NewHost(family, (void *) hp->h_addr, len,
FALSE);
#endif
}
@@ -978,7 +978,7 @@ ComputeLocalClient(ClientPtr client)
{
int alen, family, notused;
Xtransaddr *from = NULL;
- pointer addr;
+ void *addr;
register HOST *host;
OsCommPtr oc = (OsCommPtr) client->osPrivate;
@@ -987,7 +987,7 @@ ComputeLocalClient(ClientPtr client)
if (!_XSERVTransGetPeerAddr(oc->trans_conn, &notused, &alen, &from)) {
family = ConvertAddr((struct sockaddr *) from,
- &alen, (pointer *) &addr);
+ &alen, (void **) &addr);
if (family == -1) {
free(from);
return FALSE;
@@ -1219,8 +1219,8 @@ AddHost(ClientPtr client, int family, unsigned length, /* of bytes in pAddr */
Bool
ForEachHostInFamily(int family, Bool (*func) (unsigned char * /* addr */ ,
short /* len */ ,
- pointer /* closure */ ),
- pointer closure)
+ void */* closure */ ),
+ void *closure)
{
HOST *host;
@@ -1264,7 +1264,7 @@ NewHost(int family, const void *addr, int len, int addingLocalHosts)
int
RemoveHost(ClientPtr client, int family, unsigned length, /* of bytes in pAddr */
- pointer pAddr)
+ void *pAddr)
{
int rc, len;
register HOST *host, **prev;
@@ -1311,7 +1311,7 @@ RemoveHost(ClientPtr client, int family, unsigned length, /* of bytes in p
/* Get all hosts in the access control list */
int
-GetHosts(pointer *data, int *pnHosts, int *pLen, BOOL * pEnabled)
+GetHosts(void **data, int *pnHosts, int *pLen, BOOL * pEnabled)
{
int len;
register int n = 0;
@@ -1386,12 +1386,12 @@ int
InvalidHost(register struct sockaddr *saddr, int len, 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) {
@@ -1427,7 +1427,7 @@ InvalidHost(register struct sockaddr *saddr, int len, ClientPtr client)
}
static int
-ConvertAddr(register struct sockaddr *saddr, int *len, pointer *addr)
+ConvertAddr(register struct sockaddr *saddr, int *len, void **addr)
{
if (*len == 0)
return FamilyLocal;
@@ -1444,7 +1444,7 @@ ConvertAddr(register struct sockaddr *saddr, int *len, pointer *addr)
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:
@@ -1453,12 +1453,12 @@ ConvertAddr(register struct sockaddr *saddr, int *len, pointer *addr)
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;
}
}
@@ -1505,7 +1505,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,
@@ -1558,7 +1558,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;
@@ -1659,7 +1659,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)
{
@@ -1675,7 +1675,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;
@@ -1704,7 +1704,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))
@@ -1808,7 +1808,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)
{
@@ -1934,7 +1934,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)
{
diff --git a/os/connection.c b/os/connection.c
index 162e1d93e..ddf4f0a3a 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -760,7 +760,7 @@ AllocNewConnection(XtransConnInfo trans_conn, int fd, CARD32 conn_time)
oc->output = (ConnectionOutputPtr) NULL;
oc->auth_id = None;
oc->conn_time = conn_time;
- if (!(client = NextAvailableClient((pointer) oc))) {
+ if (!(client = NextAvailableClient((void *) oc))) {
free(oc);
return NullClient;
}
@@ -798,7 +798,7 @@ AllocNewConnection(XtransConnInfo trans_conn, int fd, CARD32 conn_time)
*****************/
/*ARGSUSED*/ Bool
-EstablishNewConnections(ClientPtr clientUnused, pointer closure)
+EstablishNewConnections(ClientPtr clientUnused, void *closure)
{
fd_set readyconnections; /* set of listeners that are ready */
int curconn; /* fd of listener that's ready */
@@ -1046,7 +1046,7 @@ CloseDownConnection(ClientPtr client)
CloseDownFileDescriptor(oc);
FreeOsBuffers(oc);
free(client->osPrivate);
- client->osPrivate = (pointer) NULL;
+ client->osPrivate = (void *) NULL;
if (auditTrailLevel > 1)
AuditF("client %d disconnected\n", client->index);
}
diff --git a/os/io.c b/os/io.c
index 922a8eb02..cf5e8f933 100644
--- a/os/io.c
+++ b/os/io.c
@@ -481,7 +481,7 @@ ReadRequestFromClient(ClientPtr client)
oci->lenLastReq -= (sizeof(xBigReq) - sizeof(xReq));
client->req_len -= bytes_to_int32(sizeof(xBigReq) - sizeof(xReq));
}
- client->requestBuffer = (pointer) oci->bufptr;
+ client->requestBuffer = (void *) oci->bufptr;
#ifdef DEBUG_COMMUNICATION
{
xReq *req = client->requestBuffer;
@@ -809,7 +809,7 @@ WriteToClient(ClientPtr who, int count, const void *__buf)
who->replyBytesRemaining -= count + padBytes;
replyinfo.startOfReply = FALSE;
replyinfo.bytesRemaining = who->replyBytesRemaining;
- CallCallbacks((&ReplyCallback), (pointer) &replyinfo);
+ CallCallbacks((&ReplyCallback), (void *) &replyinfo);
}
else if (who->clientState == ClientStateRunning && buf[0] == X_Reply) { /* start of new reply */
CARD32 replylen;
@@ -821,7 +821,7 @@ WriteToClient(ClientPtr who, int count, const void *__buf)
bytesleft = (replylen * 4) + SIZEOF(xReply) - count - padBytes;
replyinfo.startOfReply = TRUE;
replyinfo.bytesRemaining = who->replyBytesRemaining = bytesleft;
- CallCallbacks((&ReplyCallback), (pointer) &replyinfo);
+ CallCallbacks((&ReplyCallback), (void *) &replyinfo);
}
}
#ifdef DEBUG_COMMUNICATION
diff --git a/os/log.c b/os/log.c
index 53b358629..792b79e93 100644
--- a/os/log.c
+++ b/os/log.c
@@ -826,7 +826,7 @@ AuditF(const char *f, ...)
}
static CARD32
-AuditFlush(OsTimerPtr timer, CARD32 now, pointer arg)
+AuditFlush(OsTimerPtr timer, CARD32 now, void *arg)
{
char *prefix;
diff --git a/os/rpcauth.c b/os/rpcauth.c
index bd219acfa..d60ea3518 100644
--- a/os/rpcauth.c
+++ b/os/rpcauth.c
@@ -113,7 +113,7 @@ authdes_ezdecode(const char *inmsg, int len)
static XID rpc_id = (XID) ~0L;
static Bool
-CheckNetName(unsigned char *addr, short len, pointer closure)
+CheckNetName(unsigned char *addr, short len, void *closure)
{
return (len == strlen((char *) closure) &&
strncmp((char *) addr, (char *) closure, len) == 0);
@@ -159,7 +159,7 @@ _X_HIDDEN int
SecureRPCAdd(unsigned short data_length, const char *data, XID id)
{
if (data_length)
- AddHost((pointer) 0, FamilyNetname, data_length, data);
+ AddHost((void *) 0, FamilyNetname, data_length, data);
rpc_id = id;
return 1;
}
diff --git a/os/utils.c b/os/utils.c
index e81dc5f2d..6f83a089b 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -490,7 +490,7 @@ GetTimeInMicros(void)
#endif
void
-AdjustWaitForDelay(pointer waitTime, unsigned long newdelay)
+AdjustWaitForDelay(void *waitTime, unsigned long newdelay)
{
static struct timeval delay_val;
struct timeval **wt = (struct timeval **) waitTime;
@@ -986,7 +986,7 @@ ProcessCommandLine(int argc, char *argv[])
/* Implement a simple-minded font authorization scheme. The authorization
name is "hp-hostname-1", the contents are simply the host name. */
int
-set_font_authorizations(char **authorizations, int *authlen, pointer client)
+set_font_authorizations(char **authorizations, int *authlen, void *client)
{
#define AUTHORIZATION_NAME "hp-hostname-1"
#if defined(TCPCONN) || defined(STREAMSCONN)
@@ -1385,7 +1385,7 @@ static struct pid {
OsSigHandlerPtr old_alarm = NULL; /* XXX horrible awful hack */
-pointer
+void *
Popen(const char *command, const char *type)
{
struct pid *cur;
@@ -1473,7 +1473,7 @@ Popen(const char *command, const char *type)
}
/* fopen that drops privileges */
-pointer
+void *
Fopen(const char *file, const char *type)
{
FILE *iop;
@@ -1568,7 +1568,7 @@ Fopen(const char *file, const char *type)
}
int
-Pclose(pointer iop)
+Pclose(void *iop)
{
struct pid *cur, *last;
int pstat;
@@ -1605,7 +1605,7 @@ Pclose(pointer iop)
}
int
-Fclose(pointer iop)
+Fclose(void *iop)
{
#ifdef HAS_SAVED_IDS_AND_SETEUID
return fclose(iop);
diff --git a/os/xdmcp.c b/os/xdmcp.c
index 11f11333d..da509e42a 100644
--- a/os/xdmcp.c
+++ b/os/xdmcp.c
@@ -189,13 +189,13 @@ static void timeout(void);
static void restart(void);
-static void XdmcpBlockHandler(pointer /*data */ ,
+static void XdmcpBlockHandler(void */*data */ ,
struct timeval ** /*wt */ ,
- pointer /*LastSelectMask */ );
+ void */*LastSelectMask */ );
-static void XdmcpWakeupHandler(pointer /*data */ ,
+static void XdmcpWakeupHandler(void */*data */ ,
int /*i */ ,
- pointer /*LastSelectMask */ );
+ void */*LastSelectMask */ );
/*
* Register the Manufacturer display ID
@@ -578,7 +578,7 @@ XdmcpInit(void)
strlen(defaultDisplayClass));
AccessUsingXdmcp();
RegisterBlockAndWakeupHandlers(XdmcpBlockHandler, XdmcpWakeupHandler,
- (pointer) 0);
+ (void *) 0);
timeOutRtx = 0;
DisplayNumber = (CARD16) atoi(display);
get_xdmcp_sock();
@@ -592,7 +592,7 @@ XdmcpReset(void)
state = XDM_INIT_STATE;
if (state != XDM_OFF) {
RegisterBlockAndWakeupHandlers(XdmcpBlockHandler, XdmcpWakeupHandler,
- (pointer) 0);
+ (void *) 0);
timeOutRtx = 0;
send_packet();
}
@@ -635,8 +635,8 @@ XdmcpCloseDisplay(int sock)
*/
/*ARGSUSED*/ static void
-XdmcpBlockHandler(pointer data, /* unused */
- struct timeval **wt, pointer pReadmask)
+XdmcpBlockHandler(void *data, /* unused */
+ struct timeval **wt, void *pReadmask)
{
fd_set *LastSelectMask = (fd_set *) pReadmask;
CARD32 millisToGo;
@@ -663,8 +663,8 @@ XdmcpBlockHandler(pointer data, /* unused */
*/
/*ARGSUSED*/ static void
-XdmcpWakeupHandler(pointer data, /* unused */
- int i, pointer pReadmask)
+XdmcpWakeupHandler(void *data, /* unused */
+ int i, void *pReadmask)
{
fd_set *LastSelectMask = (fd_set *) pReadmask;
fd_set devicesReadable;