Some cleanups

This commit is contained in:
QC 2015-10-18 19:02:19 +02:00
parent e72da1bde5
commit 683632c36c
5 changed files with 14 additions and 10 deletions

View File

@ -574,10 +574,11 @@ void config_sanity_check ( Display *display )
}
}
if ( config.fullscreen && config.monitor != -1 ) {
g_string_append_printf ( msg, "\t<b>config.monitor</b>=%d is invalid. Value should be unset (-1) when fullscreen mode is enabled.\n",
config.monitor);
g_string_append_printf ( msg,
"\t<b>config.monitor</b>=%d is invalid. Value should be unset (-1) when fullscreen mode is enabled.\n",
config.monitor );
config.monitor = -1;
found_error = 1;
found_error = 1;
}
// Check size

View File

@ -1440,7 +1440,7 @@ void error_dialog ( const char *msg, int markup )
menu_calculate_window_and_element_width ( &state, &mon );
state.max_elements = 0;
state.text = textbox_create ( TB_AUTOHEIGHT | TB_WRAP + ( ( markup ) ? TB_MARKUP : 0 ),
state.text = textbox_create ( ( TB_AUTOHEIGHT | TB_WRAP ) + ( ( markup ) ? TB_MARKUP : 0 ),
( state.border ), ( state.border ),
( state.w - ( 2 * ( state.border ) ) ), 1, NORMAL, ( msg != NULL ) ? msg : "" );
state.line_height = textbox_get_height ( state.text );
@ -1889,6 +1889,7 @@ static gpointer rofi_signal_handler_process ( gpointer arg )
}
}
}
return NULL;
}
/**

View File

@ -64,21 +64,21 @@ void scrollbar_free ( scrollbar *sb )
void scrollbar_set_max_value ( scrollbar *sb, unsigned int max )
{
if ( sb != NULL ) {
sb->length = MAX ( 1, max );
sb->length = MAX ( 1u, max );
}
}
void scrollbar_set_handle ( scrollbar *sb, unsigned int pos )
{
if ( sb != NULL ) {
sb->pos = MIN ( sb->length, MAX ( 0, pos ) );
sb->pos = MIN ( sb->length, pos );
}
}
void scrollbar_set_handle_length ( scrollbar *sb, unsigned int pos_length )
{
if ( sb != NULL ) {
sb->pos_length = MIN ( sb->length, MAX ( 1, pos_length ) );
sb->pos_length = MIN ( sb->length, MAX ( 1u, pos_length ) );
}
}

View File

@ -590,7 +590,7 @@ static void textbox_parse_string ( Display *display, const char *str, RowColor
return;
}
char *cstr = g_strdup ( str );
char *endp;
char *endp = NULL;
char *token;
int index = 0;
for ( token = strtok_r ( cstr, ",", &endp ); token != NULL; token = strtok_r ( NULL, ",", &endp ) ) {

View File

@ -22,11 +22,13 @@ int show_error_message ( const char *msg, int markup )
return 0;
}
#include <x11-helper.h>
int monitor_get_smallest_size ( Display *d )
int monitor_get_smallest_size ( G_GNUC_UNUSED Display *d )
{
return 0;
}
int monitor_get_dimension ( Display *d, Screen *screen, int monitor, workarea *mon )
int monitor_get_dimension ( G_GNUC_UNUSED Display *d, G_GNUC_UNUSED Screen *screen, G_GNUC_UNUSED int monitor, G_GNUC_UNUSED workarea *mon )
{
return 0;
}
int main ( int argc, char ** argv )