summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2014-08-22 09:43:26 +0200
committerDave Davenport <qball@gmpclient.org>2014-08-22 09:43:26 +0200
commit86b7571e04b356651a1720788a8e0868905ba409 (patch)
treef86bef6ef9fa434ab5439098928385a848627080
parent62d4f0cdad8ce1bbac6ad2279c707a92e36ee57e (diff)
Cleanup warnings.
* unused var and arguments.
-rw-r--r--source/history.c2
-rw-r--r--source/rofi.c16
-rw-r--r--source/run-dialog.c2
-rw-r--r--source/ssh-dialog.c2
-rw-r--r--source/textbox.c9
5 files changed, 11 insertions, 20 deletions
diff --git a/source/history.c b/source/history.c
index faacb001..779f6e1b 100644
--- a/source/history.c
+++ b/source/history.c
@@ -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.
if ( ( *length ) > 0 ) {
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 );
g_free ( list[iter] );
}
diff --git a/source/rofi.c b/source/rofi.c
index 6dab655f..08975800 100644
--- a/source/rofi.c
+++ b/source/rofi.c
@@ -87,8 +87,8 @@ typedef struct _Switcher
void *cb_data;
} Switcher;
-Switcher *switchers = NULL;
-int num_switchers = 0;
+Switcher *switchers = NULL;
+unsigned int num_switchers = 0;
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 )
{
- for ( int i = 0; i < num_switchers; i++ ) {
+ for ( unsigned int i = 0; i < num_switchers; i++ ) {
if ( strcmp ( switchers[i].name, name ) == 0 ) {
return i;
}
@@ -1479,7 +1479,7 @@ MenuReturn menu ( char **lines, unsigned int num_lines, char **input, char *prom
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 );
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
-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;
@@ -2148,17 +2148,17 @@ int main ( int argc, char *argv[] )
else{
// Daemon mode, Listen to key presses..
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 );
}
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 );
}
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 );
}
diff --git a/source/run-dialog.c b/source/run-dialog.c
index 1b7c5e90..6853aa7b 100644
--- a/source/run-dialog.c
+++ b/source/run-dialog.c
@@ -189,7 +189,7 @@ static char ** get_apps ( unsigned int *length )
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 selected_line = 0;
diff --git a/source/ssh-dialog.c b/source/ssh-dialog.c
index fc510159..dfc809cf 100644
--- a/source/ssh-dialog.c
+++ b/source/ssh-dialog.c
@@ -199,7 +199,7 @@ static char ** get_ssh ( unsigned int *length )
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;
// act as a launcher
diff --git a/source/textbox.c b/source/textbox.c
index 5641a2bb..0e57c3d6 100644
--- a/source/textbox.c
+++ b/source/textbox.c
@@ -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
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 ) );
tb->cursor = MAX ( 0, MIN ( ( int ) strlen ( text ), tb->cursor ) );
- textbox_extents ( tb );
}
void textbox_move ( textbox *tb, int x, int y )
@@ -228,7 +222,6 @@ void textbox_draw ( textbox *tb )
char *text = tb->text ? tb->text : "";
int text_len = strlen ( text );
- int length = text_len;
int font_height = textbox_get_font_height ( tb );
int line_width = 0;
@@ -313,7 +306,6 @@ void textbox_insert ( textbox *tb, int pos, char *str )
memmove ( at + slen, at, len - pos + 1 );
// insert new str
memmove ( at, str, slen );
- textbox_extents ( tb );
}
// remove text
@@ -324,7 +316,6 @@ void textbox_delete ( textbox *tb, int pos, int dlen )
// move everything after pos+dlen down
char *at = tb->text + pos;
memmove ( at, at + dlen, len - pos );
- textbox_extents ( tb );
}
// delete on character