diff options
author | tnn <tnn@pkgsrc.org> | 2016-05-04 02:48:27 +0000 |
---|---|---|
committer | tnn <tnn@pkgsrc.org> | 2016-05-04 02:48:27 +0000 |
commit | 9e8d6cff73504c29fcc002830fa456717e67dca8 (patch) | |
tree | 46ef802328db415c8573dd2f73e5d69c8304435f /x11 | |
parent | 4e06490b7747662182bd8487ca372910d5164ed5 (diff) | |
download | pkgsrc-9e8d6cff73504c29fcc002830fa456717e67dca8.tar.gz |
move variable declarations to top of function
Diffstat (limited to 'x11')
-rw-r--r-- | x11/libxshmfence/files/xshmfence_semaphore.c | 5 |
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(); |