{"id":17237,"url":"https://patchwork.libcamera.org/api/1.1/patches/17237/?format=json","web_url":"https://patchwork.libcamera.org/patch/17237/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220829185849.1884517-2-marvin.schmidt1987@gmail.com>","date":"2022-08-29T18:58:47","name":"[libcamera-devel,1/3] test: camera: Remove redundant call of std::string::c_str()","commit_ref":"7354fb3b890bba37c81d70fc47f551d18be5c9ba","pull_url":null,"state":"accepted","archived":false,"hash":"7d748046824f0fa8db4cebf19159bbeee9a7b127","submitter":{"id":51,"url":"https://patchwork.libcamera.org/api/1.1/people/51/?format=json","name":"Marvin Schmidt","email":"marvin.schmidt1987@gmail.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/17237/mbox/","series":[{"id":3449,"url":"https://patchwork.libcamera.org/api/1.1/series/3449/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3449","date":"2022-08-29T18:58:46","name":"Remove redundant calls to std::string::c_str()","version":1,"mbox":"https://patchwork.libcamera.org/series/3449/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/17237/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/17237/checks/","tags":{},"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 18350C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 29 Aug 2022 18:59:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AABBE61FC2;\n\tMon, 29 Aug 2022 20:59:03 +0200 (CEST)","from mail-ej1-x635.google.com (mail-ej1-x635.google.com\n\t[IPv6:2a00:1450:4864:20::635])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4753F61FBA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Aug 2022 20:59:02 +0200 (CEST)","by mail-ej1-x635.google.com with SMTP id y3so17606636ejc.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Aug 2022 11:59:02 -0700 (PDT)","from pythagoras.local\n\t(dynamic-077-003-143-111.77.3.pool.telefonica.de. [77.3.143.111])\n\tby smtp.gmail.com with ESMTPSA id\n\t17-20020a170906211100b006fef0c7072esm4828136ejt.144.2022.08.29.11.59.00\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 29 Aug 2022 11:59:01 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1661799543;\n\tbh=Ep/F8ywxEYci28rZy4z6A3Drx4kokNEZUWQ2TnmvhsI=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=UU8koiLgbT0JXNyRGfXxBBwUBA35ZwkVMbCnI4d6vCd13VtPODGHI7xz8izaNG9eT\n\txeEdOgcbz6r0PsEnR2T0nP7X1HGgfXe9XkQIMDx/+RpjPgSVF7sbH448JpZdz4GA80\n\t6+QHpnP3vYjJuMKStRdM+dxvvqIAeJwxc/FGDU0faWsnNyC2H6DmOEeoLwoTv4MtiJ\n\tC6FW+sjORFNKGaEU7bD0XfzqUyg7+ivbZOpzInWtSm8JwLwlv3MQwvquW+Ikfm1nZ7\n\tCtINUqq0lVj1K3DvvtiN/UQU2Eta0tdykH6gYJ6i5o7vkjKjbVJO++lwnKVaQPURcS\n\tA30M/GWj+nIog==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc;\n\tbh=KYPO9091lscjawHuZzSZcftTdUaCoD2F4Td2XI55HEk=;\n\tb=GZPK23rTjP4TpSLJJAxH4fRjqGyugcm9LG7LxVqPU9TBc1B3PWlpKP2z8UK/QaOH5z\n\teV76JNMWt6eGwACcPJn2tD0Nhp2JHvtWFDRPvFJz23KI+0POGjb9a9bsr1NZfVh3BUt4\n\tE8IeHlJdeREV5rQy64oI/uvunfXDqaA8rPVamnwoDlOD8+V1u4Te7LV37QPRPfVX8U9G\n\t8/EfjDMgdUTnkGFCW6FiUV8GnWUffOfnDMvb4TSDz6/y5D0MUEm1jXXkMArT4AgE6sSX\n\tx0Tq0Crhx5ec62dvrG1TR7yKqBmgaL2A6eiOT3MCvddCK7bLyyzvhCfZA3dYLLbb6int\n\tH1Ow=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"GZPK23rT\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc;\n\tbh=KYPO9091lscjawHuZzSZcftTdUaCoD2F4Td2XI55HEk=;\n\tb=Ko0W1mc+Oitw3wCBkKrMQm451ZBO4y8DaNuyrt4AJUQ0DyJVZlXbgwqvm7rFR/sN1n\n\t11tooIMDdUFAs3Zor5YZMQD5PZu7yJYyv/jnYdNBwuRaa9BEm3bLxwf6RHG2WL6How0h\n\tiZr8q/zAczUrrnTgYdQ74Aa6tKz3CQ0CLOzNKT2q2ktRxkiTPb+C7hR0irbhLOuQaRZf\n\tQueUcOnkC8qoeZEC5EHlhacUJW7EEkNiTjTMcl3RYYi7LKtHW2FbMEFEJS/WWCJND0Ob\n\t+OlOwIwLhF8MI2smn4iM1g3rSSy9z7Vz6TCBehby+Gsn9CutUKYR0g027NF+WAqjTCGU\n\t+jRg==","X-Gm-Message-State":"ACgBeo3G75DLditYL8M383rtmGh8kAhanEx91wlhceUc6fiExvVteZmy\n\t4TdaZyJ8W1cQ1928cTvfzUDyRLflTIc=","X-Google-Smtp-Source":"AA6agR5lmP50Jly7/BP9yAVsRVRXfz5L41qhaYf8Z66NHWfeLkDFGgSqvK9BrmEX6s0mC/YNwfdb/w==","X-Received":"by 2002:a17:907:3d8b:b0:741:9f51:ac16 with SMTP id\n\the11-20020a1709073d8b00b007419f51ac16mr3223738ejc.39.1661799541613; \n\tMon, 29 Aug 2022 11:59:01 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 29 Aug 2022 20:58:47 +0200","Message-Id":"<20220829185849.1884517-2-marvin.schmidt1987@gmail.com>","X-Mailer":"git-send-email 2.37.2","In-Reply-To":"<20220829185849.1884517-1-marvin.schmidt1987@gmail.com>","References":"<20220829185849.1884517-1-marvin.schmidt1987@gmail.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 1/3] test: camera: Remove redundant call\n\tof std::string::c_str()","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>","From":"Marvin Schmidt via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Marvin Schmidt <marvin.schmidt1987@gmail.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"libcamera::File::exists() takes a const reference to a std::string and\nclang-tidy's readability-redundant-string-cstr check warns about it:\n\n> ../test/camera/camera_reconfigure.cpp:182:21: warning: redundant call to 'c_str' [readability-redundant-string-cstr]\n>                         if (File::exists(pname.c_str())) {\n>                                          ^~~~~~~~~~~~~\n>                                          pname\n\nSigned-off-by: Marvin Schmidt <marvin.schmidt1987@gmail.com>\n---\n test/camera/camera_reconfigure.cpp | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)","diff":"diff --git a/test/camera/camera_reconfigure.cpp b/test/camera/camera_reconfigure.cpp\nindex f6076baa..d12e2413 100644\n--- a/test/camera/camera_reconfigure.cpp\n+++ b/test/camera/camera_reconfigure.cpp\n@@ -179,7 +179,7 @@ private:\n \t\t\t\tcontinue;\n \n \t\t\tstring pname(\"/proc/\" + string(ptr->d_name) + \"/comm\");\n-\t\t\tif (File::exists(pname.c_str())) {\n+\t\t\tif (File::exists(pname)) {\n \t\t\t\tifstream pfile(pname.c_str());\n \t\t\t\tstring comm;\n \t\t\t\tgetline(pfile, comm);\n","prefixes":["libcamera-devel","1/3"]}