[gnome-system-monitor] Fix cpu usage comparison with non-integers (refs #140)
- From: Robert Roth <robertroth src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-system-monitor] Fix cpu usage comparison with non-integers (refs #140)
- Date: Sun, 18 Oct 2020 10:05:56 +0000 (UTC)
commit 15fe2a8a4b082b71af4bc886200be4d747d0dfcb
Author: Robert Roth <robert roth off gmail com>
Date: Sun Oct 18 13:05:41 2020 +0300
Fix cpu usage comparison with non-integers (refs #140)
src/util.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/util.cpp b/src/util.cpp
index 7431121f..eaa8320b 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -262,14 +262,14 @@ get_relative_time(void)
return 1e-6 * g_get_monotonic_time () - start_time;
}
-static guint64
+static gdouble
get_size_from_column(GtkTreeModel* model, GtkTreeIter* first,
const guint index)
{
GValue value = { 0 };
gtk_tree_model_get_value(model, first, index, &value);
- guint64 size;
+ gdouble size;
switch (G_VALUE_TYPE(&value)) {
case G_TYPE_UINT:
size = g_value_get_uint(&value);
@@ -608,7 +608,7 @@ namespace procman
{
const guint index = GPOINTER_TO_UINT(user_data);
- guint64 size1, size2;
+ gdouble size1, size2;
size1 = get_size_from_column(model, first, index);
size2 = get_size_from_column(model, second, index);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]