[Xfce4-commits] [apps/xfce4-taskmanager] 01/01: Fix memory usage display (Bug #13371)

noreply at xfce.org noreply at xfce.org
Wed Feb 22 22:59:14 CET 2017


This is an automated email from the git hooks/post-receive script.

ochosi pushed a commit to branch master
in repository apps/xfce4-taskmanager.

commit 6c6b9f6cad4019c7b7d5929cedf8db64d97900c8
Author: Olivier Duchateau <duchateau.olivier at gmail.com>
Date:   Tue Feb 21 00:02:40 2017 +0100

    Fix memory usage display (Bug #13371)
---
 src/task-manager-freebsd.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/task-manager-freebsd.c b/src/task-manager-freebsd.c
index 065bc39..24c0122 100644
--- a/src/task-manager-freebsd.c
+++ b/src/task-manager-freebsd.c
@@ -26,11 +26,11 @@
 
 #include "task-manager.h"
 
-gulong
+guint64
 get_mem_by_bytes (const gchar *name)
 {
-	gulong buf;
-	gsize len = sizeof (gulong);
+	guint64 buf = 0;
+	gsize len = sizeof (buf);
 
 	if (sysctlbyname (name, &buf, &len, NULL, 0) < 0)
 		return 0;
@@ -41,13 +41,13 @@ get_mem_by_bytes (const gchar *name)
 guint64
 get_mem_by_pages (const gchar *name)
 {
-	gulong res;
+	guint64 res;
 
 	res = get_mem_by_bytes (name);
 	if (res > 0)
 		res = res * getpagesize ();
 
-	return (guint64) res;
+	return res;
 }
 
 gboolean
@@ -55,10 +55,10 @@ get_memory_usage (guint64 *memory_total, guint64 *memory_free, guint64 *memory_c
 {
 	/* Get memory usage */
 	{
-		*memory_total = (guint64) get_mem_by_bytes ("hw.physmem");;
+		*memory_total = get_mem_by_bytes ("hw.physmem");;
 		*memory_free = get_mem_by_pages ("vm.stats.vm.v_free_count");
 		*memory_cache = get_mem_by_pages ("vm.stats.vm.v_inactive_count");
-		*memory_buffers = (guint64) get_mem_by_bytes ("vfs.bufspace");
+		*memory_buffers = get_mem_by_bytes ("vfs.bufspace");
 	}
 
 	/* Get swap usage */

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list