{"id":10324,"url":"https://patchwork.libcamera.org/api/patches/10324/?format=json","web_url":"https://patchwork.libcamera.org/patch/10324/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20201103155025.5948-4-laurent.pinchart@ideasonboard.com>","date":"2020-11-03T15:50:21","name":"[libcamera-devel,3/7] qcam: viewfinder_gl: Remove unneeded casts","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"c8440e5d0677320ee57babc25ce06227714fcc00","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/10324/mbox/","series":[{"id":1441,"url":"https://patchwork.libcamera.org/api/series/1441/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1441","date":"2020-11-03T15:50:18","name":"qcam: Miscellaneous shaders cleanups and RGB support","version":1,"mbox":"https://patchwork.libcamera.org/series/1441/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/10324/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/10324/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 59BB8BDB89\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  3 Nov 2020 15:51:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0D04862C74;\n\tTue,  3 Nov 2020 16:51:23 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 35FCB62BDA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  3 Nov 2020 16:51:20 +0100 (CET)","from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7B7D6563;\n\tTue,  3 Nov 2020 16:51:19 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"rUCLJFGZ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1604418679;\n\tbh=1yFu2Wy/3bm0tA+udZuRQXkFa4WmF/o1Sk99FGCTV8s=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=rUCLJFGZ/5U06ZsuZcDXt27iy2g3T4pDvV3AaDgzSUQ+FiJsR4rb14TNooD9J2ppz\n\tDUxb2ZURzmnoh+OoY7kyYvEPxybix5SrmuDTngJyqauRUr2NMdHpbGRdGeP98JAhup\n\tL80u4rudyXZ94x/cYE7A8MXx9ESDy8C5xeo45hlQ=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue,  3 Nov 2020 17:50:21 +0200","Message-Id":"<20201103155025.5948-4-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.27.0","In-Reply-To":"<20201103155025.5948-1-laurent.pinchart@ideasonboard.com>","References":"<20201103155025.5948-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH 3/7] qcam: viewfinder_gl: Remove unneeded\n\tcasts","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>","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>"},"content":"There's no need to cast the yuvData_ unsigned char pointer to a char\npointer before performing pointer arithmetics. Drop the unneeded casts.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/qcam/viewfinder_gl.cpp | 10 +++++-----\n 1 file changed, 5 insertions(+), 5 deletions(-)","diff":"diff --git a/src/qcam/viewfinder_gl.cpp b/src/qcam/viewfinder_gl.cpp\nindex c07292523504..dc35d4fd8505 100644\n--- a/src/qcam/viewfinder_gl.cpp\n+++ b/src/qcam/viewfinder_gl.cpp\n@@ -360,7 +360,7 @@ void ViewFinderGL::doRender()\n \t\t\t     0,\n \t\t\t     GL_RG,\n \t\t\t     GL_UNSIGNED_BYTE,\n-\t\t\t     (char *)yuvData_ + size_.width() * size_.height());\n+\t\t\t     yuvData_ + size_.width() * size_.height());\n \t\tshaderProgram_.setUniformValue(textureUniformU_, 1);\n \t\tbreak;\n \n@@ -390,7 +390,7 @@ void ViewFinderGL::doRender()\n \t\t\t     0,\n \t\t\t     GL_RED,\n \t\t\t     GL_UNSIGNED_BYTE,\n-\t\t\t     (char *)yuvData_ + size_.width() * size_.height());\n+\t\t\t     yuvData_ + size_.width() * size_.height());\n \t\tshaderProgram_.setUniformValue(textureUniformU_, 1);\n \n \t\t/* Activate texture V */\n@@ -404,7 +404,7 @@ void ViewFinderGL::doRender()\n \t\t\t     0,\n \t\t\t     GL_RED,\n \t\t\t     GL_UNSIGNED_BYTE,\n-\t\t\t     (char *)yuvData_ + size_.width() * size_.height() * 5 / 4);\n+\t\t\t     yuvData_ + size_.width() * size_.height() * 5 / 4);\n \t\tshaderProgram_.setUniformValue(textureUniformV_, 2);\n \t\tbreak;\n \n@@ -434,7 +434,7 @@ void ViewFinderGL::doRender()\n \t\t\t     0,\n \t\t\t     GL_RED,\n \t\t\t     GL_UNSIGNED_BYTE,\n-\t\t\t     (char *)yuvData_ + size_.width() * size_.height());\n+\t\t\t     yuvData_ + size_.width() * size_.height());\n \t\tshaderProgram_.setUniformValue(textureUniformV_, 2);\n \n \t\t/* Activate texture U */\n@@ -448,7 +448,7 @@ void ViewFinderGL::doRender()\n \t\t\t     0,\n \t\t\t     GL_RED,\n \t\t\t     GL_UNSIGNED_BYTE,\n-\t\t\t     (char *)yuvData_ + size_.width() * size_.height() * 5 / 4);\n+\t\t\t     yuvData_ + size_.width() * size_.height() * 5 / 4);\n \t\tshaderProgram_.setUniformValue(textureUniformU_, 1);\n \t\tbreak;\n \n","prefixes":["libcamera-devel","3/7"]}