[evince/gnome-3-36] window: Set page cache size with correct type



commit 4b7359f3b158a95f2b8a37e5cf984583773f6ada
Author: Marek Kasik <mkasik redhat com>
Date:   Wed Mar 3 17:15:58 2021 +0100

    window: Set page cache size with correct type
    
    ev_view_set_page_cache_size() accepts gsize as its second parameter
    but guint was passed in. This reduced maximal cache size considerably
    as its size is 4 bytes.
    Retyping the multiplication by "1024 * 1024" to gsize increases maximal
    configurable cache size beyond 4 GiB.

 shell/ev-window.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/shell/ev-window.c b/shell/ev-window.c
index bad76b44..aed7f02a 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -1460,7 +1460,7 @@ page_cache_size_changed (GSettings *settings,
 
        page_cache_mb = g_settings_get_uint (settings, GS_PAGE_CACHE_SIZE);
        ev_view_set_page_cache_size (EV_VIEW (priv->view),
-                                    page_cache_mb * 1024 * 1024);
+                                    (gsize) page_cache_mb * 1024 * 1024);
 }
 
 static void
@@ -7634,7 +7634,7 @@ ev_window_init (EvWindow *ev_window)
        page_cache_mb = g_settings_get_uint (ev_window_ensure_settings (ev_window),
                                             GS_PAGE_CACHE_SIZE);
        ev_view_set_page_cache_size (EV_VIEW (priv->view),
-                                    page_cache_mb * 1024 * 1024);
+                                    (gsize) page_cache_mb * 1024 * 1024);
        allow_links_change_zoom = g_settings_get_boolean (ev_window_ensure_settings (ev_window),
                                     GS_ALLOW_LINKS_CHANGE_ZOOM);
        ev_view_set_allow_links_change_zoom (EV_VIEW (priv->view),


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]