Const making.

This commit is contained in:
Dave Davenport 2015-11-23 21:52:55 +01:00
parent 84daf5fd6c
commit ad778b7dc1
8 changed files with 15 additions and 15 deletions

View file

@ -288,7 +288,7 @@ struct _Switcher
* A switcher normally consists of the following parts: * A switcher normally consists of the following parts:
*/ */
void ( *init )( struct _Switcher *sw ); void ( *init )( struct _Switcher *sw );
unsigned int ( *get_num_entries )( struct _Switcher *sw ); unsigned int ( *get_num_entries )( const struct _Switcher *sw );
int ( *match )( char **tokens, const char *input, int case_sensitive, int index, struct _Switcher *data ); int ( *match )( char **tokens, const char *input, int case_sensitive, int index, struct _Switcher *data );
SwitcherMode ( *result )( int menu_retv, char **input, unsigned int selected_line, struct _Switcher *pd ); SwitcherMode ( *result )( int menu_retv, char **input, unsigned int selected_line, struct _Switcher *pd );
void ( *destroy )( struct _Switcher *pd ); void ( *destroy )( struct _Switcher *pd );

View file

@ -120,9 +120,9 @@ static void combi_mode_init ( Switcher *sw )
} }
} }
} }
static unsigned int combi_mode_get_num_entries ( Switcher *sw ) static unsigned int combi_mode_get_num_entries ( const Switcher *sw )
{ {
CombiModePrivateData *pd = sw->private_data; const CombiModePrivateData *pd = (const CombiModePrivateData *)sw->private_data;
return pd->cmd_list_length; return pd->cmd_list_length;
} }
static void combi_mode_destroy ( Switcher *sw ) static void combi_mode_destroy ( Switcher *sw )

View file

@ -96,9 +96,9 @@ static char **get_dmenu ( unsigned int *length )
return retv; return retv;
} }
static unsigned int dmenu_mode_get_num_entries ( Switcher *sw ) static unsigned int dmenu_mode_get_num_entries ( const Switcher *sw )
{ {
DmenuModePrivateData *rmpd = (DmenuModePrivateData *) sw->private_data; const DmenuModePrivateData *rmpd = (const DmenuModePrivateData *) sw->private_data;
return rmpd->cmd_list_length; return rmpd->cmd_list_length;
} }

View file

@ -317,9 +317,9 @@ static int drun_token_match ( char **tokens,
return 0; return 0;
} }
static unsigned int drun_mode_get_num_entries ( Switcher *sw ) static unsigned int drun_mode_get_num_entries ( const Switcher *sw )
{ {
DRunModePrivateData *pd = (DRunModePrivateData *) sw->private_data; const DRunModePrivateData *pd = (const DRunModePrivateData *) sw->private_data;
return pd->cmd_list_length; return pd->cmd_list_length;
} }
static int drun_is_not_ascii ( const Switcher *sw, unsigned int index ) static int drun_is_not_ascii ( const Switcher *sw, unsigned int index )

View file

@ -276,9 +276,9 @@ static void run_mode_init ( Switcher *sw )
} }
} }
static unsigned int run_mode_get_num_entries ( Switcher *sw ) static unsigned int run_mode_get_num_entries ( const Switcher *sw )
{ {
RunModePrivateData *rmpd = (RunModePrivateData *) sw->private_data; const RunModePrivateData *rmpd = (const RunModePrivateData *) sw->private_data;
return rmpd->cmd_list_length; return rmpd->cmd_list_length;
} }

View file

@ -105,9 +105,9 @@ static void script_mode_init ( Switcher *sw )
pd->cmd_list = get_script_output ( (const char *) sw->ed, &( pd->cmd_list_length ) ); pd->cmd_list = get_script_output ( (const char *) sw->ed, &( pd->cmd_list_length ) );
} }
} }
static unsigned int script_mode_get_num_entries ( Switcher *sw ) static unsigned int script_mode_get_num_entries ( const Switcher *sw )
{ {
ScriptModePrivateData *rmpd = (ScriptModePrivateData *) sw->private_data; const ScriptModePrivateData *rmpd = (const ScriptModePrivateData *) sw->private_data;
return rmpd->cmd_list_length; return rmpd->cmd_list_length;
} }

View file

@ -331,9 +331,9 @@ static void ssh_mode_init ( Switcher *sw )
} }
} }
static unsigned int ssh_mode_get_num_entries ( Switcher *sw ) static unsigned int ssh_mode_get_num_entries ( const Switcher *sw )
{ {
SSHModePrivateData *rmpd = (SSHModePrivateData *) sw->private_data; const SSHModePrivateData *rmpd = (const SSHModePrivateData *) sw->private_data;
return rmpd->cmd_list_length; return rmpd->cmd_list_length;
} }
static SwitcherMode ssh_mode_result ( int mretv, char **input, unsigned int selected_line, static SwitcherMode ssh_mode_result ( int mretv, char **input, unsigned int selected_line,

View file

@ -365,9 +365,9 @@ static int window_match ( char **tokens,
return match; return match;
} }
static unsigned int window_mode_get_num_entries ( Switcher *sw ) static unsigned int window_mode_get_num_entries ( const Switcher *sw )
{ {
SwitcherModePrivateData *pd = (SwitcherModePrivateData *) sw->private_data; const SwitcherModePrivateData *pd = (const SwitcherModePrivateData *) sw->private_data;
return pd->cmd_list_length; return pd->cmd_list_length;
} }
static void _window_mode_load_data ( Switcher *sw, unsigned int cd ) static void _window_mode_load_data ( Switcher *sw, unsigned int cd )