[{"id":14234,"web_url":"https://patchwork.libcamera.org/comment/14234/","msgid":"<CAO5uPHNjSomPo=ogynXQuGvn=3kyh+6sWPQDceXj1fzjd5WuVg@mail.gmail.com>","date":"2020-12-14T01:25:41","subject":"Re: [libcamera-devel] [PATCH] android: camera_device: Replace auto\n\twith explicit type","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Hi Laurent,\nThanks for this patch.\n\nOn Sat, Dec 12, 2020 at 12:42 PM Laurent Pinchart\n<laurent.pinchart@ideasonboard.com> wrote:\n>\n> The auto keyword facilitates writing code. It avoids typing out very\n> long types, which can make the code more readable, but it can also have\n> a negative impact on readability as it requires the reader (including\n> reviewers) to look up the type of the variable.\n>\n> Replace one occurrence of auto with the explicit type where doing so\n> doesn't require a long type name.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Hirokazu Honda <hiroh@chromium.org>\n\n> ---\n>  src/android/camera_device.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index 38689bdc40b1..79fd02eccdcd 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -199,7 +199,7 @@ void sortCamera3StreamConfigs(std::vector<Camera3StreamConfig> &unsortedConfigs,\n>         const auto nv12It = formatToConfigs.find(formats::NV12);\n>         if (nv12It != formatToConfigs.end()) {\n>                 auto &nv12Configs = nv12It->second;\n> -               const auto &nv12Largest = nv12Configs.back();\n> +               const Camera3StreamConfig *nv12Largest = nv12Configs.back();\n>\n>                 /*\n>                  * If JPEG will be created from NV12 and the size is larger than\n> --\n> Regards,\n>\n> Laurent Pinchart\n>","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 DE8D3C0F1A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 14 Dec 2020 01:25:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 422326158D;\n\tMon, 14 Dec 2020 02:25:52 +0100 (CET)","from mail-ed1-x541.google.com (mail-ed1-x541.google.com\n\t[IPv6:2a00:1450:4864:20::541])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C9CE1600EB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 14 Dec 2020 02:25:49 +0100 (CET)","by mail-ed1-x541.google.com with SMTP id dk8so15467368edb.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 13 Dec 2020 17:25:49 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"KvD72O8t\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=sq+hCa2R2bAprz+CdibrzfMB52+eLeatqGODgp8itw0=;\n\tb=KvD72O8tLexynOSYbzhQr41NOjvTVUef30TCmo9s7ozG8WhzG6PJZ/LbKpJsIsk700\n\tHp8FnWYlh7pAoPOIjGxX69sOajyi58QYBw0CsZZpIijvgh+me3UDAJtgwKH5cupZnML8\n\tCXWTSoO32XJ5+DXaqDLLd2Ca0ow9afW4M1/Ac=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=sq+hCa2R2bAprz+CdibrzfMB52+eLeatqGODgp8itw0=;\n\tb=n3eAUhmMUKtoqgmywOer69RWPhHky/nMW3hs2vLLaZrwFPFV21lq8//EhqUxULH2b7\n\tI87ju5A2e9jrEMAMlxJ77mewrQIwfPtWgPI6X8qQepuUL6oNdJJkBv3IuWxZ5kTNwoEh\n\tGYlrVPWnyp+7p9yr3whwVeQVZ9wCZUtgzUqR73ybLVMlckxkvJzTsvZ1fXuktj8b1i3/\n\tsNIRM0rSlV436SsiQ/T1ZKeGxWfoKPLwRX/xexSDVHDvygXSf546naevsLPlxxytM13/\n\tI381+xiuuAmAJCd8fA7wGxSZot/4atv1949y1vy9caE8Vd+jQogA1ohJjU9945mTuQu+\n\t9K1g==","X-Gm-Message-State":"AOAM530UJPEBcdI1cutsqPyDJMuse6A0rrpOQv4HVVqxG2SbJ9xb5m/T\n\tkELFXP2+MHnrNw7LK/iZrVlT8CzNhnkBFHLXJQv/w7/Bp7o=","X-Google-Smtp-Source":"ABdhPJyadiyjNoD26qSHEjapZyVXay/y8SgkZCFHnbUK/FgFzJriCB2GGMe9M4jjkyL1ls9jYcOYiuL7AXCZ41oe7nw=","X-Received":"by 2002:a05:6402:513:: with SMTP id\n\tm19mr6480495edv.244.1607909149357; \n\tSun, 13 Dec 2020 17:25:49 -0800 (PST)","MIME-Version":"1.0","References":"<20201212034211.25174-1-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20201212034211.25174-1-laurent.pinchart@ideasonboard.com>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Mon, 14 Dec 2020 10:25:41 +0900","Message-ID":"<CAO5uPHNjSomPo=ogynXQuGvn=3kyh+6sWPQDceXj1fzjd5WuVg@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] android: camera_device: Replace auto\n\twith explicit type","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>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":14240,"web_url":"https://patchwork.libcamera.org/comment/14240/","msgid":"<20201214074805.ee2w7wnq7yub6sjq@uno.localdomain>","date":"2020-12-14T07:48:05","subject":"Re: [libcamera-devel] [PATCH] android: camera_device: Replace auto\n\twith explicit type","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent,\n\nOn Sat, Dec 12, 2020 at 05:42:11AM +0200, Laurent Pinchart wrote:\n> The auto keyword facilitates writing code. It avoids typing out very\n> long types, which can make the code more readable, but it can also have\n> a negative impact on readability as it requires the reader (including\n> reviewers) to look up the type of the variable.\n>\n> Replace one occurrence of auto with the explicit type where doing so\n> doesn't require a long type name.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n  j\n\n> ---\n>  src/android/camera_device.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\n> index 38689bdc40b1..79fd02eccdcd 100644\n> --- a/src/android/camera_device.cpp\n> +++ b/src/android/camera_device.cpp\n> @@ -199,7 +199,7 @@ void sortCamera3StreamConfigs(std::vector<Camera3StreamConfig> &unsortedConfigs,\n>  \tconst auto nv12It = formatToConfigs.find(formats::NV12);\n>  \tif (nv12It != formatToConfigs.end()) {\n>  \t\tauto &nv12Configs = nv12It->second;\n> -\t\tconst auto &nv12Largest = nv12Configs.back();\n> +\t\tconst Camera3StreamConfig *nv12Largest = nv12Configs.back();\n>\n>  \t\t/*\n>  \t\t * If JPEG will be created from NV12 and the size is larger than\n> --\n> Regards,\n>\n> Laurent Pinchart\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","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 8E5FBBD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 14 Dec 2020 07:47:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 206FD6158A;\n\tMon, 14 Dec 2020 08:47:58 +0100 (CET)","from relay11.mail.gandi.net (relay11.mail.gandi.net\n\t[217.70.178.231])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3A483600EB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 14 Dec 2020 08:47:56 +0100 (CET)","from uno.localdomain (host-95-245-192-76.retail.telecomitalia.it\n\t[95.245.192.76]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay11.mail.gandi.net (Postfix) with ESMTPSA id 61CAD100004;\n\tMon, 14 Dec 2020 07:47:55 +0000 (UTC)"],"Date":"Mon, 14 Dec 2020 08:48:05 +0100","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20201214074805.ee2w7wnq7yub6sjq@uno.localdomain>","References":"<20201212034211.25174-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201212034211.25174-1-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] android: camera_device: Replace auto\n\twith explicit type","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>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]