From 09437e3f0e22a0819cd841635f572dab88e644ad Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Tue, 10 May 2016 17:51:23 +0200 Subject: [PATCH] We don't have a negative page number. --- include/textbox.h | 18 +++++++++--------- include/view-internal.h | 2 +- source/view.c | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/textbox.h b/include/textbox.h index e08b88ed..afadd9e4 100644 --- a/include/textbox.h +++ b/include/textbox.h @@ -39,15 +39,15 @@ typedef struct typedef enum { - TB_AUTOHEIGHT = 1 << 0, - TB_AUTOWIDTH = 1 << 1, - TB_LEFT = 1 << 16, - TB_RIGHT = 1 << 17, - TB_CENTER = 1 << 18, - TB_EDITABLE = 1 << 19, - TB_MARKUP = 1 << 20, - TB_WRAP = 1 << 21, - TB_PASSWORD = 1 << 22, + TB_AUTOHEIGHT = 1 << 0, + TB_AUTOWIDTH = 1 << 1, + TB_LEFT = 1 << 16, + TB_RIGHT = 1 << 17, + TB_CENTER = 1 << 18, + TB_EDITABLE = 1 << 19, + TB_MARKUP = 1 << 20, + TB_WRAP = 1 << 21, + TB_PASSWORD = 1 << 22, } TextboxFlags; typedef enum diff --git a/include/view-internal.h b/include/view-internal.h index d041023a..4912da10 100644 --- a/include/view-internal.h +++ b/include/view-internal.h @@ -28,7 +28,7 @@ struct RofiViewState int update; int refilter; int rchanged; - int cur_page; + unsigned int cur_page; // Entries textbox *text; diff --git a/source/view.c b/source/view.c index d112f5f1..320a5db2 100644 --- a/source/view.c +++ b/source/view.c @@ -862,7 +862,7 @@ static unsigned int rofi_scroll_per_page ( RofiViewState * state ) } else{ // Do paginating - int page = ( state->max_elements > 0 ) ? ( state->selected / state->max_elements ) : 0; + unsigned int page = ( state->max_elements > 0 ) ? ( state->selected / state->max_elements ) : 0; offset = page * state->max_elements; state->last_offset = offset; if ( page != state->cur_page ) {