From cb1cab71c83893568f40ef9e2707c5c69618980d Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 11 Apr 2018 13:10:42 -0400 Subject: [PATCH] Make some variables const --- zathura/zathura.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zathura/zathura.c b/zathura/zathura.c index 1fb6163..e6a67ab 100644 --- a/zathura/zathura.c +++ b/zathura/zathura.c @@ -163,7 +163,7 @@ zathura_update_view_ppi(zathura_t* zathura) } /* physical width of monitor */ - int width_mm = gdk_monitor_get_width_mm(monitor); + const int width_mm = gdk_monitor_get_width_mm(monitor); /* size of monitor in pixels */ GdkRectangle monitor_geom; @@ -184,7 +184,7 @@ zathura_update_view_ppi(zathura_t* zathura) { /* not using the cached value for the scale factor here to avoid issues * if this function is called before the cached value is updated */ - 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); girara_debug("on Wayland, correcting PPI for device scale factor = %d", device_factor); if (device_factor != 0) { ppi /= device_factor; @@ -192,7 +192,7 @@ zathura_update_view_ppi(zathura_t* zathura) } #endif - double current_ppi = zathura_document_get_viewport_ppi(zathura->document); + const double current_ppi = zathura_document_get_viewport_ppi(zathura->document); if (fabs(ppi - current_ppi) > DBL_EPSILON) { girara_debug("monitor width: %d mm, pixels: %d, ppi: %0.2f", width_mm, monitor_geom.width, ppi); zathura_document_set_viewport_ppi(zathura->document, ppi);