diff options
Diffstat (limited to 'xorg-server/Xext/sync.c')
-rw-r--r-- | xorg-server/Xext/sync.c | 119 |
1 files changed, 59 insertions, 60 deletions
diff --git a/xorg-server/Xext/sync.c b/xorg-server/Xext/sync.c index 97c9d5183..7129e9833 100644 --- a/xorg-server/Xext/sync.c +++ b/xorg-server/Xext/sync.c @@ -437,16 +437,9 @@ SyncSendAlarmNotifyEvents(SyncAlarm * pAlarm) UpdateCurrentTime(); - ane = (xSyncAlarmNotifyEvent) { - .type = SyncEventBase + XSyncAlarmNotify, - .kind = XSyncAlarmNotify, - .alarm = pAlarm->alarm_id, - .alarm_value_hi = XSyncValueHigh32(pTrigger->test_value), - .alarm_value_lo = XSyncValueLow32(pTrigger->test_value), - .time = currentTime.milliseconds, - .state = pAlarm->state - }; - + ane.type = SyncEventBase + XSyncAlarmNotify; + ane.kind = XSyncAlarmNotify; + ane.alarm = pAlarm->alarm_id; if (pTrigger->pSync && SYNC_COUNTER == pTrigger->pSync->type) { ane.counter_value_hi = XSyncValueHigh32(pCounter->value); ane.counter_value_lo = XSyncValueLow32(pCounter->value); @@ -456,6 +449,11 @@ SyncSendAlarmNotifyEvents(SyncAlarm * pAlarm) ane.counter_value_hi = ane.counter_value_lo = 0; } + ane.alarm_value_hi = XSyncValueHigh32(pTrigger->test_value); + ane.alarm_value_lo = XSyncValueLow32(pTrigger->test_value); + ane.time = currentTime.milliseconds; + ane.state = pAlarm->state; + /* send to owner */ if (pAlarm->events) WriteEventsToClient(pAlarm->client, 1, (xEvent *) &ane); @@ -1206,6 +1204,10 @@ FreeAwait(void *addr, XID id) return Success; } +#ifdef _MSC_VER +#pragma warning(disable:4715) /* Not all control paths return a value */ +#endif + /* loosely based on dix/events.c/OtherClientGone */ static int FreeAlarmClient(void *value, XID id) @@ -1237,16 +1239,17 @@ FreeAlarmClient(void *value, XID id) static int ProcSyncInitialize(ClientPtr client) { - xSyncInitializeReply rep = { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .majorVersion = SERVER_SYNC_MAJOR_VERSION, - .minorVersion = SERVER_SYNC_MINOR_VERSION, - }; + xSyncInitializeReply rep; REQUEST_SIZE_MATCH(xSyncInitializeReq); + memset(&rep, 0, sizeof(xSyncInitializeReply)); + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.majorVersion = SERVER_SYNC_MAJOR_VERSION; + rep.minorVersion = SERVER_SYNC_MINOR_VERSION; + rep.length = 0; + if (client->swapped) { swaps(&rep.sequenceNumber); } @@ -1260,17 +1263,17 @@ ProcSyncInitialize(ClientPtr client) static int ProcSyncListSystemCounters(ClientPtr client) { - xSyncListSystemCountersReply rep = { - .type = X_Reply, - .sequenceNumber = client->sequence, - .nCounters = 0, - }; - SysCounterInfo *psci; + xSyncListSystemCountersReply rep; + SysCounterInfo *psci=NULL; int len = 0; xSyncSystemCounter *list = NULL, *walklist = NULL; REQUEST_SIZE_MATCH(xSyncListSystemCountersReq); + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.nCounters = 0; + xorg_list_for_each_entry(psci, &SysCounterList, entry) { /* pad to 4 byte boundary */ len += pad_to_int32(sz_xSyncSystemCounter + strlen(psci->name)); @@ -1380,12 +1383,11 @@ ProcSyncGetPriority(ClientPtr client) return rc; } - rep = (xSyncGetPriorityReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .priority = priorityclient->priority - }; + + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.priority = priorityclient->priority; if (client->swapped) { swaps(&rep.sequenceNumber); @@ -1665,13 +1667,12 @@ ProcSyncQueryCounter(ClientPtr client) &pCounter->value); } - rep = (xSyncQueryCounterReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .value_hi = XSyncValueHigh32(pCounter->value), - .value_lo = XSyncValueLow32(pCounter->value) - }; + + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.value_hi = XSyncValueHigh32(pCounter->value); + rep.value_lo = XSyncValueLow32(pCounter->value); if (client->swapped) { swaps(&rep.sequenceNumber); @@ -1827,32 +1828,31 @@ ProcSyncQueryAlarm(ClientPtr client) return rc; pTrigger = &pAlarm->trigger; - rep = (xSyncQueryAlarmReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = - bytes_to_int32(sizeof(xSyncQueryAlarmReply) - sizeof(xGenericReply)), - .counter = (pTrigger->pSync) ? pTrigger->pSync->id : None, + + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.length = + bytes_to_int32(sizeof(xSyncQueryAlarmReply) - sizeof(xGenericReply)); + rep.counter = (pTrigger->pSync) ? pTrigger->pSync->id : None; #if 0 /* XXX unclear what to do, depends on whether relative value-types * are "consumed" immediately and are considered absolute from then * on. */ - .value_type = pTrigger->value_type, - .wait_value_hi = XSyncValueHigh32(pTrigger->wait_value), - .wait_value_lo = XSyncValueLow32(pTrigger->wait_value), + rep.value_type = pTrigger->value_type; + rep.wait_value_hi = XSyncValueHigh32(pTrigger->wait_value); + rep.wait_value_lo = XSyncValueLow32(pTrigger->wait_value); #else - .value_type = XSyncAbsolute, - .wait_value_hi = XSyncValueHigh32(pTrigger->test_value), - .wait_value_lo = XSyncValueLow32(pTrigger->test_value), + rep.value_type = XSyncAbsolute; + rep.wait_value_hi = XSyncValueHigh32(pTrigger->test_value); + rep.wait_value_lo = XSyncValueLow32(pTrigger->test_value); #endif - .test_type = pTrigger->test_type, - .delta_hi = XSyncValueHigh32(pAlarm->delta), - .delta_lo = XSyncValueLow32(pAlarm->delta), - .events = pAlarm->events, - .state = pAlarm->state - }; + rep.test_type = pTrigger->test_type; + rep.delta_hi = XSyncValueHigh32(pAlarm->delta); + rep.delta_lo = XSyncValueLow32(pAlarm->delta); + rep.events = pAlarm->events; + rep.state = pAlarm->state; if (client->swapped) { swaps(&rep.sequenceNumber); @@ -2011,13 +2011,12 @@ ProcSyncQueryFence(ClientPtr client) if (rc != Success) return rc; - rep = (xSyncQueryFenceReply) { - .type = X_Reply, - .sequenceNumber = client->sequence, - .length = 0, - .triggered = pFence->funcs.CheckTriggered(pFence) - }; + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.length = 0; + + rep.triggered = pFence->funcs.CheckTriggered(pFence); if (client->swapped) { swaps(&rep.sequenceNumber); |