From owner-svn-src-all@freebsd.org Sun Jan 15 20:43:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 656ECCB1E75; Sun, 15 Jan 2017 20:43:11 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com [IPv6:2a00:1450:400c:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F047A1B43; Sun, 15 Jan 2017 20:43:10 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wm0-x22f.google.com with SMTP id c85so134238751wmi.1; Sun, 15 Jan 2017 12:43:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ChvI3ZiTHmrIPgWa/OnABRyTeaVccmmK7bLU4x8RBEE=; b=ju3XFoqi0PYRo5p91ax47ApvuzrqEp6dbknBTGGj3CW7RJWHA4YOHran9Z/TlUI0LX lA4Qu/IPMvtkChiirXpYN5WGu842Aa07fHa+BNqZVQn2WVlanAOUZuTbGoO2l6RRKLT4 taTIPJKEDMCShnO7qkLYbsFaerN1zt8plHchsdAZjOW1vD8FATMAs7XaM0ZaqtpOQQjH oilnyz59QHK9oN6scQB0erN9o5p7avMlfwmWasyYC1xNJzen0tVYu/L5tZQP3Ihvp02w zJ+XtZGPBrIXGQtzKG6iZIwBATQB4DCViUZBjUA2zyXQ4B70/bpIabL2IWsuaYr3uo1j zQ/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ChvI3ZiTHmrIPgWa/OnABRyTeaVccmmK7bLU4x8RBEE=; b=TySFTpI27fJzw+hr94+86nSzflYCszhdhn5T3DYePldg5KPA0BkEPi86Zr7sS8UHsa Cuv8/zWDeAT0RV/5wvldpPhef7RTyqoA61YZMCf9RA+KefF3hqVK3iihKSyJBNvQ27XI WJoNnthfUQt19d7t8sfWNJx3JnK9Ca+3Gk85Hjc+BKK+atRzQu5tRp3pqezcnXaG61pN 6MstutKpEbIov2a825/Qd3+zSViWcqnthjJ21qE0h/bf353yy/o+vGJqkCQWjBe89hTY rqqmAnb2qNt35/qIabXZ/IdeWyb7WDOWnwLNfK2N8l+0Zo52+gQ3bedQ2a8qmHY+dycy gN9g== X-Gm-Message-State: AIkVDXLHqTl8+zW4Q2uhG2GOMwPnmB8qOtBoOn9Gw6Y1S0JbBVHNzUPtepDP+o0KZDIaRj0gJ/2rJ7sxjhMycQ== X-Received: by 10.223.173.181 with SMTP id w50mr19768638wrc.177.1484512988460; Sun, 15 Jan 2017 12:43:08 -0800 (PST) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.194.82.162 with HTTP; Sun, 15 Jan 2017 12:43:07 -0800 (PST) In-Reply-To: <1484510213.86335.110.camel@freebsd.org> References: <201701151949.v0FJnl2h027169@repo.freebsd.org> <1484510213.86335.110.camel@freebsd.org> From: Adrian Chadd Date: Sun, 15 Jan 2017 12:43:07 -0800 X-Google-Sender-Auth: qbPgVMH4SM83S58-i7VNG5f-1ew Message-ID: Subject: Re: svn commit: r312236 - head/sys/net80211 To: Ian Lepore Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jan 2017 20:43:11 -0000 On 15 January 2017 at 11:56, Ian Lepore wrote: > > 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. It's just a habit i picked up from linux-land. That way it really is only 1 or 0, so things like debugging output and such make easier sense. It's also fixed a handful of bugs in the past (but I can't think of exact cases right now) - primarily where other code expected 1 or 0 (for things like shifts into protocol fields) and the macro returns 0 or ${LARGEVAL}. -adrian