From patchwork Sun Feb 25 16:43:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 19535 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id D5BACBD160 for ; Sun, 25 Feb 2024 16:43:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0C53C62867; Sun, 25 Feb 2024 17:43:47 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="GSHb5M28"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2A65A61C98 for ; Sun, 25 Feb 2024 17:43:45 +0100 (CET) Received: from pendragon.ideasonboard.com (89-27-53-110.bb.dnainternet.fi [89.27.53.110]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 21E114E6 for ; Sun, 25 Feb 2024 17:43:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1708879414; bh=RvQR5LEqv0pq0QOSOR3cvoE664IkCzGZAaOjKkLTyg8=; h=From:To:Subject:Date:From; b=GSHb5M28Kq+qyDAtfDQZEHAvgQVQnbKV6chDJLFaUyp+WIkpP14Dvo7tDDHcpeb8A gwQ5rmR/KdTJpidHGMuY0j55TZxayAZaQWYYdw9VFp+vxiQ/KD3ryzjV4N0IEZl7EC i2xmzaBybJ9N+S2c0OAJwOg+qDtu4iTgugvFB2bA= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH 0/2] libcamera: Add utils::to_underlying() helper Date: Sun, 25 Feb 2024 18:43:45 +0200 Message-ID: <20240225164348.10073-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hello, C++23 has a std::to_underlying() helper that casts an enumeration to its underlying type. libcamera open-codes this in multiple places. This series adds an identical helper to the utils:: namespace, and uses it to replace the open-coded implementations. Laurent Pinchart (2): libcamera: utils: Add to_underlying() helper function libcamera: Use utils::to_underlying() include/libcamera/base/utils.h | 6 ++++++ src/ipa/rpi/controller/rpi/sdn.cpp | 3 ++- src/libcamera/base/utils.cpp | 10 ++++++++++ src/libcamera/pipeline/rpi/common/rpi_stream.h | 10 +++------- src/libcamera/stream.cpp | 2 +- 5 files changed, 22 insertions(+), 9 deletions(-) base-commit: 059bbcdc34e7d887ee02fdd47613bd6e0eb70d16 Reviewed-by: Naushir Patuck