mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-11 13:50:48 -05:00
Fix compiler warnings about signed v.s. unsigned
This commit is contained in:
parent
382b93ae03
commit
1156c19cbf
1 changed files with 23 additions and 15 deletions
|
@ -426,7 +426,7 @@ static void create_visual_and_colormap ()
|
|||
*/
|
||||
static unsigned int color_get ( Display *display, const char *const name )
|
||||
{
|
||||
XColor color = { 0, };
|
||||
XColor color = { 0, 0, 0, 0, 0, 0 };
|
||||
// Special format.
|
||||
if ( strncmp ( name, "argb:", 5 ) == 0 ) {
|
||||
color.pixel = strtoul ( &name[5], NULL, 16 );
|
||||
|
@ -1523,7 +1523,7 @@ static void menu_update ( MenuState *state )
|
|||
state->h - line_height - ( config.padding ) - 1,
|
||||
state->w - ( ( config.padding ) ) - 1,
|
||||
state->h - line_height - ( config.padding ) - 1 );
|
||||
for ( int j = 0; j < num_switchers; j++ ) {
|
||||
for ( unsigned int j = 0; j < num_switchers; j++ ) {
|
||||
textbox_draw ( switchers[j].tb );
|
||||
}
|
||||
}
|
||||
|
@ -1746,7 +1746,7 @@ MenuReturn menu ( char **lines, unsigned int num_lines, char **input, char *prom
|
|||
if ( config.sidebar_mode == TRUE ) {
|
||||
int line_height = textbox_get_height ( state.text );
|
||||
int width = ( state.w - ( 2 * ( config.padding ) ) ) / num_switchers;
|
||||
for ( int j = 0; j < num_switchers; j++ ) {
|
||||
for ( unsigned int j = 0; j < num_switchers; j++ ) {
|
||||
switchers[j].tb = textbox_create ( main_window, &vinfo, map, TB_CENTER,
|
||||
config.padding + j * width, state.h - line_height - config.padding,
|
||||
width, line_height, ( j == curr_switcher ) ? HIGHLIGHT : NORMAL, switchers[j].name );
|
||||
|
@ -1951,7 +1951,7 @@ MenuReturn menu ( char **lines, unsigned int num_lines, char **input, char *prom
|
|||
// Free the switcher boxes.
|
||||
// When state is free'ed we should no longer need these.
|
||||
if ( config.sidebar_mode == TRUE ) {
|
||||
for ( int j = 0; j < num_switchers; j++ ) {
|
||||
for ( unsigned int j = 0; j < num_switchers; j++ ) {
|
||||
textbox_free ( switchers[j].tb );
|
||||
switchers[j].tb = NULL;
|
||||
}
|
||||
|
@ -2267,7 +2267,8 @@ static void run_switcher ( int do_fork, SwitcherMode mode )
|
|||
else if ( retv == PREVIOUS_DIALOG ) {
|
||||
if ( mode == 0 ) {
|
||||
mode = num_switchers - 1;
|
||||
}else {
|
||||
}
|
||||
else {
|
||||
mode = ( mode - 1 ) % num_switchers;
|
||||
}
|
||||
}
|
||||
|
@ -2704,9 +2705,10 @@ static inline void load_configuration ( Display *display )
|
|||
*/
|
||||
static void hup_action_handler ( int num )
|
||||
{
|
||||
if ( num == SIGHUP ) {
|
||||
/**
|
||||
* Open new connection to X. It seems the XResources do not get updated
|
||||
* on the old connection.
|
||||
* Open new connection to X. It seems the XResources do not get updated on the old
|
||||
* connection.
|
||||
*/
|
||||
Display *display = XOpenDisplay ( display_str );
|
||||
if ( display ) {
|
||||
|
@ -2714,6 +2716,7 @@ static void hup_action_handler ( int num )
|
|||
XCloseDisplay ( display );
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param pidfile The pidfile to create.
|
||||
*/
|
||||
|
@ -2914,7 +2917,12 @@ int main ( int argc, char *argv[] )
|
|||
}
|
||||
|
||||
// Setup handler for sighub (reload config)
|
||||
const struct sigaction hup_action = { hup_action_handler, };
|
||||
const struct sigaction hup_action = {
|
||||
.sa_handler = hup_action_handler,
|
||||
.sa_mask = 0,
|
||||
.sa_flags = 0,
|
||||
.sa_restorer = NULL
|
||||
};
|
||||
sigaction ( SIGHUP, &hup_action, NULL );
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue