[{"id":31376,"web_url":"https://patchwork.libcamera.org/comment/31376/","msgid":"<172733841774.3726802.15376612529738251095@ping.linuxembedded.co.uk>","date":"2024-09-26T08:13:37","subject":"Re: [PATCH] libcamera: Replace usage of lroundf() with std::lround()","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2024-09-26 01:23:35)\n> As explained in the coding style document, usage of std::lround() is\n> preferred over lroundf() as it picks the correct function based on\n> the argument type. Replace calls to lroundf() with std::lround() through\n> libcamera.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nSounds fine to me.\n\n\n> ---\n>  Documentation/guides/pipeline-handler.rst    | 4 ++--\n>  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 8 ++++----\n>  src/libcamera/pipeline/vimc/vimc.cpp         | 4 ++--\n>  3 files changed, 8 insertions(+), 8 deletions(-)\n> \n> diff --git a/Documentation/guides/pipeline-handler.rst b/Documentation/guides/pipeline-handler.rst\n> index 26aea43341d4..69e832a5587e 100644\n> --- a/Documentation/guides/pipeline-handler.rst\n> +++ b/Documentation/guides/pipeline-handler.rst\n> @@ -1350,7 +1350,7 @@ before being set.\n>                          continue;\n>                   }\n>  \n> -                 int32_t value = lroundf(it.second.get<float>() * 128 + offset);\n> +                 int32_t value = std::lround(it.second.get<float>() * 128 + offset);\n>                   controls.set(cid, std::clamp(value, 0, 255));\n>            }\n>  \n> @@ -1414,7 +1414,7 @@ value translation operations:\n>  \n>  .. code-block:: cpp\n>  \n> -   #include <math.h>\n> +   #include <cmath>\n\nIt looks like we have quite a few math.h usages throughout elsewhere. Should they\nall get changed too ?\n\nPerhaps they'll get changed in time.\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n>  \n>  Frame completion and event handling\n>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n> diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> index 6b32fa18799b..7fa01bb71744 100644\n> --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> @@ -6,9 +6,9 @@\n>   */\n>  \n>  #include <algorithm>\n> +#include <cmath>\n>  #include <fstream>\n>  #include <map>\n> -#include <math.h>\n>  #include <memory>\n>  #include <set>\n>  #include <string>\n> @@ -320,14 +320,14 @@ int PipelineHandlerUVC::processControl(ControlList *controls, unsigned int id,\n>         case V4L2_CID_BRIGHTNESS: {\n>                 float scale = std::max(max - def, def - min);\n>                 float fvalue = value.get<float>() * scale + def;\n> -               controls->set(cid, static_cast<int32_t>(lroundf(fvalue)));\n> +               controls->set(cid, static_cast<int32_t>(std::lround(fvalue)));\n>                 break;\n>         }\n>  \n>         case V4L2_CID_SATURATION: {\n>                 float scale = def - min;\n>                 float fvalue = value.get<float>() * scale + min;\n> -               controls->set(cid, static_cast<int32_t>(lroundf(fvalue)));\n> +               controls->set(cid, static_cast<int32_t>(std::lround(fvalue)));\n>                 break;\n>         }\n>  \n> @@ -354,7 +354,7 @@ int PipelineHandlerUVC::processControl(ControlList *controls, unsigned int id,\n>                 }\n>  \n>                 float fvalue = (value.get<float>() - p) / m;\n> -               controls->set(cid, static_cast<int32_t>(lroundf(fvalue)));\n> +               controls->set(cid, static_cast<int32_t>(std::lround(fvalue)));\n>                 break;\n>         }\n>  \n> diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\n> index 325174b90087..2165bae890cb 100644\n> --- a/src/libcamera/pipeline/vimc/vimc.cpp\n> +++ b/src/libcamera/pipeline/vimc/vimc.cpp\n> @@ -6,9 +6,9 @@\n>   */\n>  \n>  #include <algorithm>\n> +#include <cmath>\n>  #include <iomanip>\n>  #include <map>\n> -#include <math.h>\n>  #include <tuple>\n>  \n>  #include <linux/media-bus-format.h>\n> @@ -420,7 +420,7 @@ int PipelineHandlerVimc::processControls(VimcCameraData *data, Request *request)\n>                         continue;\n>                 }\n>  \n> -               int32_t value = lroundf(it.second.get<float>() * 128 + offset);\n> +               int32_t value = std::lround(it.second.get<float>() * 128 + offset);\n>                 controls.set(cid, std::clamp(value, 0, 255));\n>         }\n>  \n> \n> base-commit: f2088eb91fd6477b152233b9031cb115ca1ae824\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 70E9DC0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 26 Sep 2024 08:13:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 84D646350F;\n\tThu, 26 Sep 2024 10:13:42 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B71B9634FB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 26 Sep 2024 10:13:40 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A7800169;\n\tThu, 26 Sep 2024 10:12:12 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"FZJvTu2b\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1727338332;\n\tbh=JSASaQUhChxPGzyv4LIhnX/xlOz8oC71Hs+20DYPB1g=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=FZJvTu2bTPRpIS3qLNWBI86KbvtcVuYCXipBAmRZIA0YHbk6Hcx2YETlmLyBpuNZG\n\tz/zsRd6eTwNeaZw2Qo+XPwZbdNcOai1sFm5II9w3TRp1lSTtxXk+Fkb97dbWJKfwYz\n\tJaUjgM8dEnFWEwTPA8Sljwrtvk4USl0H/GN0FZFY=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240926002335.27509-1-laurent.pinchart@ideasonboard.com>","References":"<20240926002335.27509-1-laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH] libcamera: Replace usage of lroundf() with std::lround()","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 26 Sep 2024 09:13:37 +0100","Message-ID":"<172733841774.3726802.15376612529738251095@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":31384,"web_url":"https://patchwork.libcamera.org/comment/31384/","msgid":"<20240926092702.GB27736@pendragon.ideasonboard.com>","date":"2024-09-26T09:27:02","subject":"Re: [PATCH] libcamera: Replace usage of lroundf() with std::lround()","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Thu, Sep 26, 2024 at 09:13:37AM +0100, Kieran Bingham wrote:\n> Quoting Laurent Pinchart (2024-09-26 01:23:35)\n> > As explained in the coding style document, usage of std::lround() is\n> > preferred over lroundf() as it picks the correct function based on\n> > the argument type. Replace calls to lroundf() with std::lround() through\n> > libcamera.\n> > \n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> Sounds fine to me.\n> \n> > ---\n> >  Documentation/guides/pipeline-handler.rst    | 4 ++--\n> >  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 8 ++++----\n> >  src/libcamera/pipeline/vimc/vimc.cpp         | 4 ++--\n> >  3 files changed, 8 insertions(+), 8 deletions(-)\n> > \n> > diff --git a/Documentation/guides/pipeline-handler.rst b/Documentation/guides/pipeline-handler.rst\n> > index 26aea43341d4..69e832a5587e 100644\n> > --- a/Documentation/guides/pipeline-handler.rst\n> > +++ b/Documentation/guides/pipeline-handler.rst\n> > @@ -1350,7 +1350,7 @@ before being set.\n> >                          continue;\n> >                   }\n> >  \n> > -                 int32_t value = lroundf(it.second.get<float>() * 128 + offset);\n> > +                 int32_t value = std::lround(it.second.get<float>() * 128 + offset);\n> >                   controls.set(cid, std::clamp(value, 0, 255));\n> >            }\n> >  \n> > @@ -1414,7 +1414,7 @@ value translation operations:\n> >  \n> >  .. code-block:: cpp\n> >  \n> > -   #include <math.h>\n> > +   #include <cmath>\n> \n> It looks like we have quite a few math.h usages throughout elsewhere. Should they\n> all get changed too ?\n\nI'm on it.\n\n> Perhaps they'll get changed in time.\n> \n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> >  \n> >  Frame completion and event handling\n> >  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n> > diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > index 6b32fa18799b..7fa01bb71744 100644\n> > --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> > @@ -6,9 +6,9 @@\n> >   */\n> >  \n> >  #include <algorithm>\n> > +#include <cmath>\n> >  #include <fstream>\n> >  #include <map>\n> > -#include <math.h>\n> >  #include <memory>\n> >  #include <set>\n> >  #include <string>\n> > @@ -320,14 +320,14 @@ int PipelineHandlerUVC::processControl(ControlList *controls, unsigned int id,\n> >         case V4L2_CID_BRIGHTNESS: {\n> >                 float scale = std::max(max - def, def - min);\n> >                 float fvalue = value.get<float>() * scale + def;\n> > -               controls->set(cid, static_cast<int32_t>(lroundf(fvalue)));\n> > +               controls->set(cid, static_cast<int32_t>(std::lround(fvalue)));\n> >                 break;\n> >         }\n> >  \n> >         case V4L2_CID_SATURATION: {\n> >                 float scale = def - min;\n> >                 float fvalue = value.get<float>() * scale + min;\n> > -               controls->set(cid, static_cast<int32_t>(lroundf(fvalue)));\n> > +               controls->set(cid, static_cast<int32_t>(std::lround(fvalue)));\n> >                 break;\n> >         }\n> >  \n> > @@ -354,7 +354,7 @@ int PipelineHandlerUVC::processControl(ControlList *controls, unsigned int id,\n> >                 }\n> >  \n> >                 float fvalue = (value.get<float>() - p) / m;\n> > -               controls->set(cid, static_cast<int32_t>(lroundf(fvalue)));\n> > +               controls->set(cid, static_cast<int32_t>(std::lround(fvalue)));\n> >                 break;\n> >         }\n> >  \n> > diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\n> > index 325174b90087..2165bae890cb 100644\n> > --- a/src/libcamera/pipeline/vimc/vimc.cpp\n> > +++ b/src/libcamera/pipeline/vimc/vimc.cpp\n> > @@ -6,9 +6,9 @@\n> >   */\n> >  \n> >  #include <algorithm>\n> > +#include <cmath>\n> >  #include <iomanip>\n> >  #include <map>\n> > -#include <math.h>\n> >  #include <tuple>\n> >  \n> >  #include <linux/media-bus-format.h>\n> > @@ -420,7 +420,7 @@ int PipelineHandlerVimc::processControls(VimcCameraData *data, Request *request)\n> >                         continue;\n> >                 }\n> >  \n> > -               int32_t value = lroundf(it.second.get<float>() * 128 + offset);\n> > +               int32_t value = std::lround(it.second.get<float>() * 128 + offset);\n> >                 controls.set(cid, std::clamp(value, 0, 255));\n> >         }\n> >  \n> > \n> > base-commit: f2088eb91fd6477b152233b9031cb115ca1ae824\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 056DAC3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 26 Sep 2024 09:27:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 293B9634FB;\n\tThu, 26 Sep 2024 11:27:07 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8E620634F2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 26 Sep 2024 11:27:04 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4F6118D4;\n\tThu, 26 Sep 2024 11:25:36 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"k/MC7ZoH\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1727342736;\n\tbh=n0qNgVjODiDwfV8b5NGsmUT++UeaLVdPbFcDrsT0nTI=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=k/MC7ZoHyITszDFpO7chPWIXHOfUWSTX4FcY4KBptGlgF3ko+oZi3twwxs56/PrwK\n\tdWp9637/7FLaEMoRj9guvJc5ih0TIA6I8ljcVD7J01rctdxabwD2KbkXB0STSUHIsk\n\tOApvJiFhnZe7fiOI1xuYVpWj2o8VUCly/5TzaMYA=","Date":"Thu, 26 Sep 2024 12:27:02 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH] libcamera: Replace usage of lroundf() with std::lround()","Message-ID":"<20240926092702.GB27736@pendragon.ideasonboard.com>","References":"<20240926002335.27509-1-laurent.pinchart@ideasonboard.com>\n\t<172733841774.3726802.15376612529738251095@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<172733841774.3726802.15376612529738251095@ping.linuxembedded.co.uk>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":31405,"web_url":"https://patchwork.libcamera.org/comment/31405/","msgid":"<kwcado3fmnqhue677uh5ln4n2a7mtsk7c3vozfphwbyepr2dbv@gkeq4edyq2mn>","date":"2024-09-26T14:00:38","subject":"Re: [PATCH] libcamera: Replace usage of lroundf() with std::lround()","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi LAurent\n\nOn Thu, Sep 26, 2024 at 03:23:35AM GMT, Laurent Pinchart wrote:\n> As explained in the coding style document, usage of std::lround() is\n> preferred over lroundf() as it picks the correct function based on\n> the argument type. Replace calls to lroundf() with std::lround() through\n> libcamera.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nThanks\n  j\n\n> ---\n>  Documentation/guides/pipeline-handler.rst    | 4 ++--\n>  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 8 ++++----\n>  src/libcamera/pipeline/vimc/vimc.cpp         | 4 ++--\n>  3 files changed, 8 insertions(+), 8 deletions(-)\n>\n> diff --git a/Documentation/guides/pipeline-handler.rst b/Documentation/guides/pipeline-handler.rst\n> index 26aea43341d4..69e832a5587e 100644\n> --- a/Documentation/guides/pipeline-handler.rst\n> +++ b/Documentation/guides/pipeline-handler.rst\n> @@ -1350,7 +1350,7 @@ before being set.\n>                          continue;\n>                   }\n>\n> -                 int32_t value = lroundf(it.second.get<float>() * 128 + offset);\n> +                 int32_t value = std::lround(it.second.get<float>() * 128 + offset);\n>                   controls.set(cid, std::clamp(value, 0, 255));\n>            }\n>\n> @@ -1414,7 +1414,7 @@ value translation operations:\n>\n>  .. code-block:: cpp\n>\n> -   #include <math.h>\n> +   #include <cmath>\n>\n>  Frame completion and event handling\n>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n> diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> index 6b32fa18799b..7fa01bb71744 100644\n> --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n> @@ -6,9 +6,9 @@\n>   */\n>\n>  #include <algorithm>\n> +#include <cmath>\n>  #include <fstream>\n>  #include <map>\n> -#include <math.h>\n>  #include <memory>\n>  #include <set>\n>  #include <string>\n> @@ -320,14 +320,14 @@ int PipelineHandlerUVC::processControl(ControlList *controls, unsigned int id,\n>  \tcase V4L2_CID_BRIGHTNESS: {\n>  \t\tfloat scale = std::max(max - def, def - min);\n>  \t\tfloat fvalue = value.get<float>() * scale + def;\n> -\t\tcontrols->set(cid, static_cast<int32_t>(lroundf(fvalue)));\n> +\t\tcontrols->set(cid, static_cast<int32_t>(std::lround(fvalue)));\n>  \t\tbreak;\n>  \t}\n>\n>  \tcase V4L2_CID_SATURATION: {\n>  \t\tfloat scale = def - min;\n>  \t\tfloat fvalue = value.get<float>() * scale + min;\n> -\t\tcontrols->set(cid, static_cast<int32_t>(lroundf(fvalue)));\n> +\t\tcontrols->set(cid, static_cast<int32_t>(std::lround(fvalue)));\n>  \t\tbreak;\n>  \t}\n>\n> @@ -354,7 +354,7 @@ int PipelineHandlerUVC::processControl(ControlList *controls, unsigned int id,\n>  \t\t}\n>\n>  \t\tfloat fvalue = (value.get<float>() - p) / m;\n> -\t\tcontrols->set(cid, static_cast<int32_t>(lroundf(fvalue)));\n> +\t\tcontrols->set(cid, static_cast<int32_t>(std::lround(fvalue)));\n>  \t\tbreak;\n>  \t}\n>\n> diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\n> index 325174b90087..2165bae890cb 100644\n> --- a/src/libcamera/pipeline/vimc/vimc.cpp\n> +++ b/src/libcamera/pipeline/vimc/vimc.cpp\n> @@ -6,9 +6,9 @@\n>   */\n>\n>  #include <algorithm>\n> +#include <cmath>\n>  #include <iomanip>\n>  #include <map>\n> -#include <math.h>\n>  #include <tuple>\n>\n>  #include <linux/media-bus-format.h>\n> @@ -420,7 +420,7 @@ int PipelineHandlerVimc::processControls(VimcCameraData *data, Request *request)\n>  \t\t\tcontinue;\n>  \t\t}\n>\n> -\t\tint32_t value = lroundf(it.second.get<float>() * 128 + offset);\n> +\t\tint32_t value = std::lround(it.second.get<float>() * 128 + offset);\n>  \t\tcontrols.set(cid, std::clamp(value, 0, 255));\n>  \t}\n>\n>\n> base-commit: f2088eb91fd6477b152233b9031cb115ca1ae824\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 F3CCAC3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 26 Sep 2024 14:00:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B0D4A63502;\n\tThu, 26 Sep 2024 16:00:43 +0200 (CEST)","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 5DAFB634F9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 26 Sep 2024 16:00:41 +0200 (CEST)","from ideasonboard.com (mob-5-90-51-229.net.vodafone.it\n\t[5.90.51.229])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2DEBB169;\n\tThu, 26 Sep 2024 15:59:13 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"OyhDkGFF\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1727359153;\n\tbh=tz46OTmbVwRHgQWVJQb223XhlVV6iuQk/ZDw+BYXVbg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=OyhDkGFF91ZRyNRjGPlia1Agc6UHrbJcg+WSs+cyuLf5H2Jk0Ig34GsN9ZBW/pNI9\n\tAEYUsajg3OgxGoLZLv9tsxNngD9YL0Lj1Ps2w220XK5qnjXbIvPiHeM4YB4WkncY2z\n\tWrMMAJFKrRQVvMSH5JwM2NZzynlls7Wts102SSys=","Date":"Thu, 26 Sep 2024 16:00:38 +0200","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH] libcamera: Replace usage of lroundf() with std::lround()","Message-ID":"<kwcado3fmnqhue677uh5ln4n2a7mtsk7c3vozfphwbyepr2dbv@gkeq4edyq2mn>","References":"<20240926002335.27509-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240926002335.27509-1-laurent.pinchart@ideasonboard.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]