[gnome-system-monitor] Move load_graph data from float to natural double.
- From: Benoît Dejean <bdejean src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-system-monitor] Move load_graph data from float to natural double.
- Date: Tue, 28 Nov 2017 17:33:01 +0000 (UTC)
commit d576492876bce5f283fc03adc94adc6a9b768668
Author: Benoît Dejean <bdejean gmail com>
Date: Wed Nov 8 21:13:10 2017 +0100
Move load_graph data from float to natural double.
src/load-graph.cpp | 14 +++++++-------
src/load-graph.h | 4 ++--
2 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/load-graph.cpp b/src/load-graph.cpp
index 336917b..1def3d1 100644
--- a/src/load-graph.cpp
+++ b/src/load-graph.cpp
@@ -266,14 +266,14 @@ load_graph_draw (GtkWidget *widget,
if (drawSmooth) {
cairo_curve_to (cr,
x_offset - ((i - 0.5f) * graph->graph_delx),
- (1.0f - graph->data[i-1][j]) * graph->real_draw_height + 3.5f,
+ (1.0 - graph->data[i-1][j]) * graph->real_draw_height + 3.5,
x_offset - ((i - 0.5f) * graph->graph_delx),
- (1.0f - graph->data[i][j]) * graph->real_draw_height + 3.5f,
+ (1.0 - graph->data[i][j]) * graph->real_draw_height + 3.5,
x_offset - (i * graph->graph_delx),
- (1.0f - graph->data[i][j]) * graph->real_draw_height + 3.5f);
+ (1.0 - graph->data[i][j]) * graph->real_draw_height + 3.5);
} else {
cairo_line_to (cr, x_offset - (i * graph->graph_delx),
- (1.0f - graph->data[i][j]) * graph->real_draw_height + 3.5f);
+ (1.0 - graph->data[i][j]) * graph->real_draw_height + 3.5);
}
}
@@ -293,7 +293,7 @@ load_graph_draw (GtkWidget *widget,
void
load_graph_reset (LoadGraph *graph)
{
- std::fill(graph->data_block.begin(), graph->data_block.end(), -1.0f);
+ std::fill(graph->data_block.begin(), graph->data_block.end(), -1.0);
}
static void
@@ -410,7 +410,7 @@ get_memory (LoadGraph *graph)
gtk_widget_set_sensitive (GTK_WIDGET (graph->swap_color_picker), swap.total > 0);
graph->data[0][0] = mempercent;
- graph->data[0][1] = swap.total>0 ? swappercent : -1.0f;
+ graph->data[0][1] = swap.total>0 ? swappercent : -1.0;
}
/* Nice Numbers for Graph Labels after Paul Heckbert
@@ -820,7 +820,7 @@ LoadGraph::LoadGraph(guint type)
/* Allocate data in a contiguous block */
- data_block = std::vector<float>(n * LoadGraph::NUM_POINTS, -1.0f);
+ data_block = std::vector<double>(n * LoadGraph::NUM_POINTS, -1.0);
for (guint i = 0; i < LoadGraph::NUM_POINTS; ++i)
data[i] = &data_block[0] + i * n;
diff --git a/src/load-graph.h b/src/load-graph.h
index 3ebf708..16e399e 100644
--- a/src/load-graph.h
+++ b/src/load-graph.h
@@ -62,8 +62,8 @@ struct LoadGraph
std::vector<GdkRGBA> colors;
- std::vector<float> data_block;
- gfloat* data[NUM_POINTS];
+ std::vector<double> data_block;
+ double* data[NUM_POINTS];
GtkBox *main_widget;
GtkDrawingArea *disp;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]