[libcamera-devel] [PATCH 3/7] qcam: viewfinder_gl: Remove unneeded casts
Andrey Konovalov
andrey.konovalov at linaro.org
Tue Nov 3 19:24:41 CET 2020
Hi Laurent,
Thanks for your patch!
Reviewed-by: Andrey Konovalov <andrey.konovalov at linaro.org>
Thanks,
Andrey
On 03.11.2020 18:50, Laurent Pinchart wrote:
> There's no need to cast the yuvData_ unsigned char pointer to a char
> pointer before performing pointer arithmetics. Drop the unneeded casts.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
> src/qcam/viewfinder_gl.cpp | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/src/qcam/viewfinder_gl.cpp b/src/qcam/viewfinder_gl.cpp
> index c07292523504..dc35d4fd8505 100644
> --- a/src/qcam/viewfinder_gl.cpp
> +++ b/src/qcam/viewfinder_gl.cpp
> @@ -360,7 +360,7 @@ void ViewFinderGL::doRender()
> 0,
> GL_RG,
> GL_UNSIGNED_BYTE,
> - (char *)yuvData_ + size_.width() * size_.height());
> + yuvData_ + size_.width() * size_.height());
> shaderProgram_.setUniformValue(textureUniformU_, 1);
> break;
>
> @@ -390,7 +390,7 @@ void ViewFinderGL::doRender()
> 0,
> GL_RED,
> GL_UNSIGNED_BYTE,
> - (char *)yuvData_ + size_.width() * size_.height());
> + yuvData_ + size_.width() * size_.height());
> shaderProgram_.setUniformValue(textureUniformU_, 1);
>
> /* Activate texture V */
> @@ -404,7 +404,7 @@ void ViewFinderGL::doRender()
> 0,
> GL_RED,
> GL_UNSIGNED_BYTE,
> - (char *)yuvData_ + size_.width() * size_.height() * 5 / 4);
> + yuvData_ + size_.width() * size_.height() * 5 / 4);
> shaderProgram_.setUniformValue(textureUniformV_, 2);
> break;
>
> @@ -434,7 +434,7 @@ void ViewFinderGL::doRender()
> 0,
> GL_RED,
> GL_UNSIGNED_BYTE,
> - (char *)yuvData_ + size_.width() * size_.height());
> + yuvData_ + size_.width() * size_.height());
> shaderProgram_.setUniformValue(textureUniformV_, 2);
>
> /* Activate texture U */
> @@ -448,7 +448,7 @@ void ViewFinderGL::doRender()
> 0,
> GL_RED,
> GL_UNSIGNED_BYTE,
> - (char *)yuvData_ + size_.width() * size_.height() * 5 / 4);
> + yuvData_ + size_.width() * size_.height() * 5 / 4);
> shaderProgram_.setUniformValue(textureUniformU_, 1);
> break;
>
>
More information about the libcamera-devel
mailing list