linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: Alain Michaud <alainm@chromium.org>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: [BlueZ PATCH v3 4/4] fixing const decoration warnins on options.
Date: Fri, 29 May 2020 10:16:46 -0700	[thread overview]
Message-ID: <CABBYNZJJ751fxpjpZ0MFvUsQ21H9CptM_gySAgZbcGPwz76W2Q@mail.gmail.com> (raw)
In-Reply-To: <20200529153814.213125-5-alainm@chromium.org>

Hi Alain,

On Fri, May 29, 2020 at 8:41 AM Alain Michaud <alainm@chromium.org> wrote:
>
> This changes fixes const decoration warnins on options.

What us this fixing?

> ---
>
> Changes in v3: None
> Changes in v2: None
>
>  src/main.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/src/main.c b/src/main.c
> index ca27f313d..cea50a3d2 100644
> --- a/src/main.c
> +++ b/src/main.c
> @@ -80,7 +80,7 @@ static enum {
>         MPS_MULTIPLE,
>  } mps = MPS_OFF;
>
> -static const char *supported_options[] = {
> +static const char * const supported_options[] = {
>         "Name",
>         "Class",
>         "DiscoverableTimeout",
> @@ -129,7 +129,7 @@ static const char * const controller_options[] = {
>         NULL
>  };
>
> -static const char *policy_options[] = {
> +static const char * const policy_options[] = {
>         "ReconnectUUIDs",
>         "ReconnectAttempts",
>         "ReconnectIntervals",
> @@ -137,7 +137,7 @@ static const char *policy_options[] = {
>         NULL
>  };
>
> -static const char *gatt_options[] = {
> +static const char * const gatt_options[] = {
>         "Cache",
>         "KeySize",
>         "ExchangeMTU",
> @@ -146,8 +146,8 @@ static const char *gatt_options[] = {
>  };
>
>  static const struct group_table {
> -       const char *name;
> -       const char **options;
> +       const char * const name;
> +       const char * const * const options;
>  } valid_groups[] = {
>         { "General",    supported_options },
>         { "Controller", controller_options },
> @@ -243,7 +243,7 @@ static enum jw_repairing_t parse_jw_repairing(const char *jw_repairing)
>
>
>  static void check_options(GKeyFile *config, const char *group,
> -                                               const char **options)
> +                                       const char * const * const options)
>  {
>         char **keys;
>         int i;
> --
> 2.27.0.rc0.183.gde8f92d652-goog
>

I wonder how usufull is to tell it is a constant pointer to a constant
character given that is so rarely in the kernel and userspace,
something like const char * const * const would be very hard to keep
it readable.

-- 
Luiz Augusto von Dentz

  parent reply	other threads:[~2020-05-29 17:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-29 15:38 [BlueZ PATCH v3 0/4] Load default system configuration from file Alain Michaud
2020-05-29 15:38 ` [BlueZ PATCH v3 1/4] mgmt:adding load default system configuration definitions Alain Michaud
2020-06-04 22:58   ` Luiz Augusto von Dentz
2020-06-05 14:03     ` Alain Michaud
2020-05-29 15:38 ` [BlueZ PATCH v3 2/4] adapter:set default system configuration if available Alain Michaud
2020-05-29 16:10   ` [BlueZ,v3,2/4] " bluez.test.bot
2020-05-29 17:05   ` [BlueZ PATCH v3 2/4] " Luiz Augusto von Dentz
2020-05-30  0:21     ` Luiz Augusto von Dentz
2020-05-29 15:38 ` [BlueZ PATCH v3 3/4] main:read default system configuration from the conf file Alain Michaud
2020-05-29 16:10   ` [BlueZ,v3,3/4] " bluez.test.bot
2020-05-29 15:38 ` [BlueZ PATCH v3 4/4] fixing const decoration warnins on options Alain Michaud
2020-05-29 16:10   ` [BlueZ,v3,4/4] " bluez.test.bot
2020-05-29 17:16   ` Luiz Augusto von Dentz [this message]
2020-06-01 15:18     ` [BlueZ PATCH v3 4/4] " Alain Michaud
2020-06-10  8:55       ` Marcel Holtmann

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=CABBYNZJJ751fxpjpZ0MFvUsQ21H9CptM_gySAgZbcGPwz76W2Q@mail.gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=alainm@chromium.org \
    --cc=linux-bluetooth@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).