All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rosen Penev <rosenp@gmail.com>
To: Tomasz Figa <tfiga@chromium.org>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH 1/5] utils: fix compilation with C++98
Date: Thu, 7 May 2020 11:27:26 -0700	[thread overview]
Message-ID: <4810B27A-4B1C-4B70-A67A-5774B5548927@gmail.com> (raw)
In-Reply-To: <CAHD77H=x2audZcChjCgB=-f4YP2M2MWc5U=FiyXCedbQUPrRfg@mail.gmail.com>



> On May 7, 2020, at 4:54 AM, Tomasz Figa <tfiga@chromium.org> wrote:
> 
> HI Rosen,
> 
>> On Thu, Apr 23, 2020 at 11:10 PM Rosen Penev <rosenp@gmail.com> wrote:
>> 
>> Signed-off-by: Rosen Penev <rosenp@gmail.com>
>> ---
>> utils/cec-compliance/cec-test.cpp | 4 ++--
>> utils/rds-ctl/rds-ctl.cpp         | 2 +-
>> utils/v4l2-ctl/v4l2-ctl-tuner.cpp | 2 +-
>> 3 files changed, 4 insertions(+), 4 deletions(-)
>> 
> 
> First of all, thanks for the patch!
> 
> One question: In what case this file would end up being compiled in
> the C++98 mode?
-std=c++98 , using uClibc++.
> 
> Also, please see a comment inline.
> 
>> diff --git a/utils/cec-compliance/cec-test.cpp b/utils/cec-compliance/cec-test.cpp
>> index 032ff5ad..cc07998a 100644
>> --- a/utils/cec-compliance/cec-test.cpp
>> +++ b/utils/cec-compliance/cec-test.cpp
>> @@ -908,7 +908,7 @@ static int tuner_ctl_test(struct node *node, unsigned me, unsigned la, bool inte
>>                cec_msg_give_tuner_device_status(&msg, true, CEC_OP_STATUS_REQ_ONCE);
>>                fail_on_test(!transmit_timeout(node, &msg));
>>                fail_on_test(timed_out_or_abort(&msg));
>> -               info = {};
>> +               memset(&info, 0, sizeof(info));
>>                cec_ops_tuner_device_status(&msg, &info);
>>                if (!memcmp(&info, &info_vec[0], sizeof(info)))
>>                        break;
>> @@ -935,7 +935,7 @@ static int tuner_ctl_test(struct node *node, unsigned me, unsigned la, bool inte
>>                cec_msg_give_tuner_device_status(&msg, true, CEC_OP_STATUS_REQ_ONCE);
>>                fail_on_test(!transmit_timeout(node, &msg));
>>                fail_on_test(timed_out_or_abort(&msg));
>> -               info = {};
>> +               memset(&info, 0, sizeof(info));
>>                cec_ops_tuner_device_status(&msg, &info);
>>                if (memcmp(&info, &(*iter), sizeof(info))) {
>>                        log_tuner_service(info);
>> diff --git a/utils/rds-ctl/rds-ctl.cpp b/utils/rds-ctl/rds-ctl.cpp
>> index 0511fe5d..0e497b2a 100644
>> --- a/utils/rds-ctl/rds-ctl.cpp
>> +++ b/utils/rds-ctl/rds-ctl.cpp
>> @@ -918,7 +918,7 @@ static void get_options(const int fd, const int capabilities, struct v4l2_freque
>>                                printf("\tFrequency range      : %.1f MHz - %.1f MHz\n",
>>                                         vt.rangelow / 16.0, vt.rangehigh / 16.0);
>>                        printf("\tSignal strength/AFC  : %ld%%/%d\n",
>> -                               std::lround(vt.signal / 655.35), vt.afc);
>> +                               lround(vt.signal / 655.25), vt.afc);
> 
> Why the change from .35 to .25?
This looks like a mistake.
> 
> Best regards,
> Tomasz
> 
>>                        printf("\tCurrent audio mode   : %s\n", audmode2s(vt.audmode));
>>                        printf("\tAvailable subchannels: %s\n",
>>                                        rxsubchans2s(vt.rxsubchans).c_str());
>> diff --git a/utils/v4l2-ctl/v4l2-ctl-tuner.cpp b/utils/v4l2-ctl/v4l2-ctl-tuner.cpp
>> index bc397ec2..73dc323c 100644
>> --- a/utils/v4l2-ctl/v4l2-ctl-tuner.cpp
>> +++ b/utils/v4l2-ctl/v4l2-ctl-tuner.cpp
>> @@ -423,7 +423,7 @@ void tuner_get(cv4l_fd &_fd)
>> 
>>                        if (vt.type != V4L2_TUNER_SDR && vt.type != V4L2_TUNER_RF) {
>>                                printf("\tSignal strength/AFC  : %ld%%/%d\n",
>> -                                      std::lround(vt.signal / 655.35), vt.afc);
>> +                                      lround(vt.signal / 655.35), vt.afc);
>>                                printf("\tCurrent audio mode   : %s\n", audmode2s(vt.audmode));
>>                                printf("\tAvailable subchannels: %s\n", rxsubchans2s(vt.rxsubchans).c_str());
>>                        }
>> --
>> 2.25.3
>> 

      reply	other threads:[~2020-05-07 18:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-23 21:10 [PATCH 1/5] utils: fix compilation with C++98 Rosen Penev
2020-04-23 21:10 ` [PATCH 2/5] utils: add noreturn attribute and remove dead code Rosen Penev
2020-04-23 21:10 ` [PATCH 3/5] utils: fix implicit float conversions Rosen Penev
2020-04-23 21:10 ` [PATCH 4/5] utils: fix fallthrough warnings Rosen Penev
2020-04-23 21:10 ` [PATCH 5/5] utils: fix double promotions Rosen Penev
2020-05-07 11:54 ` [PATCH 1/5] utils: fix compilation with C++98 Tomasz Figa
2020-05-07 18:27   ` Rosen Penev [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4810B27A-4B1C-4B70-A67A-5774B5548927@gmail.com \
    --to=rosenp@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=tfiga@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.