diff options
author | Dan Williams <dcbw@redhat.com> | 2016-03-03 13:26:44 -0600 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2016-03-03 13:26:44 -0600 |
commit | 3465107153e373adfd4e50ac90259ed25d556bed (patch) | |
tree | 2bb7755187f3136555d401d16ded37dc415736ab /src | |
parent | fea234dd1ea6f8d558b32d93e127a5bd73e5ae04 (diff) | |
download | external_libqmi-3465107153e373adfd4e50ac90259ed25d556bed.zip external_libqmi-3465107153e373adfd4e50ac90259ed25d556bed.tar.gz external_libqmi-3465107153e373adfd4e50ac90259ed25d556bed.tar.bz2 |
trivial: whitespace fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/libqmi-glib/qmi-utils.c | 52 | ||||
-rw-r--r-- | src/libqmi-glib/test/test-port-context.c | 52 | ||||
-rw-r--r-- | src/qmi-proxy/qmi-proxy.c | 2 | ||||
-rw-r--r-- | src/qmicli/qmicli-dms.c | 16 | ||||
-rw-r--r-- | src/qmicli/qmicli-helpers.c | 42 | ||||
-rw-r--r-- | src/qmicli/qmicli-nas.c | 16 | ||||
-rw-r--r-- | src/qmicli/qmicli-pbm.c | 16 | ||||
-rw-r--r-- | src/qmicli/qmicli-uim.c | 16 | ||||
-rw-r--r-- | src/qmicli/qmicli-voice.c | 16 | ||||
-rw-r--r-- | src/qmicli/qmicli-wda.c | 16 | ||||
-rw-r--r-- | src/qmicli/qmicli-wds.c | 16 | ||||
-rw-r--r-- | src/qmicli/qmicli.c | 34 |
12 files changed, 147 insertions, 147 deletions
diff --git a/src/libqmi-glib/qmi-utils.c b/src/libqmi-glib/qmi-utils.c index d0df93b..a4028cb 100644 --- a/src/libqmi-glib/qmi-utils.c +++ b/src/libqmi-glib/qmi-utils.c @@ -47,32 +47,32 @@ __qmi_utils_str_hex (gconstpointer mem, gchar delimiter) { const guint8 *data = mem; - 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; - - /* 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; - } - - /* Set output string */ - return 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; + + /* 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; + } + + /* Set output string */ + return new_str; } /*****************************************************************************/ diff --git a/src/libqmi-glib/test/test-port-context.c b/src/libqmi-glib/test/test-port-context.c index e3ed94e..72407c2 100644 --- a/src/libqmi-glib/test/test-port-context.c +++ b/src/libqmi-glib/test/test-port-context.c @@ -51,32 +51,32 @@ str_hex (gconstpointer mem, gchar delimiter) { const guint8 *data = mem; - 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; - - /* 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; - } - - /* Set output string */ - return 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; + + /* 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; + } + + /* Set output string */ + return new_str; } /*****************************************************************************/ diff --git a/src/qmi-proxy/qmi-proxy.c b/src/qmi-proxy/qmi-proxy.c index b7053b2..fe51075 100644 --- a/src/qmi-proxy/qmi-proxy.c +++ b/src/qmi-proxy/qmi-proxy.c @@ -184,7 +184,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 (); diff --git a/src/qmicli/qmicli-dms.c b/src/qmicli/qmicli-dms.c index 5d080eb..7f1593f 100644 --- a/src/qmicli/qmicli-dms.c +++ b/src/qmicli/qmicli-dms.c @@ -265,16 +265,16 @@ static GOptionEntry entries[] = { GOptionGroup * qmicli_dms_get_option_group (void) { - GOptionGroup *group; + GOptionGroup *group; - group = g_option_group_new ("dms", - "DMS options", - "Show Device Management Service options", - NULL, - NULL); - g_option_group_add_entries (group, entries); + group = g_option_group_new ("dms", + "DMS options", + "Show Device Management Service options", + NULL, + NULL); + g_option_group_add_entries (group, entries); - return group; + return group; } gboolean diff --git a/src/qmicli/qmicli-helpers.c b/src/qmicli/qmicli-helpers.c index 205f319..5443cad 100644 --- a/src/qmicli/qmicli-helpers.c +++ b/src/qmicli/qmicli-helpers.c @@ -31,11 +31,11 @@ qmicli_get_raw_data_printable (const GArray *data, gsize max_line_length, const gchar *line_prefix) { - gsize i; - gsize j; + gsize i; + gsize j; gsize k; - gsize new_str_length; - gchar *new_str; + gsize new_str_length; + gchar *new_str; gsize prefix_len; guint n_lines; gboolean is_new_line; @@ -45,12 +45,12 @@ qmicli_get_raw_data_printable (const GArray *data, if (!data) return g_strdup (""); - /* 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 * data->len; + /* 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 * data->len; /* Effective max line length needs to be multiple of 3, we don't want to * split in half a given byte representation */ @@ -69,25 +69,25 @@ qmicli_get_raw_data_printable (const GArray *data, * line length */ new_str_length += (n_lines * prefix_len); - /* 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... */ + /* Print hexadecimal representation of each byte... */ is_new_line = TRUE; - for (i = 0, j = 0, k = 0; i < data->len; i++) { + for (i = 0, j = 0, k = 0; i < data->len; i++) { if (is_new_line) { strcpy (&new_str[j], line_prefix); j += strlen (line_prefix); is_new_line = FALSE; } - /* Print character in output string... */ - snprintf (&new_str[j], 3, "%02X", g_array_index (data, guint8, i)); + /* Print character in output string... */ + snprintf (&new_str[j], 3, "%02X", g_array_index (data, guint8, i)); j+=2; k+=2; - if (i != (data->len - 1) ) { - new_str[j] = ':'; + if (i != (data->len - 1) ) { + new_str[j] = ':'; j++; k++; } @@ -98,10 +98,10 @@ qmicli_get_raw_data_printable (const GArray *data, j++; is_new_line = TRUE; } - } + } - /* Set output string */ - return new_str; + /* Set output string */ + return new_str; } gboolean diff --git a/src/qmicli/qmicli-nas.c b/src/qmicli/qmicli-nas.c index c774bf4..312ae16 100644 --- a/src/qmicli/qmicli-nas.c +++ b/src/qmicli/qmicli-nas.c @@ -120,16 +120,16 @@ static GOptionEntry entries[] = { GOptionGroup * qmicli_nas_get_option_group (void) { - GOptionGroup *group; + GOptionGroup *group; - group = g_option_group_new ("nas", - "NAS options", - "Show Network Access Service options", - NULL, - NULL); - g_option_group_add_entries (group, entries); + group = g_option_group_new ("nas", + "NAS options", + "Show Network Access Service options", + NULL, + NULL); + g_option_group_add_entries (group, entries); - return group; + return group; } gboolean diff --git a/src/qmicli/qmicli-pbm.c b/src/qmicli/qmicli-pbm.c index 2e5f6d9..66fd1fb 100644 --- a/src/qmicli/qmicli-pbm.c +++ b/src/qmicli/qmicli-pbm.c @@ -59,16 +59,16 @@ static GOptionEntry entries[] = { GOptionGroup * qmicli_pbm_get_option_group (void) { - GOptionGroup *group; + GOptionGroup *group; - group = g_option_group_new ("pbm", - "PBM options", - "Show Phonebook Management options", - NULL, - NULL); - g_option_group_add_entries (group, entries); + group = g_option_group_new ("pbm", + "PBM options", + "Show Phonebook Management options", + NULL, + NULL); + g_option_group_add_entries (group, entries); - return group; + return group; } gboolean diff --git a/src/qmicli/qmicli-uim.c b/src/qmicli/qmicli-uim.c index abf8047..453b46d 100644 --- a/src/qmicli/qmicli-uim.c +++ b/src/qmicli/qmicli-uim.c @@ -100,16 +100,16 @@ static GOptionEntry entries[] = { GOptionGroup * qmicli_uim_get_option_group (void) { - GOptionGroup *group; + GOptionGroup *group; - group = g_option_group_new ("uim", - "UIM options", - "Show User Identity Module options", - NULL, - NULL); - g_option_group_add_entries (group, entries); + group = g_option_group_new ("uim", + "UIM options", + "Show User Identity Module options", + NULL, + NULL); + g_option_group_add_entries (group, entries); - return group; + return group; } gboolean diff --git a/src/qmicli/qmicli-voice.c b/src/qmicli/qmicli-voice.c index 6310cb1..c3729f9 100644 --- a/src/qmicli/qmicli-voice.c +++ b/src/qmicli/qmicli-voice.c @@ -65,16 +65,16 @@ static GOptionEntry entries[] = { GOptionGroup * qmicli_voice_get_option_group (void) { - GOptionGroup *group; + GOptionGroup *group; - group = g_option_group_new ("voice", - "VOICE options", - "Show Voice Service options", - NULL, - NULL); - g_option_group_add_entries (group, entries); + group = g_option_group_new ("voice", + "VOICE options", + "Show Voice Service options", + NULL, + NULL); + g_option_group_add_entries (group, entries); - return group; + return group; } gboolean diff --git a/src/qmicli/qmicli-wda.c b/src/qmicli/qmicli-wda.c index 5fdd41b..b88b16e 100644 --- a/src/qmicli/qmicli-wda.c +++ b/src/qmicli/qmicli-wda.c @@ -70,16 +70,16 @@ static GOptionEntry entries[] = { GOptionGroup * qmicli_wda_get_option_group (void) { - GOptionGroup *group; + GOptionGroup *group; - group = g_option_group_new ("wda", - "WDA options", - "Show Wireless Data Administrative options", - NULL, - NULL); - g_option_group_add_entries (group, entries); + group = g_option_group_new ("wda", + "WDA options", + "Show Wireless Data Administrative options", + NULL, + NULL); + g_option_group_add_entries (group, entries); - return group; + return group; } gboolean diff --git a/src/qmicli/qmicli-wds.c b/src/qmicli/qmicli-wds.c index 06a8b92..b4b1a60 100644 --- a/src/qmicli/qmicli-wds.c +++ b/src/qmicli/qmicli-wds.c @@ -132,16 +132,16 @@ static GOptionEntry entries[] = { GOptionGroup * qmicli_wds_get_option_group (void) { - GOptionGroup *group; + GOptionGroup *group; - group = g_option_group_new ("wds", - "WDS options", - "Show Wireless Data Service options", - NULL, - NULL); - g_option_group_add_entries (group, entries); + group = g_option_group_new ("wds", + "WDS options", + "Show Wireless Data Service options", + NULL, + NULL); + g_option_group_add_entries (group, entries); - return group; + return group; } gboolean diff --git a/src/qmicli/qmicli.c b/src/qmicli/qmicli.c index 4960c78..85c2faa 100644 --- a/src/qmicli/qmicli.c +++ b/src/qmicli/qmicli.c @@ -704,29 +704,29 @@ int main (int argc, char **argv) /* Setup option context, process it and destroy it */ context = g_option_context_new ("- Control QMI devices"); - g_option_context_add_group (context, - qmicli_dms_get_option_group ()); - g_option_context_add_group (context, - qmicli_nas_get_option_group ()); - g_option_context_add_group (context, - qmicli_wds_get_option_group ()); - g_option_context_add_group (context, - qmicli_pbm_get_option_group ()); - g_option_context_add_group (context, - qmicli_uim_get_option_group ()); - g_option_context_add_group (context, - qmicli_wms_get_option_group ()); - g_option_context_add_group (context, - qmicli_wda_get_option_group ()); - g_option_context_add_group (context, - qmicli_voice_get_option_group ()); + g_option_context_add_group (context, + qmicli_dms_get_option_group ()); + g_option_context_add_group (context, + qmicli_nas_get_option_group ()); + g_option_context_add_group (context, + qmicli_wds_get_option_group ()); + g_option_context_add_group (context, + qmicli_pbm_get_option_group ()); + g_option_context_add_group (context, + qmicli_uim_get_option_group ()); + g_option_context_add_group (context, + qmicli_wms_get_option_group ()); + g_option_context_add_group (context, + qmicli_wda_get_option_group ()); + g_option_context_add_group (context, + qmicli_voice_get_option_group ()); g_option_context_add_main_entries (context, main_entries, NULL); if (!g_option_context_parse (context, &argc, &argv, &error)) { g_printerr ("error: %s\n", error->message); exit (EXIT_FAILURE); } - g_option_context_free (context); + g_option_context_free (context); if (version_flag) print_version_and_exit (); |