From eab2479172b012ba2c48426c3d1877fc102369e1 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Tue, 10 Mar 2020 21:33:38 +0100 Subject: [PATCH] Some more clean up --- zathura/callbacks.c | 2 +- zathura/zathura.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/zathura/callbacks.c b/zathura/callbacks.c index 42a9f59..9fa18c2 100644 --- a/zathura/callbacks.c +++ b/zathura/callbacks.c @@ -131,7 +131,7 @@ cb_view_vadjustment_value_changed(GtkAdjustment* adjustment, gpointer data) const double position_x = zathura_document_get_position_x(zathura->document); const double position_y = zathura_adjustment_get_ratio(adjustment); - unsigned int page_id = position_to_page_number(zathura->document, position_x, position_y); + const unsigned int page_id = position_to_page_number(zathura->document, position_x, position_y); zathura_document_set_position_x(zathura->document, position_x); zathura_document_set_position_y(zathura->document, position_y); diff --git a/zathura/zathura.c b/zathura/zathura.c index c3599f5..44aabc7 100644 --- a/zathura/zathura.c +++ b/zathura/zathura.c @@ -1124,9 +1124,9 @@ document_open(zathura_t* zathura, const char* path, const char* uri, const char* GtkAdjustment* vadjustment = gtk_scrolled_window_get_vadjustment( GTK_SCROLLED_WINDOW(zathura->ui.session->gtk.view)); - const unsigned int view_width = (unsigned int)floor(gtk_adjustment_get_page_size(hadjustment)); + const unsigned int view_width = floor(gtk_adjustment_get_page_size(hadjustment)); zathura_document_set_viewport_width(zathura->document, view_width); - const unsigned int view_height = (unsigned int)floor(gtk_adjustment_get_page_size(vadjustment)); + const unsigned int view_height = floor(gtk_adjustment_get_page_size(vadjustment)); zathura_document_set_viewport_height(zathura->document, view_height); zathura_update_view_ppi(zathura); @@ -1135,7 +1135,7 @@ document_open(zathura_t* zathura, const char* path, const char* uri, const char* cb_widget_screen_changed(zathura->ui.session->gtk.view, NULL, zathura); /* get initial device scale */ - int device_factor = gtk_widget_get_scale_factor(zathura->ui.session->gtk.view); + const int device_factor = gtk_widget_get_scale_factor(zathura->ui.session->gtk.view); zathura_document_set_device_factors(zathura->document, device_factor, device_factor); /* create blank pages */