[PATCH] libmbim-glib, mbimcli: consistently use spaces for indentation

Aleksander Morgado aleksander at aleksander.es
Wed Mar 5 23:51:39 PST 2014


On Thu, Mar 6, 2014 at 6:45 AM, Ben Chan <benchan at chromium.org> wrote:
> ---
> This patch doesn't improve anything except it makes the code look properly
> indented in my editor, which configures tabs to be 8 characters (i.e. Linux
> kernel style). I'm usually afraid of making patches with only whitespace
> changes, but I guess there is no big merge going on at the moment :-)
>

Thanks, the attention to detail is appreciated. Most of the tabs you
changed are likely due to my coding style configuration switches in
emacs, as I usually work in other projects which use tabs for
indentation + spaces for alignment. Anyway, sure, no problem with
whitespace-only changes.

Pushed to git master.

>
>  src/libmbim-glib/mbim-message-private.h     |  2 +-
>  src/libmbim-glib/mbim-message.c             |  4 +--
>  src/libmbim-glib/mbim-utils.c               | 44 ++++++++++++++---------------
>  src/libmbim-glib/test/test-message-parser.c |  2 +-
>  src/mbimcli/mbimcli-basic-connect.c         | 16 +++++------
>  src/mbimcli/mbimcli-dss.c                   |  2 +-
>  src/mbimcli/mbimcli-phonebook.c             | 16 +++++------
>  src/mbimcli/mbimcli.c                       |  6 ++--
>  8 files changed, 46 insertions(+), 46 deletions(-)
>
> diff --git a/src/libmbim-glib/mbim-message-private.h b/src/libmbim-glib/mbim-message-private.h
> index 5d9d509..2bc64a0 100644
> --- a/src/libmbim-glib/mbim-message-private.h
> +++ b/src/libmbim-glib/mbim-message-private.h
> @@ -42,7 +42,7 @@ G_BEGIN_DECLS
>  /* Defined in the same way as GByteArray */
>  struct _MbimMessage {
>    guint8 *data;
> -  guint          len;
> +  guint   len;
>  };
>
>  /*****************************************************************************/
> diff --git a/src/libmbim-glib/mbim-message.c b/src/libmbim-glib/mbim-message.c
> index bbd9d5f..1a37766 100644
> --- a/src/libmbim-glib/mbim-message.c
> +++ b/src/libmbim-glib/mbim-message.c
> @@ -1274,10 +1274,10 @@ mbim_message_get_printable (const MbimMessage *self,
>       MBIM_MESSAGE_GET_MESSAGE_TYPE (self) == MBIM_MESSAGE_TYPE_INDICATE_STATUS)
>
>  #define MBIM_MESSAGE_FRAGMENT_GET_TOTAL(self)                           \
> -       GUINT32_FROM_LE (((struct full_message *)(self->data))->message.fragment.fragment_header.total)
> +    GUINT32_FROM_LE (((struct full_message *)(self->data))->message.fragment.fragment_header.total)
>
>  #define MBIM_MESSAGE_FRAGMENT_GET_CURRENT(self)                         \
> -       GUINT32_FROM_LE (((struct full_message *)(self->data))->message.fragment.fragment_header.current)
> +    GUINT32_FROM_LE (((struct full_message *)(self->data))->message.fragment.fragment_header.current)
>
>
>  gboolean
> diff --git a/src/libmbim-glib/mbim-utils.c b/src/libmbim-glib/mbim-utils.c
> index e2220c0..2e246a8 100644
> --- a/src/libmbim-glib/mbim-utils.c
> +++ b/src/libmbim-glib/mbim-utils.c
> @@ -44,32 +44,32 @@ __mbim_utils_str_hex (gconstpointer mem,
>                        gchar delimiter)
>  {
>      const guint8 *data = mem;
> -       gsize i;
> -       gsize j;
> -       gsize new_str_length;
> -       gchar *new_str;
> +    gsize i;
> +    gsize j;
> +    gsize new_str_length;
> +    gchar *new_str;
>
> -       /* Get new string length. If input string has N bytes, we need:
> -        * - 1 byte for last NUL char
> -        * - 2N bytes for hexadecimal char representation of each byte...
> -        * - N-1 bytes for the separator ':'
> -        * So... a total of (1+2N+N-1) = 3N bytes are needed... */
> -       new_str_length =  3 * size;
> +    /* Get new string length. If input string has N bytes, we need:
> +     * - 1 byte for last NUL char
> +     * - 2N bytes for hexadecimal char representation of each byte...
> +     * - N-1 bytes for the separator ':'
> +     * So... a total of (1+2N+N-1) = 3N bytes are needed... */
> +    new_str_length =  3 * size;
>
> -       /* Allocate memory for new array and initialize contents to NUL */
> -       new_str = g_malloc0 (new_str_length);
> +    /* Allocate memory for new array and initialize contents to NUL */
> +    new_str = g_malloc0 (new_str_length);
>
> -       /* Print hexadecimal representation of each byte... */
> -       for (i = 0, j = 0; i < size; i++, j += 3) {
> -               /* Print character in output string... */
> -               snprintf (&new_str[j], 3, "%02X", data[i]);
> -               /* And if needed, add separator */
> -               if (i != (size - 1) )
> -                       new_str[j + 2] = delimiter;
> -       }
> +    /* Print hexadecimal representation of each byte... */
> +    for (i = 0, j = 0; i < size; i++, j += 3) {
> +        /* Print character in output string... */
> +        snprintf (&new_str[j], 3, "%02X", data[i]);
> +        /* And if needed, add separator */
> +        if (i != (size - 1) )
> +            new_str[j + 2] = delimiter;
> +    }
>
> -       /* Set output string */
> -       return new_str;
> +    /* Set output string */
> +    return new_str;
>  }
>
>  /*****************************************************************************/
> diff --git a/src/libmbim-glib/test/test-message-parser.c b/src/libmbim-glib/test/test-message-parser.c
> index 8df8105..003a385 100644
> --- a/src/libmbim-glib/test/test-message-parser.c
> +++ b/src/libmbim-glib/test/test-message-parser.c
> @@ -153,7 +153,7 @@ test_message_parser_basic_connect_visible_providers (void)
>      g_assert_cmpuint (providers[0]->rssi, ==, 11);
>      g_assert_cmpuint (providers[0]->error_rate, ==, 0);
>
> -       /* Provider [1]:
> +    /* Provider [1]:
>       * Provider ID: '21403'
>       * Provider Name: 'Orange'
>       * State: 'home, visible, registered'
> diff --git a/src/mbimcli/mbimcli-basic-connect.c b/src/mbimcli/mbimcli-basic-connect.c
> index 8351244..037efcb 100644
> --- a/src/mbimcli/mbimcli-basic-connect.c
> +++ b/src/mbimcli/mbimcli-basic-connect.c
> @@ -168,16 +168,16 @@ static GOptionEntry entries[] = {
>  GOptionGroup *
>  mbimcli_basic_connect_get_option_group (void)
>  {
> -       GOptionGroup *group;
> +    GOptionGroup *group;
>
> -       group = g_option_group_new ("basic-connect",
> -                                   "Basic Connect options",
> -                                   "Show Basic Connect Service options",
> -                                   NULL,
> -                                   NULL);
> -       g_option_group_add_entries (group, entries);
> +    group = g_option_group_new ("basic-connect",
> +                                "Basic Connect options",
> +                                "Show Basic Connect Service options",
> +                                NULL,
> +                                NULL);
> +    g_option_group_add_entries (group, entries);
>
> -       return group;
> +    return group;
>  }
>
>  gboolean
> diff --git a/src/mbimcli/mbimcli-dss.c b/src/mbimcli/mbimcli-dss.c
> index a674dd6..5b1c83f 100644
> --- a/src/mbimcli/mbimcli-dss.c
> +++ b/src/mbimcli/mbimcli-dss.c
> @@ -69,7 +69,7 @@ mbimcli_dss_get_option_group (void)
>                                  NULL);
>      g_option_group_add_entries (group, entries);
>
> -       return group;
> +    return group;
>  }
>
>  gboolean
> diff --git a/src/mbimcli/mbimcli-phonebook.c b/src/mbimcli/mbimcli-phonebook.c
> index eb0b054..431748f 100644
> --- a/src/mbimcli/mbimcli-phonebook.c
> +++ b/src/mbimcli/mbimcli-phonebook.c
> @@ -80,16 +80,16 @@ static GOptionEntry entries[] = {
>  GOptionGroup *
>  mbimcli_phonebook_get_option_group (void)
>  {
> -       GOptionGroup *group;
> +    GOptionGroup *group;
>
> -       group = g_option_group_new ("phonebook",
> -                                   "Phonebook options",
> -                                   "Show Phonebook Service options",
> -                                   NULL,
> -                                   NULL);
> -       g_option_group_add_entries (group, entries);
> +    group = g_option_group_new ("phonebook",
> +                                "Phonebook options",
> +                                "Show Phonebook Service options",
> +                                NULL,
> +                                NULL);
> +    g_option_group_add_entries (group, entries);
>
> -       return group;
> +    return group;
>  }
>
>  gboolean
> diff --git a/src/mbimcli/mbimcli.c b/src/mbimcli/mbimcli.c
> index 05c9d84..9b3ef6d 100644
> --- a/src/mbimcli/mbimcli.c
> +++ b/src/mbimcli/mbimcli.c
> @@ -366,9 +366,9 @@ int main (int argc, char **argv)
>      /* Setup option context, process it and destroy it */
>      context = g_option_context_new ("- Control MBIM devices");
>      g_option_context_add_group (context,
> -                                   mbimcli_basic_connect_get_option_group ());
> +                                mbimcli_basic_connect_get_option_group ());
>      g_option_context_add_group (context,
> -                                   mbimcli_phonebook_get_option_group ());
> +                                mbimcli_phonebook_get_option_group ());
>      g_option_context_add_group (context,
>                                  mbimcli_dss_get_option_group ());
>      g_option_context_add_group (context,
> @@ -381,7 +381,7 @@ int main (int argc, char **argv)
>                      error->message);
>          exit (EXIT_FAILURE);
>      }
> -       g_option_context_free (context);
> +    g_option_context_free (context);
>
>      if (version_flag)
>          print_version_and_exit ();
> --
> 1.9.0.279.gdc9e3eb
>



-- 
Aleksander
https://aleksander.es


More information about the libmbim-devel mailing list