From patchwork Tue Jun 9 21:11:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 4004 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 70BD6600F7 for ; Tue, 9 Jun 2020 23:11:34 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="f3ZuRrfs"; dkim-atps=neutral Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E3643291 for ; Tue, 9 Jun 2020 23:11:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1591737094; bh=maHI8NY0yGFsKaa5uwtC69vV2/haeoqNj3sf+VEM2Tk=; h=From:To:Subject:Date:From; b=f3ZuRrfsa74yPoNQcPNda1JUCFbZNVpqYgQwWexLD+RD28yNWmZksloJHQgCVtBd/ x5DgnkTkhYzU7JtwwgTD9hdwH6PLaKuntldepwY5uSo2F87CuTtw6JNzVRpRplH0Yp 5Zzf3PkqIzP7B1h274f01ceZfGuTb1Z3jsSHvFas= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Wed, 10 Jun 2020 00:11:10 +0300 Message-Id: <20200609211110.13440-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] android: camera_device: Use std::make_tuple() 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: , X-List-Received-Date: Tue, 09 Jun 2020 21:11:34 -0000 Until N4387 (https://wg21.link/N4387, applied as a defect report for C++11), a function could not return a tuple using copy-list-initialization. This affects gcc-5 that was released before N4387 was integrated, and causes a compilation error: ../../src/android/camera_device.cpp: In member function ‘std::tuple CameraDevice::calculateStaticMetadataSize()’: ../../src/android/camera_device.cpp:391:32: error: converting to ‘std::tuple’ from initializer list would use explicit constructor ‘constexpr std::tuple<_T1, _T2>::tuple(_U1&&, _U2&&) [with _U1 = unsigned int&; _U2 = unsigned int&; = void; _T1 = unsigned int; _T2 = unsigned int]’ return { numEntries, byteSize }; Fix it by using std::make_tuple(). Fixes: a80d38109f65 ("android: camera_device: Calculate metadata size") Signed-off-by: Laurent Pinchart Acked-by: Jacopo Mondi Reviewed-by: Niklas Söderlund --- src/android/camera_device.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 7a0dc530e35b..c56e2355f778 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -388,7 +388,7 @@ std::tuple CameraDevice::calculateStaticMetadataSize() */ byteSize += streamConfigurations_.size() * 52; - return { numEntries, byteSize }; + return std::make_tuple(numEntries, byteSize); } /*