From patchwork Thu Feb 19 14:40:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 26192 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 BFF93C31E9 for ; Thu, 19 Feb 2026 14:40:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1B7A86224F; Thu, 19 Feb 2026 15:40:46 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="oCQcumWF"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1EEC3620C9 for ; Thu, 19 Feb 2026 15:40:44 +0100 (CET) Received: from killaraus.ideasonboard.com (unknown [83.245.237.175]) by perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id B24344D3 for ; Thu, 19 Feb 2026 15:39:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1771511991; bh=tlMFliMO6Ksm3PAKl8EU3/oBfkE+oVXd29NXIvTHllA=; h=From:To:Subject:Date:From; b=oCQcumWFJyQtGCBCva9mrEOgBbrmFCfJfhZgbZT9THSvpSOzQLJFnJufCuH9J89SH xKfuPHxybjzcTUiiVOGH+jcsxok6wGMepgTvYcNTg5U1t2tepgp75tmst6ddSVUHjV T6oGQ4q6E7k5unv+0YbNlJm9U9jgYbULzrwdJAvQ= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Subject: [PATCH v3 0/4] libcamera: Clean up iterators Date: Thu, 19 Feb 2026 15:40:36 +0100 Message-ID: <20260219144040.1615042-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/request.cpp | 3 +- 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 +- 40 files changed, 126 insertions(+), 157 deletions(-) base-commit: da12b1854fbc0ec32d3162a0ab97654fcb679ae3