Date: Mon, 22 Nov 2010 16:27:12 +0000 From: Bruce Cran <bruce@cran.org.uk> To: freebsd-hackers@freebsd.org Subject: Logical vs. bitwise AND in sbin/routed/parms.c Message-ID: <20101122162712.3c3655fe@core.draftnet>
next in thread | raw e-mail | index | archive | help
I've been going through src/bin and src/sbin seeing how easy it would be to remove warnings clang generates. During the work I came across routed/parms.c which appears to be doing a logical instead of bitwise AND. Would the following change be correct? Index: /usr/src/head/sbin/routed/parms.c =================================================================== --- /usr/src/head/sbin/routed/parms.c (revision 215671) +++ /usr/src/head/sbin/routed/parms.c (working copy) @@ -876,11 +876,11 @@ if ((0 != (new->parm_int_state & GROUP_IS_SOL_OUT) && 0 != (parmp->parm_int_state & GROUP_IS_SOL_OUT) && 0 != ((new->parm_int_state ^ parmp->parm_int_state) - && GROUP_IS_SOL_OUT)) + & GROUP_IS_SOL_OUT)) || (0 != (new->parm_int_state & GROUP_IS_ADV_OUT) && 0 != (parmp->parm_int_state & GROUP_IS_ADV_OUT) && 0 != ((new->parm_int_state ^ parmp->parm_int_state) - && GROUP_IS_ADV_OUT)) + & GROUP_IS_ADV_OUT)) || (new->parm_rdisc_pref != 0 && parmp->parm_rdisc_pref != 0 && new->parm_rdisc_pref != parmp->parm_rdisc_pref) -- Bruce Cran
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101122162712.3c3655fe>