From patchwork Tue Jan 21 18:50:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 22602 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 0999DC330F for ; Tue, 21 Jan 2025 18:50:59 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A87406855B; Tue, 21 Jan 2025 19:50:58 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=protonmail.com header.i=@protonmail.com header.b="BNf3LcRm"; dkim-atps=neutral Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5571C60380 for ; Tue, 21 Jan 2025 19:50:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1737485456; x=1737744656; bh=5i8jlI0r5scu2yXPeGcWMDWPcNk23fMJN2hE4FT/2nc=; h=Date:To:From:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=BNf3LcRmo+DgmkY4HvADX83nvZUqSTNY41F6jOiThxgNXSxv383yAqkdGFzoBU4VP jfUQqmqnSt+8yzeX1rAlEYgpGzxXlEOkFHq9ZMi2b4k4AbB1BRq+1Hj4/QGR/cEO6x D7pmf/8inSLMASfEjFAoo4xdarWmi2oye7/j9GixKLnU5ltjTQOKd+YMuaU+SLpEpz V7E45junt+W2CH3GW9FESTyke0iZvVt/XEy1mtcrRWbYFygPD7Ku3Yf+5qrI98ebzS +UPYFBcspvwsfZOyjEY1gPo+U7Wr6erFt0esZrw4KqTA2DEjQgZFdg8f3JzA1vPIHb 10G5bwpb3itwQ== Date: Tue, 21 Jan 2025 18:50:52 +0000 To: libcamera-devel@lists.libcamera.org From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [RFC PATCH v1 1/7] libcamera: base: log: Move all fields of `LogMessage` Message-ID: <20250121185044.300816-2-pobrn@protonmail.com> In-Reply-To: <20250121185044.300816-1-pobrn@protonmail.com> References: <20250121185044.300816-1-pobrn@protonmail.com> Feedback-ID: 20568564:user:proton X-Pm-Message-ID: 4b6c4e5ec3332e831eb0b7276d6d7b773a1fbcb7 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" Move all fields of `LogMessage` in the move constructor. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart --- src/libcamera/base/log.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libcamera/base/log.cpp b/src/libcamera/base/log.cpp index 3a656b8f0..61a43d525 100644 --- a/src/libcamera/base/log.cpp +++ b/src/libcamera/base/log.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include @@ -894,9 +895,10 @@ LogMessage::LogMessage(const char *fileName, unsigned int line, */ LogMessage::LogMessage(LogMessage &&other) : msgStream_(std::move(other.msgStream_)), category_(other.category_), - severity_(other.severity_) + severity_(std::exchange(other.severity_, LogInvalid)), + timestamp_(other.timestamp_), fileInfo_(std::move(other.fileInfo_)), + prefix_(std::move(other.prefix_)) { - other.severity_ = LogInvalid; } void LogMessage::init(const char *fileName, unsigned int line)