summaryrefslogtreecommitdiffstats
path: root/source/dialogs/combi.c
diff options
context:
space:
mode:
authorQC <qball@gmpclient.org>2015-09-19 20:59:50 +0200
committerQC <qball@gmpclient.org>2015-09-19 21:00:06 +0200
commit31fe5759b8bede7a31535c61977b9efe2438d789 (patch)
treef5f8222d560ed666f85e9ee5f98fa958b6c2f39d /source/dialogs/combi.c
parentb18d68eff26429ed08d560b187c46770eb7db0b2 (diff)
More line fixing.
Diffstat (limited to 'source/dialogs/combi.c')
-rw-r--r--source/dialogs/combi.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/source/dialogs/combi.c b/source/dialogs/combi.c
index 8d611a6b..2feb291a 100644
--- a/source/dialogs/combi.c
+++ b/source/dialogs/combi.c
@@ -58,8 +58,7 @@ static void combi_mode_parse_switchers ( Switcher *sw )
// Make a copy, as strtok will modify it.
char *switcher_str = g_strdup ( config.combi_modi );
// Split token on ','. This modifies switcher_str.
- for ( char *token = strtok_r ( switcher_str, ",", &savept );
- token != NULL;
+ for ( char *token = strtok_r ( switcher_str, ",", &savept ); token != NULL;
token = strtok_r ( NULL, ",", &savept ) ) {
// Resize and add entry.
pd->switchers = (Switcher * *) g_realloc ( pd->switchers,
@@ -164,9 +163,7 @@ static SwitcherMode combi_mode_result ( int mretv, char **input, unsigned int se
for ( unsigned i = 0; i < pd->num_switchers; i++ ) {
if ( selected_line >= pd->starts[i] &&
selected_line < ( pd->starts[i] + pd->lengths[i] ) ) {
- return pd->switchers[i]->result ( mretv,
- input,
- selected_line - pd->starts[i],
+ return pd->switchers[i]->result ( mretv, input, selected_line - pd->starts[i],
pd->switchers[i] );
}
}
@@ -179,11 +176,8 @@ static int combi_mode_match ( char **tokens, const char *input,
for ( unsigned i = 0; i < pd->num_switchers; i++ ) {
if ( index >= pd->starts[i] && index < ( pd->starts[i] + pd->lengths[i] ) ) {
- return pd->switchers[i]->token_match ( tokens,
- input,
- case_sensitive,
- index - pd->starts[i],
- pd->switchers[i] );
+ return pd->switchers[i]->token_match ( tokens, input, case_sensitive,
+ index - pd->starts[i], pd->switchers[i] );
}
}
abort ();
@@ -193,11 +187,9 @@ static const char * combi_mgrv ( unsigned int selected_line, void *sw, int *stat
{
CombiModePrivateData *pd = ( (Switcher *) sw )->private_data;
for ( unsigned i = 0; i < pd->num_switchers; i++ ) {
- if ( selected_line >= pd->starts[i] && selected_line <
- ( pd->starts[i] + pd->lengths[i] ) ) {
+ if ( selected_line >= pd->starts[i] && selected_line < ( pd->starts[i] + pd->lengths[i] ) ) {
g_free ( pd->cache );
- pd->cache = g_strdup_printf ( "(%s) %s",
- pd->switchers[i]->name,
+ pd->cache = g_strdup_printf ( "(%s) %s", pd->switchers[i]->name,
pd->switchers[i]->mgrv ( selected_line - pd->starts[i],
(void *) pd->switchers[i], state ) );
return pd->cache;