From patchwork Thu Feb 12 15:12:34 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 26136 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 6FC1BBD78E for ; Thu, 12 Feb 2026 15:12:43 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6CABD621CD; Thu, 12 Feb 2026 16:12:42 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="eDExc50T"; 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 2676B61FBF for ; Thu, 12 Feb 2026 16:12:40 +0100 (CET) Received: from killaraus.ideasonboard.com (2001-14ba-703d-e500--2a1.rev.dnainternet.fi [IPv6:2001:14ba:703d:e500::2a1]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 00B43492 for ; Thu, 12 Feb 2026 16:11:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1770909112; bh=b1TXD08RIibjjKmvxusskqSCPz/vjZqIieafFbmA2aA=; h=From:To:Subject:Date:From; b=eDExc50TvpEMxzVHoF1qHkEjOaEU4mZzBAogdNg0GcF5mPuio2Rw5UUwgI9XLG22n xgX96hnElXUHxB8IALsgPGaaq2KZ9ZPm6zdP0VPXE+rwlJqbLPX+8KCycRBCAWN2VH QoNjV/KVyB8MUrJbUP8vHb0Jd0O0GUonwGVe0Y2M= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH v2 0/4] libcamera: Clean up iterators Date: Thu, 12 Feb 2026 17:12:34 +0200 Message-ID: <20260212151238.3736234-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.52.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, This patch series cleans up usage of iterators to standardize on range-based loops and structured bindings wherever possible (and convenient). What started as a single patch is now a series that - Replaces map iterators and pairs with structured bindings (1/4) - Replaces iterators for non-associative containers (vector, span, ...) with range-based for loops (2/4) - Rename one occurrence of a variable named 'it' that does not refer to an iterator (3/4) - Standardize on 'const auto' instead of 'auto const' One thing *not* addressed by this series is replacement of 'auto' with 'const auto' or 'const auto &' where applicable. This could be done on top by someone with enough motivation :-) Laurent Pinchart (4): libcamera: Replace iterators with structured bindings libcamera: Replace iterators with range-based for loops libcamera: Use `it` variable name for iterators only libcamera: Standardize on 'const auto' .../guides/application-developer.rst | 2 +- include/libcamera/base/utils.h | 10 ++-- .../libcamera/internal/ipa_data_serializer.h | 10 ++-- src/apps/common/options.cpp | 6 +-- src/apps/common/stream_options.cpp | 4 +- src/gstreamer/gstlibcamera-controls.cpp.in | 7 +-- src/gstreamer/gstlibcamera-utils.cpp | 50 ++++++++----------- src/ipa/ipu3/ipu3.cpp | 8 +-- src/ipa/mali-c55/mali-c55.cpp | 8 +-- src/ipa/rkisp1/rkisp1.cpp | 8 +-- src/ipa/rpi/common/ipa_base.cpp | 4 +- src/ipa/rpi/controller/controller.cpp | 6 +-- src/ipa/rpi/controller/rpi/agc.cpp | 4 +- src/ipa/rpi/controller/rpi/agc_channel.cpp | 2 +- src/ipa/rpi/controller/rpi/lux.cpp | 2 +- src/ipa/rpi/pisp/pisp.cpp | 2 +- src/ipa/rpi/vc4/vc4.cpp | 2 +- src/ipa/simple/soft_simple.cpp | 8 +-- src/libcamera/camera.cpp | 4 +- .../converter/converter_v4l2_m2m.cpp | 8 +-- src/libcamera/delayed_controls.cpp | 4 +- src/libcamera/media_device.cpp | 2 +- src/libcamera/pipeline/ipu3/cio2.cpp | 6 +-- src/libcamera/pipeline/ipu3/ipu3.cpp | 11 ++-- src/libcamera/pipeline/mali-c55/mali-c55.cpp | 2 +- .../pipeline/rpi/common/delayed_controls.cpp | 4 +- .../pipeline/rpi/common/pipeline_base.cpp | 29 ++++++----- .../pipeline/rpi/common/rpi_stream.cpp | 8 +-- src/libcamera/pipeline/rpi/pisp/pisp.cpp | 6 +-- src/libcamera/pipeline/rpi/vc4/vc4.cpp | 2 +- src/libcamera/pipeline/vimc/vimc.cpp | 10 ++-- src/libcamera/pipeline/virtual/virtual.cpp | 2 +- src/libcamera/sensor/camera_sensor_legacy.cpp | 4 +- src/libcamera/sensor/camera_sensor_raw.cpp | 4 +- src/libcamera/software_isp/software_isp.cpp | 3 +- src/libcamera/stream.cpp | 8 +-- src/libcamera/v4l2_videodevice.cpp | 8 ++- test/media_device/media_device_print_test.cpp | 10 ++-- test/v4l2_videodevice/buffer_cache.cpp | 2 +- 39 files changed, 125 insertions(+), 155 deletions(-) base-commit: 1dcf9957a47fb54fce4fbae9daec0b587e52562e