From patchwork Wed Apr 3 15:07:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 906 Return-Path: Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2D45F60DB2 for ; Wed, 3 Apr 2019 17:06:56 +0200 (CEST) X-Originating-IP: 2.224.242.101 Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id B370FFF816; Wed, 3 Apr 2019 15:06:55 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Wed, 3 Apr 2019 17:07:28 +0200 Message-Id: <20190403150735.27580-2-jacopo@jmondi.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190403150735.27580-1-jacopo@jmondi.org> References: <20190403150735.27580-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 1/8] libcamera: utils: Define BIT() macro X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Apr 2019 15:06:56 -0000 Define BIT(b_) macro which expands to a left bit shift. Signed-off-by: Jacopo Mondi Reviewed-by: Niklas Söderlund --- src/libcamera/include/utils.h | 1 + src/libcamera/utils.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/libcamera/include/utils.h b/src/libcamera/include/utils.h index 79038a96feab..1a6cf7f7b9dc 100644 --- a/src/libcamera/include/utils.h +++ b/src/libcamera/include/utils.h @@ -10,6 +10,7 @@ #include #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) +#define BIT(b_) (1 << (b_)) namespace libcamera { diff --git a/src/libcamera/utils.cpp b/src/libcamera/utils.cpp index cd0fd7614cc7..1a5a2a03b1ca 100644 --- a/src/libcamera/utils.cpp +++ b/src/libcamera/utils.cpp @@ -24,6 +24,11 @@ namespace utils { * \brief Determine the number of elements in the static array. */ +/** + * \def BIT(b) + * \brief Bitwise left shift by \a b bits + */ + /** * \brief Strip the directory prefix from the path * \param[in] path The path to process