On Sun, 2017-01-15 at 19:49 +0000, Adrian Chadd wrote:
> Author: adrian
> Date: Sun Jan 15 19:49:47 2017
> New Revision: 312236
> URL: https://svnweb.freebsd.org/changeset/base/312236
> 
> Log:
>   [net80211] add some more "is this XXX" macros for CTRL and DATA.
>   
>   There's already a macro for MGT.
> 
> Modified:
>   head/sys/net80211/ieee80211.h
> 
> Modified: head/sys/net80211/ieee80211.h
> =====================================================================
> =========
> --- head/sys/net80211/ieee80211.h     Sun Jan 15 18:00:45 2017        
> (r312235)
> +++ head/sys/net80211/ieee80211.h     Sun Jan 15 19:49:47 2017        
> (r312236)
> @@ -165,6 +165,12 @@ struct ieee80211_qosframe_addr4 {
>  #define      IEEE80211_IS_MGMT(wh)                                   
> \
>       (!! (((wh)->i_fc[0] & IEEE80211_FC0_TYPE_MASK)          
> \
>           == IEEE80211_FC0_TYPE_MGT))
> +#define      IEEE80211_IS_CTL(wh)                                    
> \
> +     (!! (((wh)->i_fc[0] & IEEE80211_FC0_TYPE_MASK)          
> \
> +         == IEEE80211_FC0_TYPE_CTL))
> +#define      IEEE80211_IS_DATA(wh)                                   
> \
> +     (!! (((wh)->i_fc[0] & IEEE80211_FC0_TYPE_MASK)          
> \
> +         == IEEE80211_FC0_TYPE_DATA))
>  
>  #define      IEEE80211_FC0_QOSDATA \
>       (IEEE80211_FC0_TYPE_DATA|IEEE80211_FC0_SUBTYPE_QOS|IEEE80211
> _FC0_VERSION_0)
> 

What is the point of the !! in these macros?  The expressions already
have boolean type (even in C++ where it matters) due to the ==.
 Removing the !! would also make one level of parens redundant.

-- Ian
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to