diff options
author | dim <dim@FreeBSD.org> | 2014-11-19 07:47:37 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-11-19 07:47:37 +0000 |
commit | e01441233cff1888f405055f30a1d00a326cf57b (patch) | |
tree | f8977063d742d051b6dc2ff6f0cf44c76422bd9f /sys/contrib/ngatm | |
parent | f38628840cd05515326dff20b71bf5c470d2a420 (diff) | |
download | FreeBSD-src-e01441233cff1888f405055f30a1d00a326cf57b.zip FreeBSD-src-e01441233cff1888f405055f30a1d00a326cf57b.tar.gz |
Fix the following -Werror warning from clang 3.5.0, while building
lib/libngatm:
sys/contrib/ngatm/netnatm/saal/saal_sscop.c:4030:32: error: 'break' is bound to current loop, GCC binds it to the enclosing loop [-Werror,-Wgcc-compat]
} while(sn < sscop->vr_h && !QFIND(&sscop->rbuf, sn));
^
sys/contrib/ngatm/netnatm/saal/saal_sscop.c:173:4: note: expanded from macro 'QFIND'
break; \
^
1 error generated.
The idea is to remove any ambiguity by replacing the macro with an
equivalent static inline function.
Reviewed by: emaste, rpaulo
See also: http://reviews.llvm.org/D2518
Differential Revision: https://reviews.freebsd.org/D1188
Diffstat (limited to 'sys/contrib/ngatm')
-rw-r--r-- | sys/contrib/ngatm/netnatm/saal/saal_sscop.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/sys/contrib/ngatm/netnatm/saal/saal_sscop.c b/sys/contrib/ngatm/netnatm/saal/saal_sscop.c index 75ce17d..0776eda 100644 --- a/sys/contrib/ngatm/netnatm/saal/saal_sscop.c +++ b/sys/contrib/ngatm/netnatm/saal/saal_sscop.c @@ -163,18 +163,17 @@ static void sscop_set_state(struct sscop *, u_int); } \ } while(0) - -#define QFIND(Q,RN) \ - ({ \ - struct sscop_msg *_msg = NULL, *_m; \ - MSGQ_FOREACH(_m, (Q)) { \ - if(_m->seqno == (RN)) { \ - _msg = _m; \ - break; \ - } \ - } \ - _msg; \ - }) +static inline struct sscop_msg *QFIND(sscop_msgq_head_t *q, u_int rn) +{ + struct sscop_msg *msg = NULL, *m; + MSGQ_FOREACH(m, q) { + if(m->seqno == rn) { + msg = m; + break; + } + } + return msg; +} #define QINSERT(Q,M) \ do { \ |