summaryrefslogtreecommitdiff
path: root/miext
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2017-09-18 17:34:32 -0700
committerAdam Jackson <ajax@redhat.com>2017-09-20 13:19:27 -0400
commite0f872207aa203adb85e825c311ed50fe3a3af60 (patch)
treed466866edb5b8aa8ec96f06acc27c27499411bd3 /miext
parent5cbfa276541e6a621cf9c4b44b75323e90a5bd4c (diff)
sync: Convert from "CARD64" to int64_t.
The extension was using the name CARD64 to represent 64-bit values, with a #define from CARD64 to XSyncValue, a struct with a pair of 32-bit values representing a signed 64-bit value. This interfered with protocol headers using CARD64 to try to actually store a uint64_t. Now that stdint.h exists, let's just use that here, instead. v2: Fix alarm delta changes. v3: Do the potentially overflowing math as uint and convert to int afterward, out of C spec paranoia. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'miext')
-rw-r--r--miext/sync/misync.c5
-rw-r--r--miext/sync/misyncstr.h11
2 files changed, 6 insertions, 10 deletions
diff --git a/miext/sync/misync.c b/miext/sync/misync.c
index 3d03d1b59..490fa0b17 100644
--- a/miext/sync/misync.c
+++ b/miext/sync/misync.c
@@ -127,16 +127,13 @@ void
miSyncTriggerFence(SyncFence * pFence)
{
SyncTriggerList *ptl, *pNext;
- CARD64 unused;
pFence->funcs.SetTriggered(pFence);
- XSyncIntToValue(&unused, 0L);
-
/* run through triggers to see if any fired */
for (ptl = pFence->sync.pTriglist; ptl; ptl = pNext) {
pNext = ptl->next;
- if ((*ptl->pTrigger->CheckTrigger) (ptl->pTrigger, unused))
+ if ((*ptl->pTrigger->CheckTrigger) (ptl->pTrigger, 0))
(*ptl->pTrigger->TriggerFired) (ptl->pTrigger);
}
}
diff --git a/miext/sync/misyncstr.h b/miext/sync/misyncstr.h
index ad69e8eca..084ca4c82 100644
--- a/miext/sync/misyncstr.h
+++ b/miext/sync/misyncstr.h
@@ -28,13 +28,12 @@
#ifndef _MISYNCSTR_H_
#define _MISYNCSTR_H_
+#include <stdint.h>
#include "dix.h"
#include "misync.h"
#include "scrnintstr.h"
#include <X11/extensions/syncconst.h>
-#define CARD64 XSyncValue /* XXX temporary! need real 64 bit values for Alpha */
-
/* Sync object types */
#define SYNC_COUNTER 0
#define SYNC_FENCE 1
@@ -49,7 +48,7 @@ typedef struct _SyncObject {
typedef struct _SyncCounter {
SyncObject sync; /* Common sync object data */
- CARD64 value; /* counter value */
+ int64_t value; /* counter value */
struct _SysCounterInfo *pSysCounterInfo; /* NULL if not a system counter */
} SyncCounter;
@@ -63,12 +62,12 @@ struct _SyncFence {
struct _SyncTrigger {
SyncObject *pSync;
- CARD64 wait_value; /* wait value */
+ int64_t wait_value; /* wait value */
unsigned int value_type; /* Absolute or Relative */
unsigned int test_type; /* transition or Comparision type */
- CARD64 test_value; /* trigger event threshold value */
+ int64_t test_value; /* trigger event threshold value */
Bool (*CheckTrigger) (struct _SyncTrigger * /*pTrigger */ ,
- CARD64 /*newval */
+ int64_t /*newval */
);
void (*TriggerFired) (struct _SyncTrigger * /*pTrigger */
);