{"id":19535,"url":"https://patchwork.libcamera.org/api/covers/19535/?format=json","web_url":"https://patchwork.libcamera.org/cover/19535/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20240225164348.10073-1-laurent.pinchart@ideasonboard.com>","date":"2024-02-25T16:43:45","name":"[0/2] libcamera: Add utils::to_underlying() helper","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/cover/19535/mbox/","series":[{"id":4179,"url":"https://patchwork.libcamera.org/api/series/4179/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4179","date":"2024-02-25T16:43:45","name":"libcamera: Add utils::to_underlying() helper","version":1,"mbox":"https://patchwork.libcamera.org/series/4179/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/19535/comments/","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id D5BACBD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 25 Feb 2024 16:43:47 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0C53C62867;\n\tSun, 25 Feb 2024 17:43:47 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2A65A61C98\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 25 Feb 2024 17:43:45 +0100 (CET)","from pendragon.ideasonboard.com (89-27-53-110.bb.dnainternet.fi\n\t[89.27.53.110])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 21E114E6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 25 Feb 2024 17:43:34 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"GSHb5M28\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1708879414;\n\tbh=RvQR5LEqv0pq0QOSOR3cvoE664IkCzGZAaOjKkLTyg8=;\n\th=From:To:Subject:Date:From;\n\tb=GSHb5M28Kq+qyDAtfDQZEHAvgQVQnbKV6chDJLFaUyp+WIkpP14Dvo7tDDHcpeb8A\n\tgwQ5rmR/KdTJpidHGMuY0j55TZxayAZaQWYYdw9VFp+vxiQ/KD3ryzjV4N0IEZl7EC\n\ti2xmzaBybJ9N+S2c0OAJwOg+qDtu4iTgugvFB2bA=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","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","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Hello,\n\nC++23 has a std::to_underlying() helper that casts an enumeration to its\nunderlying type. libcamera open-codes this in multiple places. This\nseries adds an identical helper to the utils:: namespace, and uses it to\nreplace the open-coded implementations.\n\nLaurent Pinchart (2):\n  libcamera: utils: Add to_underlying() helper function\n  libcamera: Use utils::to_underlying()\n\n include/libcamera/base/utils.h                 |  6 ++++++\n src/ipa/rpi/controller/rpi/sdn.cpp             |  3 ++-\n src/libcamera/base/utils.cpp                   | 10 ++++++++++\n src/libcamera/pipeline/rpi/common/rpi_stream.h | 10 +++-------\n src/libcamera/stream.cpp                       |  2 +-\n 5 files changed, 22 insertions(+), 9 deletions(-)\n\n\nbase-commit: 059bbcdc34e7d887ee02fdd47613bd6e0eb70d16"}