diff options
| author | Mihai Moldovan <ionic@ionic.de> | 2017-12-15 12:55:17 +0100 |
|---|---|---|
| committer | Mihai Moldovan <ionic@ionic.de> | 2017-12-15 12:55:17 +0100 |
| commit | 1dad092caf01d733990648e6df64cbf964df5143 (patch) | |
| tree | 39de0e643e76754a3e23ca9dd0350b8ba4f76250 /nx-X11/programs/Xserver/Xext/sync.c | |
| parent | 6d70b9e3c47f27a166f4aacb522c5c1e49092dd9 (diff) | |
| parent | 2b9025f797ee322e21077e100c2ee27c2e7fa0e0 (diff) | |
| download | nx-libs-1dad092caf01d733990648e6df64cbf964df5143.tar.gz nx-libs-1dad092caf01d733990648e6df64cbf964df5143.tar.bz2 nx-libs-1dad092caf01d733990648e6df64cbf964df5143.zip | |
Merge branch '3.6.x'
Diffstat (limited to 'nx-X11/programs/Xserver/Xext/sync.c')
| -rw-r--r-- | nx-X11/programs/Xserver/Xext/sync.c | 324 |
1 files changed, 145 insertions, 179 deletions
diff --git a/nx-X11/programs/Xserver/Xext/sync.c b/nx-X11/programs/Xserver/Xext/sync.c index 0e0df8305..7fa6145a6 100644 --- a/nx-X11/programs/Xserver/Xext/sync.c +++ b/nx-X11/programs/Xserver/Xext/sync.c @@ -1,4 +1,3 @@ -/* $Xorg: sync.c,v 1.4 2001/02/09 02:04:33 xorgcvs Exp $ */ /* Copyright 1991, 1993, 1998 The Open Group @@ -50,17 +49,16 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/Xext/sync.c,v 3.13 2003/09/02 18:19:01 tsi Exp $ */ -#define NEED_REPLIES -#define NEED_EVENTS #ifdef HAVE_DIX_CONFIG_H #include <dix-config.h> #endif -#include <X11/X.h> -#include <X11/Xproto.h> -#include <X11/Xmd.h> +#include <string.h> + +#include <nx-X11/X.h> +#include <nx-X11/Xproto.h> +#include <nx-X11/Xmd.h> #include "misc.h" #include "os.h" #include "extnsionst.h" @@ -68,19 +66,14 @@ PERFORMANCE OF THIS SOFTWARE. #include "resource.h" #include "opaque.h" #define _SYNC_SERVER -#include <X11/extensions/sync.h> -#include <X11/extensions/syncstr.h> +#include <nx-X11/extensions/sync.h> +#include <nx-X11/extensions/syncstr.h> +#include "protocol-versions.h" -#ifdef EXTMODULE -#include "xf86_ansic.h" -#else #include <stdio.h> -#if !defined(WIN32) && !defined(Lynx) +#if !defined(WIN32) #include <sys/time.h> #endif -#endif - -#include "modinit.h" /* * Local Global Variables @@ -103,40 +96,40 @@ static SyncCounter **SysCounterList = NULL; static int FreeAlarm( - pointer /* addr */, + void * /* addr */, XID /* id */ ); static int FreeAlarmClient( - pointer /* value */, + void * /* value */, XID /* id */ ); static int FreeAwait( - pointer /* addr */, + void * /* addr */, XID /* id */ ); static void ServertimeBracketValues( - pointer /* pCounter */, + void * /* pCounter */, CARD64 * /* pbracket_less */, CARD64 * /* pbracket_greater */ ); static void ServertimeQueryValue( - pointer /* pCounter */, + void * /* pCounter */, CARD64 * /* pValue_return */ ); static void ServertimeWakeupHandler( - pointer /* env */, + void * /* env */, int /* rc */, - pointer /* LastSelectMask */ + void * /* LastSelectMask */ ); static int @@ -161,9 +154,9 @@ SCounterNotifyEvent( static void ServertimeBlockHandler( - pointer /* env */, + void * /* env */, struct timeval ** /* wt */, - pointer /* LastSelectMask */ + void * /* LastSelectMask */ ); static int @@ -318,7 +311,7 @@ SyncDeleteTriggerFromCounter(pTrigger) pPrev->next = pCur->next; else pTrigger->pCounter->pTriglist = pCur->next; - xfree(pCur); + free(pCur); break; } } @@ -344,7 +337,7 @@ SyncAddTriggerToCounter(pTrigger) return Success; } - if (!(pCur = (SyncTriggerList *)xalloc(sizeof(SyncTriggerList)))) + if (!(pCur = (SyncTriggerList *)malloc(sizeof(SyncTriggerList)))) return BadAlloc; pCur->pTrigger = pTrigger; @@ -432,7 +425,7 @@ SyncInitTrigger(client, pTrigger, counter, changes) if (counter == None) pCounter = NULL; else if (!(pCounter = (SyncCounter *)SecurityLookupIDByType( - client, counter, RTCounter, SecurityReadAccess))) + client, counter, RTCounter, DixReadAccess))) { client->errorValue = counter; return SyncErrorBase + XSyncBadCounter; @@ -449,7 +442,7 @@ SyncInitTrigger(client, pTrigger, counter, changes) if (IsSystemCounter(pCounter)) { - (*pCounter->pSysCounterInfo->QueryValue) ((pointer) pCounter, + (*pCounter->pSysCounterInfo->QueryValue) ((void *) pCounter, &pCounter->value); } @@ -544,7 +537,6 @@ SyncSendAlarmNotifyEvents(pAlarm) ane.type = SyncEventBase + XSyncAlarmNotify; ane.kind = XSyncAlarmNotify; - ane.sequenceNumber = pAlarm->client->sequence; ane.alarm = pAlarm->alarm_id; if (pTrigger->pCounter) { @@ -562,18 +554,12 @@ SyncSendAlarmNotifyEvents(pAlarm) ane.state = pAlarm->state; /* send to owner */ - if (pAlarm->events && !pAlarm->client->clientGone) + if (pAlarm->events) WriteEventsToClient(pAlarm->client, 1, (xEvent *) &ane); /* send to other interested clients */ for (pcl = pAlarm->pEventClients; pcl; pcl = pcl->next) - { - if (!pAlarm->client->clientGone) - { - ane.sequenceNumber = pcl->client->sequence; - WriteEventsToClient(pcl->client, 1, (xEvent *) &ane); - } - } + WriteEventsToClient(pcl->client, 1, (xEvent *) &ane); } @@ -592,7 +578,7 @@ SyncSendCounterNotifyEvents(client, ppAwait, num_events) if (client->clientGone) return; pev = pEvents = (xSyncCounterNotifyEvent *) - ALLOCATE_LOCAL(num_events * sizeof(xSyncCounterNotifyEvent)); + malloc(num_events * sizeof(xSyncCounterNotifyEvent)); if (!pEvents) return; UpdateCurrentTime(); @@ -601,7 +587,6 @@ SyncSendCounterNotifyEvents(client, ppAwait, num_events) SyncTrigger *pTrigger = &(*ppAwait)->trigger; pev->type = SyncEventBase + XSyncCounterNotify; pev->kind = XSyncCounterNotify; - pev->sequenceNumber = client->sequence; pev->counter = pTrigger->pCounter->id; pev->wait_value_lo = XSyncValueLow32(pTrigger->test_value); pev->wait_value_hi = XSyncValueHigh32(pTrigger->test_value); @@ -613,7 +598,7 @@ SyncSendCounterNotifyEvents(client, ppAwait, num_events) } /* swapping will be taken care of by this */ WriteEventsToClient(client, num_events, (xEvent *)pEvents); - DEALLOCATE_LOCAL(pEvents); + free(pEvents); } @@ -723,7 +708,7 @@ SyncAwaitTriggerFired(pTrigger) pAwaitUnion = (SyncAwaitUnion *)pAwait->pHeader; numwaits = pAwaitUnion->header.num_waitconditions; - ppAwait = (SyncAwait **)ALLOCATE_LOCAL(numwaits * sizeof(SyncAwait *)); + ppAwait = (SyncAwait **)malloc(numwaits * sizeof(SyncAwait *)); if (!ppAwait) goto bail; @@ -792,7 +777,7 @@ SyncAwaitTriggerFired(pTrigger) if (num_events) SyncSendCounterNotifyEvents(pAwaitUnion->header.client, ppAwait, num_events); - DEALLOCATE_LOCAL(ppAwait); + free(ppAwait); bail: /* unblock the client */ @@ -878,7 +863,7 @@ SyncEventSelectForAlarm(pAlarm, client, wantevents) /* add new client to pAlarm->pEventClients */ - pClients = (SyncAlarmClientList *) xalloc(sizeof(SyncAlarmClientList)); + pClients = (SyncAlarmClientList *) malloc(sizeof(SyncAlarmClientList)); if (!pClients) return BadAlloc; @@ -889,7 +874,7 @@ SyncEventSelectForAlarm(pAlarm, client, wantevents) pClients->delete_id = FakeClientID(client->index); if (!AddResource(pClients->delete_id, RTAlarmClient, pAlarm)) { - xfree(pClients); + free(pClients); return BadAlloc; } @@ -1013,12 +998,12 @@ SyncCreateCounter(client, id, initialvalue) { SyncCounter *pCounter; - if (!(pCounter = (SyncCounter *) xalloc(sizeof(SyncCounter)))) + if (!(pCounter = (SyncCounter *) malloc(sizeof(SyncCounter)))) return (SyncCounter *)NULL; - if (!AddResource(id, RTCounter, (pointer) pCounter)) + if (!AddResource(id, RTCounter, (void *) pCounter)) { - xfree((pointer) pCounter); + free((void *) pCounter); return (SyncCounter *)NULL; } @@ -1032,7 +1017,7 @@ SyncCreateCounter(client, id, initialvalue) } static int FreeCounter( - pointer /*env*/, + void * /*env*/, XID /*id*/ ); @@ -1040,7 +1025,7 @@ static int FreeCounter( * ***** System Counter utilities */ -pointer +void * SyncCreateSystemCounter(name, initial, resolution, counterType, QueryValue, BracketValues) char *name; @@ -1048,19 +1033,19 @@ SyncCreateSystemCounter(name, initial, resolution, counterType, CARD64 resolution; SyncCounterType counterType; void (*QueryValue) ( - pointer /* pCounter */, + void * /* pCounter */, CARD64 * /* pValue_return */); void (*BracketValues) ( - pointer /* pCounter */, + void * /* pCounter */, CARD64 * /* pbracket_less */, CARD64 * /* pbracket_greater */); { SyncCounter *pCounter; - SysCounterList = (SyncCounter **)xrealloc(SysCounterList, + SysCounterList = (SyncCounter **)realloc(SysCounterList, (SyncNumSystemCounters+1)*sizeof(SyncCounter *)); if (!SysCounterList) - return (pointer)NULL; + return (void *)NULL; /* this function may be called before SYNC has been initialized, so we * have to make sure RTCounter is created. @@ -1070,7 +1055,7 @@ SyncCreateSystemCounter(name, initial, resolution, counterType, RTCounter = CreateNewResourceType(FreeCounter); if (RTCounter == 0) { - return (pointer)NULL; + return (void *)NULL; } } @@ -1080,11 +1065,11 @@ SyncCreateSystemCounter(name, initial, resolution, counterType, { SysCounterInfo *psci; - psci = (SysCounterInfo *)xalloc(sizeof(SysCounterInfo)); + psci = (SysCounterInfo *)malloc(sizeof(SysCounterInfo)); if (!psci) { FreeResource(pCounter->id, RT_NONE); - return (pointer) pCounter; + return (void *) pCounter; } pCounter->pSysCounterInfo = psci; psci->name = name; @@ -1096,12 +1081,12 @@ SyncCreateSystemCounter(name, initial, resolution, counterType, XSyncMinValue(&psci->bracket_less); SysCounterList[SyncNumSystemCounters++] = pCounter; } - return (pointer) pCounter; + return (void *) pCounter; } void SyncDestroySystemCounter(pSysCounter) - pointer pSysCounter; + void * pSysCounter; { SyncCounter *pCounter = (SyncCounter *)pSysCounter; FreeResource(pCounter->id, RT_NONE); @@ -1186,7 +1171,7 @@ SyncComputeBracketValues(pCounter, startOver) if (pnewgtval || pnewltval) { - (*psci->BracketValues)((pointer)pCounter, pnewltval, pnewgtval); + (*psci->BracketValues)((void *)pCounter, pnewltval, pnewgtval); } } @@ -1197,7 +1182,7 @@ SyncComputeBracketValues(pCounter, startOver) /* ARGSUSED */ static int FreeAlarm(addr, id) - pointer addr; + void *addr; XID id; { SyncAlarm *pAlarm = (SyncAlarm *) addr; @@ -1213,7 +1198,7 @@ FreeAlarm(addr, id) SyncDeleteTriggerFromCounter(&pAlarm->trigger); - xfree(pAlarm); + free(pAlarm); return Success; } @@ -1224,7 +1209,7 @@ FreeAlarm(addr, id) /* ARGSUSED */ static int FreeCounter(env, id) - pointer env; + void *env; XID id; { SyncCounter *pCounter = (SyncCounter *) env; @@ -1236,13 +1221,13 @@ FreeCounter(env, id) { (*ptl->pTrigger->CounterDestroyed)(ptl->pTrigger); pnext = ptl->next; - xfree(ptl); /* destroy the trigger list as we go */ + free(ptl); /* destroy the trigger list as we go */ } if (IsSystemCounter(pCounter)) { int i, found = 0; - xfree(pCounter->pSysCounterInfo); + free(pCounter->pSysCounterInfo); /* find the counter in the list of system counters and remove it */ @@ -1266,7 +1251,7 @@ FreeCounter(env, id) } SyncNumSystemCounters--; } - xfree(pCounter); + free(pCounter); return Success; } @@ -1276,7 +1261,7 @@ FreeCounter(env, id) /* ARGSUSED */ static int FreeAwait(addr, id) - pointer addr; + void *addr; XID id; { SyncAwaitUnion *pAwaitUnion = (SyncAwaitUnion *) addr; @@ -1297,14 +1282,14 @@ FreeAwait(addr, id) if (pCounter && !pCounter->beingDestroyed) SyncDeleteTriggerFromCounter(&pAwait->trigger); } - xfree(pAwaitUnion); + free(pAwaitUnion); return Success; } /* loosely based on dix/events.c/OtherClientGone */ static int FreeAlarmClient(value, id) - pointer value; /* must conform to DeleteType */ + void * value; /* must conform to DeleteType */ XID id; { SyncAlarm *pAlarm = (SyncAlarm *)value; @@ -1320,7 +1305,7 @@ FreeAlarmClient(value, id) pPrev->next = pCur->next; else pAlarm->pEventClients = pCur->next; - xfree(pCur); + free(pCur); return(Success); } } @@ -1342,21 +1327,21 @@ ProcSyncInitialize(client) ClientPtr client; { xSyncInitializeReply rep; - int n; REQUEST_SIZE_MATCH(xSyncInitializeReq); + memset(&rep, 0, sizeof(xSyncInitializeReply)); rep.type = X_Reply; rep.sequenceNumber = client->sequence; - rep.majorVersion = SYNC_MAJOR_VERSION; - rep.minorVersion = SYNC_MINOR_VERSION; + rep.majorVersion = SERVER_SYNC_MAJOR_VERSION; + rep.minorVersion = SERVER_SYNC_MINOR_VERSION; rep.length = 0; if (client->swapped) { - swaps(&rep.sequenceNumber, n); + swaps(&rep.sequenceNumber); } - WriteToClient(client, sizeof(rep), (char *) &rep); + WriteToClient(client, sizeof(rep), &rep); return (client->noClientException); } @@ -1386,7 +1371,7 @@ ProcSyncListSystemCounters(client) if (len) { - walklist = list = (xSyncSystemCounter *) ALLOCATE_LOCAL(len); + walklist = list = (xSyncSystemCounter *) malloc(len); if (!list) return BadAlloc; } @@ -1395,10 +1380,9 @@ ProcSyncListSystemCounters(client) if (client->swapped) { - register char n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.nCounters, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.nCounters); } for (i = 0; i < SyncNumSystemCounters; i++) @@ -1415,11 +1399,10 @@ ProcSyncListSystemCounters(client) if (client->swapped) { - register char n; - swapl(&walklist->counter, n); - swapl(&walklist->resolution_hi, n); - swapl(&walklist->resolution_lo, n); - swaps(&walklist->name_length, n); + swapl(&walklist->counter); + swapl(&walklist->resolution_hi); + swapl(&walklist->resolution_lo); + swaps(&walklist->name_length); } pname_in_reply = ((char *)walklist) + sz_xSyncSystemCounter; @@ -1428,11 +1411,11 @@ ProcSyncListSystemCounters(client) ((sz_xSyncSystemCounter + namelen + 3) & ~3)); } - WriteToClient(client, sizeof(rep), (char *) &rep); + WriteToClient(client, sizeof(rep), &rep); if (len) { - WriteToClient(client, len, (char *) list); - DEALLOCATE_LOCAL(list); + WriteToClient(client, len, list); + free(list); } return (client->noClientException); @@ -1500,12 +1483,11 @@ ProcSyncGetPriority(client) if (client->swapped) { - register char n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.priority, n); + swaps(&rep.sequenceNumber); + swapl(&rep.priority); } - WriteToClient(client, sizeof(xSyncGetPriorityReply), (char *) &rep); + WriteToClient(client, sizeof(xSyncGetPriorityReply), &rep); return (client->noClientException); } @@ -1545,7 +1527,7 @@ ProcSyncSetCounter(client) REQUEST_SIZE_MATCH(xSyncSetCounterReq); pCounter = (SyncCounter *)SecurityLookupIDByType(client, stuff->cid, - RTCounter, SecurityWriteAccess); + RTCounter, DixWriteAccess); if (pCounter == NULL) { client->errorValue = stuff->cid; @@ -1578,7 +1560,7 @@ ProcSyncChangeCounter(client) REQUEST_SIZE_MATCH(xSyncChangeCounterReq); pCounter = (SyncCounter *) SecurityLookupIDByType(client, stuff->cid, - RTCounter, SecurityWriteAccess); + RTCounter, DixWriteAccess); if (pCounter == NULL) { client->errorValue = stuff->cid; @@ -1616,7 +1598,7 @@ ProcSyncDestroyCounter(client) REQUEST_SIZE_MATCH(xSyncDestroyCounterReq); pCounter = (SyncCounter *)SecurityLookupIDByType(client, stuff->counter, - RTCounter, SecurityDestroyAccess); + RTCounter, DixDestroyAccess); if (pCounter == NULL) { client->errorValue = stuff->counter; @@ -1668,7 +1650,7 @@ ProcSyncAwait(client) /* all the memory for the entire await list is allocated * here in one chunk */ - pAwaitUnion = (SyncAwaitUnion *)xalloc((items+1) * sizeof(SyncAwaitUnion)); + pAwaitUnion = (SyncAwaitUnion *)malloc((items+1) * sizeof(SyncAwaitUnion)); if (!pAwaitUnion) return BadAlloc; @@ -1677,7 +1659,7 @@ ProcSyncAwait(client) pAwaitUnion->header.delete_id = FakeClientID(client->index); if (!AddResource(pAwaitUnion->header.delete_id, RTAwait, pAwaitUnion)) { - xfree(pAwaitUnion); + free(pAwaitUnion); return BadAlloc; } @@ -1762,7 +1744,7 @@ ProcSyncQueryCounter(client) REQUEST_SIZE_MATCH(xSyncQueryCounterReq); pCounter = (SyncCounter *)SecurityLookupIDByType(client, stuff->counter, - RTCounter, SecurityReadAccess); + RTCounter, DixReadAccess); if (pCounter == NULL) { client->errorValue = stuff->counter; @@ -1777,7 +1759,7 @@ ProcSyncQueryCounter(client) if (IsSystemCounter(pCounter)) { - (*pCounter->pSysCounterInfo->QueryValue) ((pointer) pCounter, + (*pCounter->pSysCounterInfo->QueryValue) ((void *) pCounter, &pCounter->value); } @@ -1785,13 +1767,12 @@ ProcSyncQueryCounter(client) rep.value_lo = XSyncValueLow32(pCounter->value); if (client->swapped) { - register char n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.value_hi, n); - swapl(&rep.value_lo, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.value_hi); + swapl(&rep.value_lo); } - WriteToClient(client, sizeof(xSyncQueryCounterReply), (char *) &rep); + WriteToClient(client, sizeof(xSyncQueryCounterReply), &rep); return (client->noClientException); } @@ -1819,7 +1800,7 @@ ProcSyncCreateAlarm(client) if (len != (Ones(vmask) + Ones(vmask & (XSyncCAValue|XSyncCADelta)))) return BadLength; - if (!(pAlarm = (SyncAlarm *) xalloc(sizeof(SyncAlarm)))) + if (!(pAlarm = (SyncAlarm *) malloc(sizeof(SyncAlarm)))) { return BadAlloc; } @@ -1836,7 +1817,7 @@ ProcSyncCreateAlarm(client) status = SyncInitTrigger(client, pTrigger, None, XSyncCAAllTrigger); if (status != Success) { - xfree(pAlarm); + free(pAlarm); return status; } @@ -1850,13 +1831,13 @@ ProcSyncCreateAlarm(client) (CARD32 *)&stuff[1]); if (status != Success) { - xfree(pAlarm); + free(pAlarm); return status; } if (!AddResource(stuff->id, RTAlarm, pAlarm)) { - xfree(pAlarm); + free(pAlarm); return BadAlloc; } @@ -1891,7 +1872,7 @@ ProcSyncChangeAlarm(client) REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq); if (!(pAlarm = (SyncAlarm *)SecurityLookupIDByType(client, stuff->alarm, - RTAlarm, SecurityWriteAccess))) + RTAlarm, DixWriteAccess))) { client->errorValue = stuff->alarm; return SyncErrorBase + XSyncBadAlarm; @@ -1932,7 +1913,7 @@ ProcSyncQueryAlarm(client) REQUEST_SIZE_MATCH(xSyncQueryAlarmReq); pAlarm = (SyncAlarm *)SecurityLookupIDByType(client, stuff->alarm, - RTAlarm, SecurityReadAccess); + RTAlarm, DixReadAccess); if (!pAlarm) { client->errorValue = stuff->alarm; @@ -1967,18 +1948,17 @@ ProcSyncQueryAlarm(client) if (client->swapped) { - register char n; - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.counter, n); - swapl(&rep.wait_value_hi, n); - swapl(&rep.wait_value_lo, n); - swapl(&rep.test_type, n); - swapl(&rep.delta_hi, n); - swapl(&rep.delta_lo, n); + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.counter); + swapl(&rep.wait_value_hi); + swapl(&rep.wait_value_lo); + swapl(&rep.test_type); + swapl(&rep.delta_hi); + swapl(&rep.delta_lo); } - WriteToClient(client, sizeof(xSyncQueryAlarmReply), (char *) &rep); + WriteToClient(client, sizeof(xSyncQueryAlarmReply), &rep); return (client->noClientException); } @@ -1992,7 +1972,7 @@ ProcSyncDestroyAlarm(client) REQUEST_SIZE_MATCH(xSyncDestroyAlarmReq); if (!((SyncAlarm *)SecurityLookupIDByType(client, stuff->alarm, - RTAlarm, SecurityDestroyAccess))) + RTAlarm, DixDestroyAccess))) { client->errorValue = stuff->alarm; return SyncErrorBase + XSyncBadAlarm; @@ -2056,9 +2036,8 @@ SProcSyncInitialize(client) ClientPtr client; { REQUEST(xSyncInitializeReq); - register char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncInitializeReq); return ProcSyncInitialize(client); @@ -2069,9 +2048,8 @@ SProcSyncListSystemCounters(client) ClientPtr client; { REQUEST(xSyncListSystemCountersReq); - register char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncListSystemCountersReq); return ProcSyncListSystemCounters(client); @@ -2082,13 +2060,12 @@ SProcSyncCreateCounter(client) ClientPtr client; { REQUEST(xSyncCreateCounterReq); - register char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncCreateCounterReq); - swapl(&stuff->cid, n); - swapl(&stuff->initial_value_lo, n); - swapl(&stuff->initial_value_hi, n); + swapl(&stuff->cid); + swapl(&stuff->initial_value_lo); + swapl(&stuff->initial_value_hi); return ProcSyncCreateCounter(client); } @@ -2098,13 +2075,12 @@ SProcSyncSetCounter(client) ClientPtr client; { REQUEST(xSyncSetCounterReq); - register char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncSetCounterReq); - swapl(&stuff->cid, n); - swapl(&stuff->value_lo, n); - swapl(&stuff->value_hi, n); + swapl(&stuff->cid); + swapl(&stuff->value_lo); + swapl(&stuff->value_hi); return ProcSyncSetCounter(client); } @@ -2114,13 +2090,12 @@ SProcSyncChangeCounter(client) ClientPtr client; { REQUEST(xSyncChangeCounterReq); - register char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncChangeCounterReq); - swapl(&stuff->cid, n); - swapl(&stuff->value_lo, n); - swapl(&stuff->value_hi, n); + swapl(&stuff->cid); + swapl(&stuff->value_lo); + swapl(&stuff->value_hi); return ProcSyncChangeCounter(client); } @@ -2130,11 +2105,10 @@ SProcSyncQueryCounter(client) ClientPtr client; { REQUEST(xSyncQueryCounterReq); - register char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncQueryCounterReq); - swapl(&stuff->counter, n); + swapl(&stuff->counter); return ProcSyncQueryCounter(client); } @@ -2144,11 +2118,10 @@ SProcSyncDestroyCounter(client) ClientPtr client; { REQUEST(xSyncDestroyCounterReq); - register char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncDestroyCounterReq); - swapl(&stuff->counter, n); + swapl(&stuff->counter); return ProcSyncDestroyCounter(client); } @@ -2158,9 +2131,8 @@ SProcSyncAwait(client) ClientPtr client; { REQUEST(xSyncAwaitReq); - register char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSyncAwaitReq); SwapRestL(stuff); @@ -2173,12 +2145,11 @@ SProcSyncCreateAlarm(client) ClientPtr client; { REQUEST(xSyncCreateAlarmReq); - register char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSyncCreateAlarmReq); - swapl(&stuff->id, n); - swapl(&stuff->valueMask, n); + swapl(&stuff->id); + swapl(&stuff->valueMask); SwapRestL(stuff); return ProcSyncCreateAlarm(client); @@ -2189,12 +2160,11 @@ SProcSyncChangeAlarm(client) ClientPtr client; { REQUEST(xSyncChangeAlarmReq); - register char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_AT_LEAST_SIZE(xSyncChangeAlarmReq); - swapl(&stuff->alarm, n); - swapl(&stuff->valueMask, n); + swapl(&stuff->alarm); + swapl(&stuff->valueMask); SwapRestL(stuff); return ProcSyncChangeAlarm(client); } @@ -2204,11 +2174,10 @@ SProcSyncQueryAlarm(client) ClientPtr client; { REQUEST(xSyncQueryAlarmReq); - register char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncQueryAlarmReq); - swapl(&stuff->alarm, n); + swapl(&stuff->alarm); return ProcSyncQueryAlarm(client); } @@ -2218,11 +2187,10 @@ SProcSyncDestroyAlarm(client) ClientPtr client; { REQUEST(xSyncDestroyAlarmReq); - register char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncDestroyAlarmReq); - swapl(&stuff->alarm, n); + swapl(&stuff->alarm); return ProcSyncDestroyAlarm(client); } @@ -2232,12 +2200,11 @@ SProcSyncSetPriority(client) ClientPtr client; { REQUEST(xSyncSetPriorityReq); - register char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncSetPriorityReq); - swapl(&stuff->id, n); - swapl(&stuff->priority, n); + swapl(&stuff->id); + swapl(&stuff->priority); return ProcSyncSetPriority(client); } @@ -2247,11 +2214,10 @@ SProcSyncGetPriority(client) ClientPtr client; { REQUEST(xSyncGetPriorityReq); - register char n; - swaps(&stuff->length, n); + swaps(&stuff->length); REQUEST_SIZE_MATCH (xSyncGetPriorityReq); - swapl(&stuff->id, n); + swapl(&stuff->id); return ProcSyncGetPriority(client); } @@ -2344,7 +2310,7 @@ static void SyncResetProc(extEntry) ExtensionEntry *extEntry; { - xfree(SysCounterList); + free(SysCounterList); SysCounterList = NULL; RTCounter = 0; } @@ -2354,7 +2320,7 @@ SyncResetProc(extEntry) * ** Initialise the extension. */ void -SyncExtensionInit(INITARGS) +SyncExtensionInit(void) { ExtensionEntry *extEntry; @@ -2405,7 +2371,7 @@ SyncExtensionInit(INITARGS) -static pointer ServertimeCounter; +static void * ServertimeCounter; static XSyncValue Now; static XSyncValue *pnext_time; @@ -2423,9 +2389,9 @@ static XSyncValue *pnext_time; */ /*ARGSUSED*/ static void ServertimeBlockHandler(env, wt, LastSelectMask) -pointer env; +void * env; struct timeval **wt; -pointer LastSelectMask; +void * LastSelectMask; { XSyncValue delay; unsigned long timeout; @@ -2454,9 +2420,9 @@ pointer LastSelectMask; */ /*ARGSUSED*/ static void ServertimeWakeupHandler(env, rc, LastSelectMask) -pointer env; +void * env; int rc; -pointer LastSelectMask; +void * LastSelectMask; { if (pnext_time) { @@ -2471,7 +2437,7 @@ pointer LastSelectMask; static void ServertimeQueryValue(pCounter, pValue_return) - pointer pCounter; + void * pCounter; CARD64 *pValue_return; { GetTime(); @@ -2480,7 +2446,7 @@ ServertimeQueryValue(pCounter, pValue_return) static void ServertimeBracketValues(pCounter, pbracket_less, pbracket_greater) - pointer pCounter; + void * pCounter; CARD64 *pbracket_less; CARD64 *pbracket_greater; { |
