Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2019-08-07 16:08:51 +0300
committerJunio C Hamano <gitster@pobox.com>2019-08-07 21:54:45 +0300
commitc9b9c09dae175f75bed4363cc6278c3f0cb3b9dd (patch)
tree1c551f2d388884847cd56f1adaaa42d5cef718d3 /compat/nedmalloc
parentaeb582a98374c094361cba1bd756dc6307432c42 (diff)
nedmalloc: do assignments only after the declaration section
Avoid the following compiler warning: In file included from compat/nedmalloc/nedmalloc.c:63: compat/nedmalloc/malloc.c.h: In function ‘pthread_release_lock’: compat/nedmalloc/malloc.c.h:1759:5: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] 1759 | volatile unsigned int* lp = &sl->l; | ^~~~~~~~ Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat/nedmalloc')
-rw-r--r--compat/nedmalloc/malloc.c.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/compat/nedmalloc/malloc.c.h b/compat/nedmalloc/malloc.c.h
index b833ff9225..88c131ca93 100644
--- a/compat/nedmalloc/malloc.c.h
+++ b/compat/nedmalloc/malloc.c.h
@@ -1755,10 +1755,10 @@ static FORCEINLINE void pthread_release_lock (MLOCK_T *sl) {
assert(sl->l != 0);
assert(sl->threadid == CURRENT_THREAD);
if (--sl->c == 0) {
- sl->threadid = 0;
volatile unsigned int* lp = &sl->l;
int prev = 0;
int ret;
+ sl->threadid = 0;
__asm__ __volatile__ ("lock; xchgl %0, %1"
: "=r" (ret)
: "m" (*(lp)), "0"(prev)