mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-25 13:55:34 -05:00
Cleanup warnings.
* unused var and arguments.
This commit is contained in:
parent
62d4f0cdad
commit
86b7571e04
5 changed files with 11 additions and 20 deletions
|
@ -257,7 +257,7 @@ char ** history_get_list ( const char *filename, unsigned int *length )
|
||||||
// Lists are always short, so performance should not be an issue.
|
// Lists are always short, so performance should not be an issue.
|
||||||
if ( ( *length ) > 0 ) {
|
if ( ( *length ) > 0 ) {
|
||||||
retv = g_malloc ( ( ( *length ) + 1 ) * sizeof ( char * ) );
|
retv = g_malloc ( ( ( *length ) + 1 ) * sizeof ( char * ) );
|
||||||
for ( int iter = 0; iter < ( *length ); iter++ ) {
|
for ( unsigned int iter = 0; iter < ( *length ); iter++ ) {
|
||||||
retv[iter] = g_strdup ( list[iter]->name );
|
retv[iter] = g_strdup ( list[iter]->name );
|
||||||
g_free ( list[iter] );
|
g_free ( list[iter] );
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ typedef struct _Switcher
|
||||||
} Switcher;
|
} Switcher;
|
||||||
|
|
||||||
Switcher *switchers = NULL;
|
Switcher *switchers = NULL;
|
||||||
int num_switchers = 0;
|
unsigned int num_switchers = 0;
|
||||||
|
|
||||||
|
|
||||||
void window_set_opacity ( Display *display, Window box, unsigned int opacity );
|
void window_set_opacity ( Display *display, Window box, unsigned int opacity );
|
||||||
|
@ -96,7 +96,7 @@ void window_set_opacity ( Display *display, Window box, unsigned int opacity );
|
||||||
|
|
||||||
int switcher_get ( const char *name )
|
int switcher_get ( const char *name )
|
||||||
{
|
{
|
||||||
for ( int i = 0; i < num_switchers; i++ ) {
|
for ( unsigned int i = 0; i < num_switchers; i++ ) {
|
||||||
if ( strcmp ( switchers[i].name, name ) == 0 ) {
|
if ( strcmp ( switchers[i].name, name ) == 0 ) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
@ -1479,7 +1479,7 @@ MenuReturn menu ( char **lines, unsigned int num_lines, char **input, char *prom
|
||||||
return retv;
|
return retv;
|
||||||
}
|
}
|
||||||
|
|
||||||
SwitcherMode run_switcher_window ( char **input, void *data )
|
SwitcherMode run_switcher_window ( char **input, G_GNUC_UNUSED void *data )
|
||||||
{
|
{
|
||||||
Screen *screen = DefaultScreenOfDisplay ( display );
|
Screen *screen = DefaultScreenOfDisplay ( display );
|
||||||
Window root = RootWindow ( display, XScreenNumberOfScreen ( screen ) );
|
Window root = RootWindow ( display, XScreenNumberOfScreen ( screen ) );
|
||||||
|
@ -1732,7 +1732,7 @@ static void handle_keypress ( XEvent *ev )
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert a Mod+key arg to mod mask and keysym
|
// convert a Mod+key arg to mod mask and keysym
|
||||||
static void parse_key ( Display *display, char *combo, unsigned int *mod, KeySym *key )
|
static void parse_key ( char *combo, unsigned int *mod, KeySym *key )
|
||||||
{
|
{
|
||||||
unsigned int modmask = 0;
|
unsigned int modmask = 0;
|
||||||
|
|
||||||
|
@ -2148,17 +2148,17 @@ int main ( int argc, char *argv[] )
|
||||||
else{
|
else{
|
||||||
// Daemon mode, Listen to key presses..
|
// Daemon mode, Listen to key presses..
|
||||||
if ( switcher_get ( "window" ) >= 0 ) {
|
if ( switcher_get ( "window" ) >= 0 ) {
|
||||||
parse_key ( display, config.window_key, &windows_modmask, &windows_keysym );
|
parse_key ( config.window_key, &windows_modmask, &windows_keysym );
|
||||||
grab_key ( display, windows_modmask, windows_keysym );
|
grab_key ( display, windows_modmask, windows_keysym );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( switcher_get ( "run" ) >= 0 ) {
|
if ( switcher_get ( "run" ) >= 0 ) {
|
||||||
parse_key ( display, config.run_key, &rundialog_modmask, &rundialog_keysym );
|
parse_key ( config.run_key, &rundialog_modmask, &rundialog_keysym );
|
||||||
grab_key ( display, rundialog_modmask, rundialog_keysym );
|
grab_key ( display, rundialog_modmask, rundialog_keysym );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( switcher_get ( "ssh" ) >= 0 ) {
|
if ( switcher_get ( "ssh" ) >= 0 ) {
|
||||||
parse_key ( display, config.ssh_key, &sshdialog_modmask, &sshdialog_keysym );
|
parse_key ( config.ssh_key, &sshdialog_modmask, &sshdialog_keysym );
|
||||||
grab_key ( display, sshdialog_modmask, sshdialog_keysym );
|
grab_key ( display, sshdialog_modmask, sshdialog_keysym );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -189,7 +189,7 @@ static char ** get_apps ( unsigned int *length )
|
||||||
return retv;
|
return retv;
|
||||||
}
|
}
|
||||||
|
|
||||||
SwitcherMode run_switcher_dialog ( char **input, void *data )
|
SwitcherMode run_switcher_dialog ( char **input, G_GNUC_UNUSED void *data )
|
||||||
{
|
{
|
||||||
int shift = 0;
|
int shift = 0;
|
||||||
int selected_line = 0;
|
int selected_line = 0;
|
||||||
|
|
|
@ -199,7 +199,7 @@ static char ** get_ssh ( unsigned int *length )
|
||||||
return retv;
|
return retv;
|
||||||
}
|
}
|
||||||
|
|
||||||
SwitcherMode ssh_switcher_dialog ( char **input, void *data )
|
SwitcherMode ssh_switcher_dialog ( char **input, G_GNUC_UNUSED void *data )
|
||||||
{
|
{
|
||||||
SwitcherMode retv = MODE_EXIT;
|
SwitcherMode retv = MODE_EXIT;
|
||||||
// act as a launcher
|
// act as a launcher
|
||||||
|
|
|
@ -122,11 +122,6 @@ void textbox_font ( textbox *tb, TextBoxFontType tbft )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// outer code may need line height, width, etc
|
|
||||||
void textbox_extents ( textbox *tb )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
// set the default text to display
|
// set the default text to display
|
||||||
void textbox_text ( textbox *tb, char *text )
|
void textbox_text ( textbox *tb, char *text )
|
||||||
{
|
{
|
||||||
|
@ -141,7 +136,6 @@ void textbox_text ( textbox *tb, char *text )
|
||||||
pango_layout_set_text ( tb->layout, tb->text, strlen ( tb->text ) );
|
pango_layout_set_text ( tb->layout, tb->text, strlen ( tb->text ) );
|
||||||
|
|
||||||
tb->cursor = MAX ( 0, MIN ( ( int ) strlen ( text ), tb->cursor ) );
|
tb->cursor = MAX ( 0, MIN ( ( int ) strlen ( text ), tb->cursor ) );
|
||||||
textbox_extents ( tb );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void textbox_move ( textbox *tb, int x, int y )
|
void textbox_move ( textbox *tb, int x, int y )
|
||||||
|
@ -228,7 +222,6 @@ void textbox_draw ( textbox *tb )
|
||||||
|
|
||||||
char *text = tb->text ? tb->text : "";
|
char *text = tb->text ? tb->text : "";
|
||||||
int text_len = strlen ( text );
|
int text_len = strlen ( text );
|
||||||
int length = text_len;
|
|
||||||
int font_height = textbox_get_font_height ( tb );
|
int font_height = textbox_get_font_height ( tb );
|
||||||
int line_width = 0;
|
int line_width = 0;
|
||||||
|
|
||||||
|
@ -313,7 +306,6 @@ void textbox_insert ( textbox *tb, int pos, char *str )
|
||||||
memmove ( at + slen, at, len - pos + 1 );
|
memmove ( at + slen, at, len - pos + 1 );
|
||||||
// insert new str
|
// insert new str
|
||||||
memmove ( at, str, slen );
|
memmove ( at, str, slen );
|
||||||
textbox_extents ( tb );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove text
|
// remove text
|
||||||
|
@ -324,7 +316,6 @@ void textbox_delete ( textbox *tb, int pos, int dlen )
|
||||||
// move everything after pos+dlen down
|
// move everything after pos+dlen down
|
||||||
char *at = tb->text + pos;
|
char *at = tb->text + pos;
|
||||||
memmove ( at, at + dlen, len - pos );
|
memmove ( at, at + dlen, len - pos );
|
||||||
textbox_extents ( tb );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// delete on character
|
// delete on character
|
||||||
|
|
Loading…
Reference in a new issue