mirror of
https://github.com/git/git
synced 2024-08-28 12:09:19 +00:00
nedmalloc: avoid compiler warning about unused value
Cast the evaluated value of the macro INITIAL_LOCK to void to instruct the compiler that we're not interested in said value nor the following warning: In file included from compat/nedmalloc/nedmalloc.c:63: compat/nedmalloc/malloc.c.h: In function ‘init_user_mstate’: compat/nedmalloc/malloc.c.h:1706:62: error: right-hand operand of comma expression has no effect [-Werror=unused-value] 1706 | #define INITIAL_LOCK(sl) (memset(sl, 0, sizeof(MLOCK_T)), 0) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ compat/nedmalloc/malloc.c.h:5020:3: note: in expansion of macro ‘INITIAL_LOCK’ 5020 | INITIAL_LOCK(&m->mutex); | ^~~~~~~~~~~~ Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
c9b9c09dae
commit
70597e8386
|
@ -3066,7 +3066,7 @@ static int init_mparams(void) {
|
||||||
#if !ONLY_MSPACES
|
#if !ONLY_MSPACES
|
||||||
/* Set up lock for main malloc area */
|
/* Set up lock for main malloc area */
|
||||||
gm->mflags = mparams.default_mflags;
|
gm->mflags = mparams.default_mflags;
|
||||||
INITIAL_LOCK(&gm->mutex);
|
(void)INITIAL_LOCK(&gm->mutex);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (FOOTERS && !INSECURE)
|
#if (FOOTERS && !INSECURE)
|
||||||
|
@ -5017,7 +5017,7 @@ static mstate init_user_mstate(char* tbase, size_t tsize) {
|
||||||
mchunkptr msp = align_as_chunk(tbase);
|
mchunkptr msp = align_as_chunk(tbase);
|
||||||
mstate m = (mstate)(chunk2mem(msp));
|
mstate m = (mstate)(chunk2mem(msp));
|
||||||
memset(m, 0, msize);
|
memset(m, 0, msize);
|
||||||
INITIAL_LOCK(&m->mutex);
|
(void)INITIAL_LOCK(&m->mutex);
|
||||||
msp->head = (msize|PINUSE_BIT|CINUSE_BIT);
|
msp->head = (msize|PINUSE_BIT|CINUSE_BIT);
|
||||||
m->seg.base = m->least_addr = tbase;
|
m->seg.base = m->least_addr = tbase;
|
||||||
m->seg.size = m->footprint = m->max_footprint = tsize;
|
m->seg.size = m->footprint = m->max_footprint = tsize;
|
||||||
|
|
Loading…
Reference in a new issue