summaryrefslogtreecommitdiff
path: root/x11
diff options
context:
space:
mode:
authortnn <tnn@pkgsrc.org>2016-05-04 02:48:27 +0000
committertnn <tnn@pkgsrc.org>2016-05-04 02:48:27 +0000
commit9e8d6cff73504c29fcc002830fa456717e67dca8 (patch)
tree46ef802328db415c8573dd2f73e5d69c8304435f /x11
parent4e06490b7747662182bd8487ca372910d5164ed5 (diff)
downloadpkgsrc-9e8d6cff73504c29fcc002830fa456717e67dca8.tar.gz
move variable declarations to top of function
Diffstat (limited to 'x11')
-rw-r--r--x11/libxshmfence/files/xshmfence_semaphore.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/x11/libxshmfence/files/xshmfence_semaphore.c b/x11/libxshmfence/files/xshmfence_semaphore.c
index 666f7c1f57e..3a9401805e9 100644
--- a/x11/libxshmfence/files/xshmfence_semaphore.c
+++ b/x11/libxshmfence/files/xshmfence_semaphore.c
@@ -51,15 +51,16 @@ static sem_t *mksemtemp(char *, const char *);
**/
int
xshmfence_trigger(struct xshmfence *f) {
+ int v, waiting;
LOCK();
- int v = __sync_bool_compare_and_swap(&f->triggered, 0, 1);
+ v = __sync_bool_compare_and_swap(&f->triggered, 0, 1);
if (v == 0) {
/* already triggered */
UNLOCK();
return 0;
}
- int waiting = __sync_fetch_and_add(&f->waiting, 0);
+ waiting = __sync_fetch_and_add(&f->waiting, 0);
while (waiting > 0) {
COND_SIGNAL();