diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-04-30 12:26:40 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-04-30 12:26:40 +0300 |
commit | fbc8bdac6efb0c63a73c5105bbf4ecb304187e44 (patch) | |
tree | fa5116b264d2880841044f5aa18542c465f7f97b /src/graph.c | |
parent | 5a1f674eecba607ffa328484ca34c598690ff8d2 (diff) | |
download | tagr-fbc8bdac6efb0c63a73c5105bbf4ecb304187e44.tar.gz tagr-fbc8bdac6efb0c63a73c5105bbf4ecb304187e44.tar.bz2 |
Grid step is double-precision.
* src/grid.c (struct grid): vmin, vmax and cur are double.
All uses updated.
* src/output.c (add_stats): Add zero stats if the queue is empty.
* src/readconfig.c: The argument to y-step is double.
* src/tagr.h (struct monitor.ystep): Change to double.
(struct grid_class.next): Return double.
(grid_next): Return double.
(grid_create): Change proto.
* src/graph.c: Update grid_next return values.
Diffstat (limited to 'src/graph.c')
-rw-r--r-- | src/graph.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/graph.c b/src/graph.c index 02e0586..80b2a97 100644 --- a/src/graph.c +++ b/src/graph.c @@ -89,7 +89,7 @@ draw_graph (FILE *fp, int full_xsize = graph_xsize + graph_h_margin[0] + graph_h_margin[1]; int full_ysize = graph_ysize + graph_v_margin[0] + graph_v_margin[1]; grid_t grid; - unsigned long ymax = mon->max_rate; + double ymax = mon->max_rate; yscale = (double) graph_ysize / ymax; xscale = (double) graph_xsize / xmax; @@ -210,16 +210,16 @@ draw_graph (FILE *fp, grid = grid_create (ygrid, dataq, 0, ymax, mon); if (grid) { - unsigned long i; + double d; char *str = NULL; draw_vtext (graph, i_grid, mon->rate_unit ? mon->rate_unit : rate_unit); /* Draw vertical grid */ - while ((i = grid_next (grid, &str, NULL)) < ymax) + while ((d = grid_next (grid, &str, NULL)) < ymax) { - int y = ytr (i); + int y = ytr (d); /* Left tick */ gdImageLine (graph, @@ -247,13 +247,13 @@ draw_graph (FILE *fp, grid = grid_create (xgrid, dataq, 0, xmax, &start); if (grid) { - unsigned long i; + double d; char *str = NULL; int mark; - while ((i = grid_next (grid, &str, &mark)) < xmax) + while ((d = grid_next (grid, &str, &mark)) < xmax) { - int x = xtr (i); + int x = xtr (d); /* Tick */ gdImageLine (graph, |