]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: plock: remove dead code that causes a warning in gcc 11
authorWilly Tarreau <w@1wt.eu>
Mon, 21 Dec 2020 09:27:18 +0000 (10:27 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 21 Dec 2020 09:27:18 +0000 (10:27 +0100)
As Ilya reported in issue #998, gcc 11 complains about misleading code
indentation which is in fact caused by dead assignments to zero after
a loop which stops on zero. Let's clean both of these.

include/import/plock.h

index 22244c5a64b86cfee459ac7494b87127d07bd2ee..058cc18502efeddd9dac37cea221f451c82e8ccb 100644 (file)
                                while (__pl_r)                                                 \
                                        __pl_r = pl_deref_long(lock) -                         \
                                                (PLOCK64_WL_1 | PLOCK64_SL_1 | PLOCK64_RL_1);  \
-                                       __pl_r = 0;                                            \
                        }                                                                      \
                }                                                                              \
                !__pl_r; /* return value */                                                    \
                                while (__pl_r)                                                 \
                                        __pl_r = pl_deref_int(lock) -                          \
                                                (PLOCK32_WL_1 | PLOCK32_SL_1 | PLOCK32_RL_1);  \
-                                       __pl_r = 0;                                            \
                        }                                                                      \
                }                                                                              \
                !__pl_r; /* return value */                                                    \