mirror of https://github.com/davatorium/rofi.git
Cleanups (cppcheck)
This commit is contained in:
parent
f05f0de583
commit
f0b1998703
|
@ -129,7 +129,6 @@ Color color_get ( const char *const name );
|
||||||
void color_background ( cairo_t *d );
|
void color_background ( cairo_t *d );
|
||||||
void color_border ( cairo_t *d );
|
void color_border ( cairo_t *d );
|
||||||
void color_separator ( cairo_t *d );
|
void color_separator ( cairo_t *d );
|
||||||
void color_cache_reset ( void );
|
|
||||||
|
|
||||||
void x11_helper_set_cairo_rgba ( cairo_t *d, Color col );
|
void x11_helper_set_cairo_rgba ( cairo_t *d, Color col );
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
|
@ -455,13 +455,13 @@ static void _window_mode_load_data ( Mode *sw, unsigned int cd )
|
||||||
|
|
||||||
if ( ( c = window_client ( w ) ) ) {
|
if ( ( c = window_client ( w ) ) ) {
|
||||||
// final line format
|
// final line format
|
||||||
unsigned int wmdesktop;
|
|
||||||
char desktop[5];
|
char desktop[5];
|
||||||
desktop[0] = 0;
|
desktop[0] = 0;
|
||||||
size_t len =
|
size_t len =
|
||||||
( ( c->title != NULL ) ? strlen ( c->title ) : 0 ) + ( c->class ? strlen ( c->class ) : 0 ) + classfield + 50;
|
( ( c->title != NULL ) ? strlen ( c->title ) : 0 ) + ( c->class ? strlen ( c->class ) : 0 ) + classfield + 50;
|
||||||
char *line = g_malloc ( len );
|
char *line = g_malloc ( len );
|
||||||
if ( !pd->config_i3_mode ) {
|
if ( !pd->config_i3_mode ) {
|
||||||
|
unsigned int wmdesktop = 0;
|
||||||
// find client's desktop.
|
// find client's desktop.
|
||||||
xcb_get_property_cookie_t cookie;
|
xcb_get_property_cookie_t cookie;
|
||||||
xcb_get_property_reply_t *r;
|
xcb_get_property_reply_t *r;
|
||||||
|
|
|
@ -579,7 +579,6 @@ int config_sanity_check ( void )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PangoFontDescription * pfd = NULL;
|
|
||||||
if ( config.menu_font ) {
|
if ( config.menu_font ) {
|
||||||
PangoFontDescription *pfd = pango_font_description_from_string ( config.menu_font );
|
PangoFontDescription *pfd = pango_font_description_from_string ( config.menu_font );
|
||||||
const char *fam = pango_font_description_get_family ( pfd );
|
const char *fam = pango_font_description_get_family ( pfd );
|
||||||
|
|
|
@ -139,7 +139,7 @@ void i3_support_free_internals ( void )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
int i3_support_initialize ( void )
|
int i3_support_initialize ( G_GNUC_UNUSED xcb_stuff *xcb )
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,16 @@
|
||||||
// Pidfile.
|
// Pidfile.
|
||||||
char *pidfile = NULL;
|
char *pidfile = NULL;
|
||||||
const char *cache_dir = NULL;
|
const char *cache_dir = NULL;
|
||||||
struct xkb_stuff xkb = { NULL };
|
struct xkb_stuff xkb = {
|
||||||
|
.xcb_connection = NULL,
|
||||||
|
.context = NULL,
|
||||||
|
.keymap = NULL,
|
||||||
|
.state = NULL,
|
||||||
|
.compose = {
|
||||||
|
.table = NULL,
|
||||||
|
.state = NULL
|
||||||
|
}
|
||||||
|
};
|
||||||
char *config_path = NULL;
|
char *config_path = NULL;
|
||||||
// Array of modi.
|
// Array of modi.
|
||||||
Mode **modi = NULL;
|
Mode **modi = NULL;
|
||||||
|
@ -378,7 +387,6 @@ static int add_mode ( const char * token )
|
||||||
else{
|
else{
|
||||||
// Report error, don't continue.
|
// Report error, don't continue.
|
||||||
fprintf ( stderr, "Invalid script switcher: %s\n", token );
|
fprintf ( stderr, "Invalid script switcher: %s\n", token );
|
||||||
token = NULL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ( index == num_modi ) ? -1 : (int) index;
|
return ( index == num_modi ) ? -1 : (int) index;
|
||||||
|
|
|
@ -496,7 +496,7 @@ static xcb_window_t __create_window ( MenuFlags menu_flags )
|
||||||
{ 0,
|
{ 0,
|
||||||
0,
|
0,
|
||||||
XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_KEY_PRESS |
|
XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_KEY_PRESS |
|
||||||
XCB_EVENT_MASK_KEY_RELEASE | XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_FOCUS_CHANGE | XCB_EVENT_MASK_BUTTON_1_MOTION, map };
|
XCB_EVENT_MASK_KEY_RELEASE | XCB_EVENT_MASK_STRUCTURE_NOTIFY | XCB_EVENT_MASK_FOCUS_CHANGE | XCB_EVENT_MASK_BUTTON_1_MOTION,map };
|
||||||
|
|
||||||
xcb_window_t box = xcb_generate_id ( xcb->connection );
|
xcb_window_t box = xcb_generate_id ( xcb->connection );
|
||||||
xcb_create_window ( xcb->connection,
|
xcb_create_window ( xcb->connection,
|
||||||
|
|
|
@ -354,6 +354,7 @@ static unsigned int x11_find_mod_mask ( xkb_stuff *xkb, ... )
|
||||||
mask |= 1 << i;
|
mask |= 1 << i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
va_end ( names );
|
||||||
return mask;
|
return mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -613,12 +614,6 @@ static struct
|
||||||
unsigned int set;
|
unsigned int set;
|
||||||
} color_cache[3];
|
} color_cache[3];
|
||||||
|
|
||||||
void color_cache_reset ( void )
|
|
||||||
{
|
|
||||||
color_cache[BACKGROUND].set = FALSE;
|
|
||||||
color_cache[BORDER].set = FALSE;
|
|
||||||
color_cache[SEPARATOR].set = FALSE;
|
|
||||||
}
|
|
||||||
void color_background ( cairo_t *d )
|
void color_background ( cairo_t *d )
|
||||||
{
|
{
|
||||||
if ( !color_cache[BACKGROUND].set ) {
|
if ( !color_cache[BACKGROUND].set ) {
|
||||||
|
|
Loading…
Reference in New Issue