xprint: Changes to 'debian-unstable'
debian/changelog | 29
debian/control | 9
debian/patches/94_Xext_proto | 3088 +++++++++++++++++++++++++++++++++++++++++++
debian/patches/series | 1
debian/rules | 1
5 files changed, 3121 insertions(+), 7 deletions(-)
New commits:
commit bed2f1b0d7f14256d62460d91f12ba258eef7523
Author: Drew Parsons <dparsons@debian.org>
Date: Mon Feb 15 02:28:29 2010 +1100
upload 1.6.0-4 to unstable
diff --git a/debian/changelog b/debian/changelog
index f628524..c3a50a6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-xprint (2:1.6.0-4) UNRELEASED; urgency=low
+xprint (2:1.6.0-4) unstable; urgency=low
[ Julien Cristau ]
* Set Uploaders to Drew.
@@ -27,7 +27,7 @@ xprint (2:1.6.0-4) UNRELEASED; urgency=low
* Update x11proto Build-Depends to match configure.ac requirements in
patch 94_Xext_proto.
- -- Drew Parsons <dparsons@debian.org> Mon, 15 Feb 2010 02:24:44 +1100
+ -- Drew Parsons <dparsons@debian.org> Mon, 15 Feb 2010 02:28:13 +1100
xprint (2:1.6.0-3) unstable; urgency=low
commit 138ff98547b36c9b9e03570534d84890d5b2b1a1
Author: Drew Parsons <dparsons@debian.org>
Date: Mon Feb 15 02:26:48 2010 +1100
patch 94_Xext_proto enables build against latest x11proto-*-dev
* patch 94_Xext_proto: deal with various Xext build errors:
- #include panoramiXproto.h not panoramiXext.h
(cf. xorg-xserver commit a38ca0063c91ef221f20bf0c4ac0dc84ce07d557)
- patch 94_Xext_proto: other assorted XEXT proto updates for
xextproto 7.0.99.1 adapted from xorg-xserver commit
d3f6b43a240eb763025b3cbf546cb7ae502c94fa.
- Xext/syncsrv.h and sync.c taken wholesale from current
xorg-xserver (uses byte functions, taken from xorg-server commit
912402fd71144bcee255141efe12a78abad39240)
- dbe/dbestruct.h from xorg-xserver commit
bb6fa39eb3aa044ffc18632288fd59909ff06344
- mi/miinitext.c, include xtestconst.h not xtest.h
(cf. xorg-server commit 20daa145c437c3ba67970146f6182849f87a1b43)
- new sync.c uses dixLookupResourceByType, get it from xorg-server
commit 1addf6fe235f8537024140aff56dffb4738701a7
* Update x11proto Build-Depends to match configure.ac requirements in
patch 94_Xext_proto.
diff --git a/debian/changelog b/debian/changelog
index a295660..f628524 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,8 +9,25 @@ xprint (2:1.6.0-4) UNRELEASED; urgency=low
removed from Debian. XEvIE intercepted mouse and keyboard events,
it never really was relevant to xprint anyway. Closes: #567114.
* Standards-Version: 3.8.4.
-
- -- Drew Parsons <dparsons@debian.org> Sun, 14 Feb 2010 22:39:35 +1100
+ * patch 94_Xext_proto: deal with various Xext build errors:
+ - #include panoramiXproto.h not panoramiXext.h
+ (cf. xorg-xserver commit a38ca0063c91ef221f20bf0c4ac0dc84ce07d557)
+ - patch 94_Xext_proto: other assorted XEXT proto updates for
+ xextproto 7.0.99.1 adapted from xorg-xserver commit
+ d3f6b43a240eb763025b3cbf546cb7ae502c94fa.
+ - Xext/syncsrv.h and sync.c taken wholesale from current
+ xorg-xserver (uses byte functions, taken from xorg-server commit
+ 912402fd71144bcee255141efe12a78abad39240)
+ - dbe/dbestruct.h from xorg-xserver commit
+ bb6fa39eb3aa044ffc18632288fd59909ff06344
+ - mi/miinitext.c, include xtestconst.h not xtest.h
+ (cf. xorg-server commit 20daa145c437c3ba67970146f6182849f87a1b43)
+ - new sync.c uses dixLookupResourceByType, get it from xorg-server
+ commit 1addf6fe235f8537024140aff56dffb4738701a7
+ * Update x11proto Build-Depends to match configure.ac requirements in
+ patch 94_Xext_proto.
+
+ -- Drew Parsons <dparsons@debian.org> Mon, 15 Feb 2010 02:24:44 +1100
xprint (2:1.6.0-3) unstable; urgency=low
diff --git a/debian/control b/debian/control
index f2316a0..8cdbc2a 100644
--- a/debian/control
+++ b/debian/control
@@ -28,18 +28,18 @@ Build-Depends:
x11proto-xinerama-dev,
x11proto-randr-dev (>= 1.2.99.3),
x11proto-record-dev,
- x11proto-render-dev (>= 2:0.9.3),
+ x11proto-render-dev (>= 2:0.11),
x11proto-resource-dev,
x11proto-scrnsaver-dev,
x11proto-video-dev,
x11proto-xcmisc-dev,
- x11proto-xext-dev (>= 7.0.3),
+ x11proto-xext-dev (>= 7.0.99.1),
x11proto-xf86bigfont-dev,
x11proto-xf86dga-dev,
x11proto-xf86vidmode-dev,
xtrans-dev (>= 1.2.2),
libxau-dev (>= 1:0.99.1),
- x11proto-input-dev (>= 1.5),
+ x11proto-input-dev (>= 1.9.99.14),
x11proto-dri2-dev (>= 2.1),
libxdmcp-dev (>= 1:0.99.1),
libxfontp-dev,
diff --git a/debian/patches/94_Xext_proto b/debian/patches/94_Xext_proto
new file mode 100644
index 0000000..0a2c8ed
--- /dev/null
+++ b/debian/patches/94_Xext_proto
@@ -0,0 +1,3088 @@
+Index: xprint/Xext/panoramiX.h
+===================================================================
+--- xprint.orig/Xext/panoramiX.h 2010-02-15 02:01:32.000000000 +1100
++++ xprint/Xext/panoramiX.h 2010-02-15 02:08:39.000000000 +1100
+@@ -40,7 +40,7 @@
+ #ifndef _PANORAMIX_H_
+ #define _PANORAMIX_H_
+
+-#include <X11/extensions/panoramiXext.h>
++#include <X11/extensions/panoramiXproto.h>
+ #include "gcstruct.h"
+
+
+Index: xprint/Xext/dpms.c
+===================================================================
+--- xprint.orig/Xext/dpms.c 2010-02-15 02:01:32.000000000 +1100
++++ xprint/Xext/dpms.c 2010-02-15 02:08:39.000000000 +1100
+@@ -44,9 +44,7 @@
+ #include "dixstruct.h"
+ #include "extnsionst.h"
+ #include "opaque.h"
+-#define DPMS_SERVER
+-#include <X11/extensions/dpms.h>
+-#include <X11/extensions/dpmsstr.h>
++#include <X11/extensions/dpmsproto.h>
+ #include "dpmsproc.h"
+ #include "modinit.h"
+
+Index: xprint/Xext/saver.c
+===================================================================
+--- xprint.orig/Xext/saver.c 2010-02-15 02:01:32.000000000 +1100
++++ xprint/Xext/saver.c 2010-02-15 02:08:39.000000000 +1100
+@@ -54,8 +54,7 @@
+ #include "panoramiXsrv.h"
+ #endif
+ #ifdef DPMSExtension
+-#define DPMS_SERVER
+-#include <X11/extensions/dpms.h>
++#include <X11/extensions/dpmsconst.h>
+ #endif
+
+ #include <stdio.h>
+@@ -1064,7 +1063,7 @@
+ }
+ else
+ {
+- ret = dixLookupResource((pointer *)&pPixmap, pixID, RT_PIXMAP,
++ ret = dixLookupResourceByType((pointer *)&pPixmap, pixID, RT_PIXMAP,
+ client, DixReadAccess);
+ if (ret == Success)
+ {
+@@ -1102,7 +1101,7 @@
+ }
+ else
+ {
+- ret = dixLookupResource((pointer *)&pPixmap, pixID, RT_PIXMAP,
++ ret = dixLookupResourceByType((pointer *)&pPixmap, pixID, RT_PIXMAP,
+ client, DixReadAccess);
+ if (ret == Success)
+ {
+@@ -1196,7 +1195,7 @@
+ break;
+ case CWColormap:
+ cmap = (Colormap) *pVlist;
+- ret = dixLookupResource((pointer *)&pCmap, cmap, RT_COLORMAP,
++ ret = dixLookupResourceByType((pointer *)&pCmap, cmap, RT_COLORMAP,
+ client, DixUseAccess);
+ if (ret != Success)
+ {
+@@ -1220,7 +1219,7 @@
+ }
+ else
+ {
+- ret = dixLookupResource((pointer *)&pCursor, cursorID,
++ ret = dixLookupResourceByType((pointer *)&pCursor, cursorID,
+ RT_CURSOR, client, DixUseAccess);
+ if (ret != Success)
+ {
+Index: xprint/Xext/shape.c
+===================================================================
+--- xprint.orig/Xext/shape.c 2010-02-15 02:01:32.000000000 +1100
++++ xprint/Xext/shape.c 2010-02-15 02:08:39.000000000 +1100
+@@ -43,8 +43,7 @@
+ #include "dixstruct.h"
+ #include "resource.h"
+ #include "opaque.h"
+-#define _SHAPE_SERVER_ /* don't want Xlib structures */
+-#include <X11/extensions/shapestr.h>
++#include <X11/extensions/shapeproto.h>
+ #include "regionstr.h"
+ #include "gcstruct.h"
+ #include "modinit.h"
+@@ -438,7 +437,7 @@
+ if (stuff->src == None)
+ srcRgn = 0;
+ else {
+- rc = dixLookupResource((pointer *)&pPixmap, stuff->src, RT_PIXMAP,
++ rc = dixLookupResourceByType((pointer *)&pPixmap, stuff->src, RT_PIXMAP,
+ client, DixReadAccess);
+ if (rc != Success)
+ return (rc == BadValue) ? BadPixmap : rc;
+Index: xprint/Xext/shm.c
+===================================================================
+--- xprint.orig/Xext/shm.c 2010-02-15 02:01:32.000000000 +1100
++++ xprint/Xext/shm.c 2010-02-15 02:08:39.000000000 +1100
+@@ -59,8 +59,7 @@
+ #include "servermd.h"
+ #include "shmint.h"
+ #include "xace.h"
+-#define _XSHM_SERVER_
+-#include <X11/extensions/shmstr.h>
++#include <X11/extensions/shmproto.h>
+ #include <X11/Xfuncproto.h>
+
+ /* Needed for Solaris cross-zone shared memory extension */
+Index: xprint/Xext/shmint.h
+===================================================================
+--- xprint.orig/Xext/shmint.h 2010-02-15 02:01:32.000000000 +1100
++++ xprint/Xext/shmint.h 2010-02-15 02:08:39.000000000 +1100
+@@ -24,12 +24,39 @@
+ #define _SHMINT_H_
+
+ #define _XSHM_SERVER_
+-#include <X11/extensions/shmstr.h>
++#include <X11/extensions/shmproto.h>
+
+ #include "screenint.h"
+ #include "pixmap.h"
+ #include "gc.h"
+
++#define XSHM_PUT_IMAGE_ARGS \
++ DrawablePtr /* dst */, \
++ GCPtr /* pGC */, \
++ int /* depth */, \
++ unsigned int /* format */, \
++ int /* w */, \
++ int /* h */, \
++ int /* sx */, \
++ int /* sy */, \
++ int /* sw */, \
++ int /* sh */, \
++ int /* dx */, \
++ int /* dy */, \
++ char * /* data */
++
++#define XSHM_CREATE_PIXMAP_ARGS \
++ ScreenPtr /* pScreen */, \
++ int /* width */, \
++ int /* height */, \
++ int /* depth */, \
++ char * /* addr */
++
++typedef struct _ShmFuncs {
++ PixmapPtr (* CreatePixmap)(XSHM_CREATE_PIXMAP_ARGS);
++ void (* PutImage)(XSHM_PUT_IMAGE_ARGS);
++} ShmFuncs, *ShmFuncsPtr;
++
+ void
+ ShmRegisterFuncs(ScreenPtr pScreen, ShmFuncsPtr funcs);
+
+Index: xprint/Xext/sync.c
+===================================================================
+--- xprint.orig/Xext/sync.c 2010-02-15 02:01:32.000000000 +1100
++++ xprint/Xext/sync.c 2010-02-15 02:08:39.000000000 +1100
+@@ -34,7 +34,7 @@
+ documentation for any purpose and without fee is hereby granted,
+ provided that the above copyright notice appear in all copies and that
+ both that copyright notice and this permission notice appear in
+-supporting documentation, and that the names of Digital or Olivetti
++supporting documentation, and that the names of Digital or Olivetti
+ not be used in advertising or publicity pertaining to distribution of the
+ software without specific, written prior permission. Digital and Olivetti
+ make no representations about the suitability of this software
+@@ -50,8 +50,6 @@
+
+ */
+
+-#define NEED_REPLIES
+-#define NEED_EVENTS
+ #ifdef HAVE_DIX_CONFIG_H
+ #include <dix-config.h>
+ #endif
+@@ -67,12 +65,11 @@
+ #include "dixstruct.h"
+ #include "resource.h"
+ #include "opaque.h"
+-#define _SYNC_SERVER
+-#include <X11/extensions/sync.h>
+-#include <X11/extensions/syncstr.h>
++#include <X11/extensions/syncproto.h>
++#include "syncsrv.h"
+
+ #include <stdio.h>
+-#if !defined(WIN32) && !defined(Lynx)
++#if !defined(WIN32)
+ #include <sys/time.h>
+ #endif
+
+@@ -97,173 +94,11 @@
+ #define XSyncCAAllTrigger \
+ (XSyncCACounter | XSyncCAValueType | XSyncCAValue | XSyncCATestType)
+
+-static int
+-FreeAlarm(
+- pointer /* addr */,
+- XID /* id */
+-);
+-
+-static int
+-FreeAlarmClient(
+- pointer /* value */,
+- XID /* id */
+-);
+-
+-static int
+-FreeAwait(
+- pointer /* addr */,
+- XID /* id */
+-);
+-
+-static void
+-ServertimeBracketValues(
+- pointer /* pCounter */,
+- CARD64 * /* pbracket_less */,
+- CARD64 * /* pbracket_greater */
+-);
++static void SyncComputeBracketValues(SyncCounter *, Bool);
+
+-static void
+-ServertimeQueryValue(
+- pointer /* pCounter */,
+- CARD64 * /* pValue_return */
+-);
+-
+-static void
+-ServertimeWakeupHandler(
+- pointer /* env */,
+- int /* rc */,
+- pointer /* LastSelectMask */
+-);
+-
+-static int
+-SyncInitTrigger(
+- ClientPtr /* client */,
+- SyncTrigger * /* pTrigger */,
+- XSyncCounter /* counter */,
+- Mask /* changes */
+-);
++static void SyncInitServerTime(void);
+
+-static void
+-SAlarmNotifyEvent(
+- xSyncAlarmNotifyEvent * /* from */,
+- xSyncAlarmNotifyEvent * /* to */
+-);
+-
+-static void
+-SCounterNotifyEvent(
+- xSyncCounterNotifyEvent * /* from */,
+- xSyncCounterNotifyEvent * /* to */
+-);
+-
+-static void
+-ServertimeBlockHandler(
+- pointer /* env */,
+- struct timeval ** /* wt */,
+- pointer /* LastSelectMask */
+-);
+-
+-static int
+-SyncAddTriggerToCounter(
+- SyncTrigger * /* pTrigger */
+-);
+-
+-extern void
+-SyncAlarmCounterDestroyed(
+- SyncTrigger * /* pTrigger */
+-);
+-
+-static void
+-SyncAlarmTriggerFired(
+- SyncTrigger * /* pTrigger */
+-);
+-
+-static void
+-SyncAwaitTriggerFired(
+- SyncTrigger * /* pTrigger */
+-);
+-
+-static int
+-SyncChangeAlarmAttributes(
+- ClientPtr /* client */,
+- SyncAlarm * /* pAlarm */,
+- Mask /* mask */,
+- CARD32 * /* values */
+-);
+-
+-static Bool
+-SyncCheckTriggerNegativeComparison(
+- SyncTrigger * /* pTrigger */,
+- CARD64 /* oldval */
+-);
+-
+-static Bool
+-SyncCheckTriggerNegativeTransition(
+- SyncTrigger * /* pTrigger */,
+- CARD64 /* oldval */
+-);
+-
+-static Bool
+-SyncCheckTriggerPositiveComparison(
+- SyncTrigger * /* pTrigger */,
+- CARD64 /* oldval */
+-);
+-
+-static Bool
+-SyncCheckTriggerPositiveTransition(
+- SyncTrigger * /* pTrigger */,
+- CARD64 /* oldval */
+-);
+-
+-static SyncCounter *
+-SyncCreateCounter(
+- ClientPtr /* client */,
+- XSyncCounter /* id */,
+- CARD64 /* initialvalue */
+-);
+-
+-static void SyncComputeBracketValues(
+- SyncCounter * /* pCounter */,
+- Bool /* startOver */
+-);
+-
+-static void
+-SyncDeleteTriggerFromCounter(
+- SyncTrigger * /* pTrigger */
+-);
+-
+-static Bool
+-SyncEventSelectForAlarm(
+- SyncAlarm * /* pAlarm */,
+- ClientPtr /* client */,
+- Bool /* wantevents */
+-);
+-
+-static void
+-SyncInitServerTime(
+- void
+-);
+-
+-static void
+-SyncInitIdleTime(
+- void
+-);
+-
+-static void
+-SyncResetProc(
+- ExtensionEntry * /* extEntry */
+-);
+-
+-static void
+-SyncSendAlarmNotifyEvents(
+- SyncAlarm * /* pAlarm */
+-);
+-
+-static void
+-SyncSendCounterNotifyEvents(
+- ClientPtr /* client */,
+- SyncAwait ** /* ppAwait */,
+- int /* num_events */
+-);
++static void SyncInitIdleTime(void);
+
+ static DISPATCH_PROC(ProcSyncAwait);
+ static DISPATCH_PROC(ProcSyncChangeAlarm);
+@@ -301,8 +136,7 @@
+ * delete and add triggers on this list.
+ */
+ static void
+-SyncDeleteTriggerFromCounter(pTrigger)
+- SyncTrigger *pTrigger;
++SyncDeleteTriggerFromCounter(SyncTrigger *pTrigger)
+ {
+ SyncTriggerList *pCur;
+ SyncTriggerList *pPrev;
+@@ -323,7 +157,7 @@
+ pPrev->next = pCur->next;
+ else
+ pTrigger->pCounter->pTriglist = pCur->next;
+-
++
+ xfree(pCur);
+ break;
+ }
+@@ -331,15 +165,14 @@
+ pPrev = pCur;
+ pCur = pCur->next;
+ }
+-
++
+ if (IsSystemCounter(pTrigger->pCounter))
+ SyncComputeBracketValues(pTrigger->pCounter, /*startOver*/ TRUE);
+ }
+
+
+ static int
+-SyncAddTriggerToCounter(pTrigger)
+- SyncTrigger *pTrigger;
++SyncAddTriggerToCounter(SyncTrigger *pTrigger)
+ {
+ SyncTriggerList *pCur;
+
+@@ -353,7 +186,7 @@
+ return Success;
+ }
+
+- if (!(pCur = (SyncTriggerList *)xalloc(sizeof(SyncTriggerList))))
++ if (!(pCur = xalloc(sizeof(SyncTriggerList))))
+ return BadAlloc;
+
+ pCur->pTrigger = pTrigger;
+@@ -367,7 +200,7 @@
+ }
+
+
+-/* Below are four possible functions that can be plugged into
++/* Below are four possible functions that can be plugged into
+ * pTrigger->CheckTrigger, corresponding to the four possible
+ * test-types. These functions are called after the counter's
+ * value changes but are also passed the old counter value
+@@ -377,14 +210,12 @@
+ * of the trigger.
+ *
+ * All of them include the condition pTrigger->pCounter == NULL.
+- * This is because the spec says that a trigger with a counter value
++ * This is because the spec says that a trigger with a counter value
+ * of None is always TRUE.
+ */
+
+ static Bool
+-SyncCheckTriggerPositiveComparison(pTrigger, oldval)
+- SyncTrigger *pTrigger;
+- CARD64 oldval;
++SyncCheckTriggerPositiveComparison(SyncTrigger *pTrigger, CARD64 oldval)
+ {
+ return (pTrigger->pCounter == NULL ||
+ XSyncValueGreaterOrEqual(pTrigger->pCounter->value,
+@@ -392,9 +223,7 @@
+ }
+
+ static Bool
+-SyncCheckTriggerNegativeComparison(pTrigger, oldval)
+- SyncTrigger *pTrigger;
+- CARD64 oldval;
++SyncCheckTriggerNegativeComparison(SyncTrigger *pTrigger, CARD64 oldval)
+ {
+ return (pTrigger->pCounter == NULL ||
+ XSyncValueLessOrEqual(pTrigger->pCounter->value,
+@@ -402,9 +231,7 @@
+ }
+
+ static Bool
+-SyncCheckTriggerPositiveTransition(pTrigger, oldval)
+- SyncTrigger *pTrigger;
+- CARD64 oldval;
++SyncCheckTriggerPositiveTransition(SyncTrigger *pTrigger, CARD64 oldval)
+ {
+ return (pTrigger->pCounter == NULL ||
+ (XSyncValueLessThan(oldval, pTrigger->test_value) &&
+@@ -413,9 +240,7 @@
+ }
+
+ static Bool
+-SyncCheckTriggerNegativeTransition(pTrigger, oldval)
+- SyncTrigger *pTrigger;
+- CARD64 oldval;
++SyncCheckTriggerNegativeTransition(SyncTrigger *pTrigger, CARD64 oldval)
+ {
+ return (pTrigger->pCounter == NULL ||
+ (XSyncValueGreaterThan(oldval, pTrigger->test_value) &&
+@@ -423,14 +248,9 @@
+ pTrigger->test_value)));
+ }
+
+-
+-
+-static int
+-SyncInitTrigger(client, pTrigger, counter, changes)
+- ClientPtr client; /* so we can set errorValue */
+- SyncTrigger *pTrigger;
+- XSyncCounter counter;
+- Mask changes;
++static int
++SyncInitTrigger(ClientPtr client, SyncTrigger *pTrigger, XSyncCounter counter,
++ Mask changes)
+ {
+ SyncCounter *pCounter = pTrigger->pCounter;
+ int rc;
+@@ -440,7 +260,7 @@
+ {
+ if (counter == None)
+ pCounter = NULL;
+- else if (Success != (rc = dixLookupResource((pointer *)&pCounter,
++ else if (Success != (rc = dixLookupResourceByType ((pointer *)&pCounter,
+ counter, RTCounter, client, DixReadAccess)))
+ {
+ client->errorValue = counter;
+@@ -486,16 +306,16 @@
+
+ switch (pTrigger->test_type)
+ {
+- case XSyncPositiveTransition:
++ case XSyncPositiveTransition:
+ pTrigger->CheckTrigger = SyncCheckTriggerPositiveTransition;
+ break;
+- case XSyncNegativeTransition:
++ case XSyncNegativeTransition:
+ pTrigger->CheckTrigger = SyncCheckTriggerNegativeTransition;
+ break;
+- case XSyncPositiveComparison:
++ case XSyncPositiveComparison:
+ pTrigger->CheckTrigger = SyncCheckTriggerPositiveComparison;
+ break;
+- case XSyncNegativeComparison:
++ case XSyncNegativeComparison:
+ pTrigger->CheckTrigger = SyncCheckTriggerNegativeComparison;
+ break;
+ }
+@@ -511,7 +331,7 @@
+ if (pCounter == NULL)
+ return BadMatch;
+
+- XSyncValueAdd(&pTrigger->test_value, pCounter->value,
++ XSyncValueAdd(&pTrigger->test_value, pCounter->value,
+ pTrigger->wait_value, &overflow);
+ if (overflow)
+ {
+@@ -533,17 +353,16 @@
+ {
+ SyncComputeBracketValues(pCounter, /*startOver*/ TRUE);
+ }
+-
++
+ return Success;
+ }
+
+ /* AlarmNotify events happen in response to actions taken on an Alarm or
+- * the counter used by the alarm. AlarmNotify may be sent to multiple
++ * the counter used by the alarm. AlarmNotify may be sent to multiple
+ * clients. The alarm maintains a list of clients interested in events.
+ */
+ static void
+-SyncSendAlarmNotifyEvents(pAlarm)
+- SyncAlarm *pAlarm;
++SyncSendAlarmNotifyEvents(SyncAlarm *pAlarm)
+ {
+ SyncAlarmClientList *pcl;
+ xSyncAlarmNotifyEvent ane;
+@@ -571,7 +390,7 @@
+ ane.state = pAlarm->state;
+
+ /* send to owner */
+- if (pAlarm->events && !pAlarm->client->clientGone)
++ if (pAlarm->events && !pAlarm->client->clientGone)
+ WriteEventsToClient(pAlarm->client, 1, (xEvent *) &ane);
+
+ /* send to other interested clients */
+@@ -586,23 +405,20 @@
+ }
+
+
+-/* CounterNotify events only occur in response to an Await. The events
++/* CounterNotify events only occur in response to an Await. The events
+ * go only to the Awaiting client.
+ */
+ static void
+-SyncSendCounterNotifyEvents(client, ppAwait, num_events)
+- ClientPtr client;
+- SyncAwait **ppAwait;
+- int num_events;
++SyncSendCounterNotifyEvents(ClientPtr client, SyncAwait **ppAwait,
++ int num_events)
+ {
+ xSyncCounterNotifyEvent *pEvents, *pev;
+ int i;
+
+ if (client->clientGone)
+ return;
+- pev = pEvents = (xSyncCounterNotifyEvent *)
+- xalloc(num_events * sizeof(xSyncCounterNotifyEvent));
+- if (!pEvents)
++ pev = pEvents = xalloc(num_events * sizeof(xSyncCounterNotifyEvent));
++ if (!pEvents)
+ return;
+ UpdateCurrentTime();
+ for (i = 0; i < num_events; i++, ppAwait++, pev++)
+@@ -629,9 +445,8 @@
+ /* This function is called when an alarm's counter is destroyed.
+ * It is plugged into pTrigger->CounterDestroyed (for alarm triggers).
+ */
+-void
+-SyncAlarmCounterDestroyed(pTrigger)
+- SyncTrigger *pTrigger;
++static void
++SyncAlarmCounterDestroyed(SyncTrigger *pTrigger)
+ {
+ SyncAlarm *pAlarm = (SyncAlarm *)pTrigger;
+
+@@ -641,12 +456,11 @@
+ }
+
+
+-/* This function is called when an alarm "goes off."
++/* This function is called when an alarm "goes off."
+ * It is plugged into pTrigger->TriggerFired (for alarm triggers).
+ */
+ static void
+-SyncAlarmTriggerFired(pTrigger)
+- SyncTrigger *pTrigger;
++SyncAlarmTriggerFired(SyncTrigger *pTrigger)
+ {
+ SyncAlarm *pAlarm = (SyncAlarm *)pTrigger;
+ CARD64 new_test_value;
+@@ -686,7 +500,7 @@
+ {
+ XSyncValueAdd(&paTrigger->test_value, paTrigger->test_value,
+ pAlarm->delta, &overflow);
+- } while (!overflow &&
++ } while (!overflow &&
+ (*paTrigger->CheckTrigger)(paTrigger,
+ paTrigger->pCounter->value));
+
+@@ -721,8 +535,7 @@
+ * (for Await triggers).
+ */
+ static void
+-SyncAwaitTriggerFired(pTrigger)
+- SyncTrigger *pTrigger;
++SyncAwaitTriggerFired(SyncTrigger *pTrigger)
+ {
+ SyncAwait *pAwait = (SyncAwait *)pTrigger;
+ int numwaits;
+@@ -732,7 +545,7 @@
+
+ pAwaitUnion = (SyncAwaitUnion *)pAwait->pHeader;
+ numwaits = pAwaitUnion->header.num_waitconditions;
+- ppAwait = (SyncAwait **)xalloc(numwaits * sizeof(SyncAwait *));
++ ppAwait = xalloc(numwaits * sizeof(SyncAwait *));
+ if (!ppAwait)
+ goto bail;
+
+@@ -815,9 +628,7 @@
+ * any triggers depending on the counter will be checked.
+ */
+ void
+-SyncChangeCounter(pCounter, newval)
+- SyncCounter *pCounter;
+- CARD64 newval;
++SyncChangeCounter(SyncCounter *pCounter, CARD64 newval)
+ {
+ SyncTriggerList *ptl, *pnext;
+ CARD64 oldval;
+@@ -842,10 +653,7 @@
+
+ /* loosely based on dix/events.c/EventSelectForWindow */
+ static Bool
+-SyncEventSelectForAlarm(pAlarm, client, wantevents)
+- SyncAlarm *pAlarm;
+- ClientPtr client;
+- Bool wantevents;
++SyncEventSelectForAlarm(SyncAlarm *pAlarm, ClientPtr client, Bool wantevents)
+ {
+ SyncAlarmClientList *pClients;
+
+@@ -862,8 +670,8 @@
+ {
+ if (pClients->client == client)
+ {
+- /* client's presence on the list indicates desire for
+- * events. If the client doesn't want events, remove it
++ /* client's presence on the list indicates desire for
++ * events. If the client doesn't want events, remove it
+ * from the list. If the client does want events, do
+ * nothing, since it's already got them.
+ */
+@@ -880,18 +688,18 @@
+ */
+
+ if (!wantevents)
+- /* client doesn't want events, and we just discovered that it
++ /* client doesn't want events, and we just discovered that it
+ * doesn't have them, so there's nothing to do.
+ */
+ return Success;
+
+ /* add new client to pAlarm->pEventClients */
+
+- pClients = (SyncAlarmClientList *) xalloc(sizeof(SyncAlarmClientList));
++ pClients = xalloc(sizeof(SyncAlarmClientList));
+ if (!pClients)
+ return BadAlloc;
+
+- /* register it as a resource so it will be cleaned up
++ /* register it as a resource so it will be cleaned up
+ * if the client dies
+ */
+
+@@ -913,12 +721,9 @@
+ /*
+ * ** SyncChangeAlarmAttributes ** This is used by CreateAlarm and ChangeAlarm
+ */
+-static int
+-SyncChangeAlarmAttributes(client, pAlarm, mask, values)
+- ClientPtr client;
+- SyncAlarm *pAlarm;
+- Mask mask;
+- CARD32 *values;
++static int
++SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm *pAlarm, Mask mask,
++ CARD32 *values)
+ {
+ int status;
+ XSyncCounter counter;
+@@ -1015,20 +820,17 @@
+
+
+ static SyncCounter *
+-SyncCreateCounter(client, id, initialvalue)
+- ClientPtr client;
+- XSyncCounter id;
+- CARD64 initialvalue;
++SyncCreateCounter(ClientPtr client, XSyncCounter id, CARD64 initialvalue)
+ {
+ SyncCounter *pCounter;
+
+- if (!(pCounter = (SyncCounter *) xalloc(sizeof(SyncCounter))))
+- return (SyncCounter *)NULL;
++ if (!(pCounter = xalloc(sizeof(SyncCounter))))
++ return NULL;
+
+ if (!AddResource(id, RTCounter, (pointer) pCounter))
+ {
+- xfree((pointer) pCounter);
+- return (SyncCounter *)NULL;
++ xfree(pCounter);
++ return NULL;
+ }
+
+ pCounter->client = client;
+@@ -1040,36 +842,31 @@
+ return pCounter;
+ }
+
+-static int FreeCounter(
+- pointer /*env*/,
+- XID /*id*/
+-);
++static int FreeCounter(void *, XID);
+
+ /*
+ * ***** System Counter utilities
+ */
+
+-pointer
+-SyncCreateSystemCounter(name, initial, resolution, counterType,
+- QueryValue, BracketValues)
+- char *name;
+- CARD64 initial;
+- CARD64 resolution;
+- SyncCounterType counterType;
+- void (*QueryValue) (
+- pointer /* pCounter */,
+- CARD64 * /* pValue_return */);
+- void (*BracketValues) (
+- pointer /* pCounter */,
+- CARD64 * /* pbracket_less */,
+- CARD64 * /* pbracket_greater */);
++pointer
++SyncCreateSystemCounter(
++ char *name,
++ CARD64 initial,
++ CARD64 resolution,
++ SyncCounterType counterType,
++ void (*QueryValue)(pointer /* pCounter */,
++ CARD64 * /* pValue_return */),
++ void (*BracketValues)(pointer /* pCounter */,
++ CARD64 * /* pbracket_less */,
++ CARD64 * /* pbracket_greater */)
++ )
+ {
+ SyncCounter *pCounter;
+
+- SysCounterList = (SyncCounter **)xrealloc(SysCounterList,
++ SysCounterList = xrealloc(SysCounterList,
+ (SyncNumSystemCounters+1)*sizeof(SyncCounter *));
+ if (!SysCounterList)
+- return (pointer)NULL;
++ return NULL;
+
+ /* this function may be called before SYNC has been initialized, so we
+ * have to make sure RTCounter is created.
+@@ -1079,21 +876,21 @@
+ RTCounter = CreateNewResourceType(FreeCounter);
+ if (RTCounter == 0)
+ {
+- return (pointer)NULL;
++ return NULL;
+ }
+ }
+
+- pCounter = SyncCreateCounter((ClientPtr)NULL, FakeClientID(0), initial);
++ pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial);
+
+ if (pCounter)
+ {
+ SysCounterInfo *psci;
+
+- psci = (SysCounterInfo *)xalloc(sizeof(SysCounterInfo));
++ psci = xalloc(sizeof(SysCounterInfo));
+ if (!psci)
+ {
+ FreeResource(pCounter->id, RT_NONE);
+- return (pointer) pCounter;
++ return pCounter;
+ }
+ pCounter->pSysCounterInfo = psci;
+ psci->name = name;
+@@ -1105,21 +902,18 @@
+ XSyncMinValue(&psci->bracket_less);
+ SysCounterList[SyncNumSystemCounters++] = pCounter;
+ }
+- return (pointer) pCounter;
++ return pCounter;
+ }
+
+ void
+-SyncDestroySystemCounter(pSysCounter)
+- pointer pSysCounter;
++SyncDestroySystemCounter(pointer pSysCounter)
+ {
+ SyncCounter *pCounter = (SyncCounter *)pSysCounter;
+ FreeResource(pCounter->id, RT_NONE);
+ }
+
+ static void
+-SyncComputeBracketValues(pCounter, startOver)
+- SyncCounter *pCounter;
+- Bool startOver;
++SyncComputeBracketValues(SyncCounter *pCounter, Bool startOver)
+ {
+ SyncTriggerList *pCur;
+ SyncTrigger *pTrigger;
+@@ -1168,28 +962,24 @@
+ pnewltval = &psci->bracket_less;
+ }
+ }
+- else if ( (pTrigger->test_type == XSyncPositiveTransition &&
++ else if (pTrigger->test_type == XSyncNegativeTransition &&
+ ct != XSyncCounterNeverIncreases)
+- ||
+- (pTrigger->test_type == XSyncNegativeTransition &&
++ {
++ if (XSyncValueGreaterThan(pCounter->value, pTrigger->test_value) &&
++ XSyncValueGreaterThan(pTrigger->test_value, psci->bracket_less))
++ {
++ psci->bracket_less = pTrigger->test_value;
++ pnewltval = &psci->bracket_less;
++ }
++ }
++ else if (pTrigger->test_type == XSyncPositiveTransition &&
+ ct != XSyncCounterNeverDecreases)
+- )
Reply to: