graph: use unsigned ints
authorJens Axboe <axboe@kernel.dk>
Wed, 7 Mar 2012 11:31:40 +0000 (12:31 +0100)
committerJens Axboe <axboe@kernel.dk>
Wed, 7 Mar 2012 11:31:40 +0000 (12:31 +0100)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
gfio.c
graph.c
graph.h

diff --git a/gfio.c b/gfio.c
index 8f84638..6e70c3e 100644 (file)
--- a/gfio.c
+++ b/gfio.c
@@ -124,8 +124,8 @@ static void setup_iops_graph(struct gui *ui)
 {
        if (ui->iops_graph)
                graph_free(ui->iops_graph);
-       ui->iops_graph = graph_new((int) DRAWING_AREA_XDIM / 2.0,
-                                       (int) DRAWING_AREA_YDIM);
+       ui->iops_graph = graph_new(DRAWING_AREA_XDIM / 2.0,
+                                       DRAWING_AREA_YDIM);
        graph_title(ui->iops_graph, "IOPS");
        graph_x_title(ui->iops_graph, "Time");
        graph_y_title(ui->iops_graph, "IOPS");
@@ -139,8 +139,8 @@ static void setup_bandwidth_graph(struct gui *ui)
 {
        if (ui->bandwidth_graph)
                graph_free(ui->bandwidth_graph);
-       ui->bandwidth_graph = graph_new((int) DRAWING_AREA_XDIM / 2.0,
-                                       (int) DRAWING_AREA_YDIM);
+       ui->bandwidth_graph = graph_new(DRAWING_AREA_XDIM / 2.0,
+                                               DRAWING_AREA_YDIM);
        graph_title(ui->bandwidth_graph, "Bandwidth");
        graph_x_title(ui->bandwidth_graph, "Time");
        graph_y_title(ui->bandwidth_graph, "Bandwidth");
diff --git a/graph.c b/graph.c
index 3e76fa9..18d47de 100644 (file)
--- a/graph.c
+++ b/graph.c
@@ -53,13 +53,13 @@ struct graph {
        char *title;
        char *xtitle;
        char *ytitle;
-       int xdim, ydim;
+       unsigned int xdim, ydim;
        struct graph_label *labels;
        struct graph_label *tail;
        int per_label_limit;
 };
 
-struct graph *graph_new(int xdim, int ydim)
+struct graph *graph_new(unsigned int xdim, unsigned int ydim)
 {
        struct graph *g;
 
diff --git a/graph.h b/graph.h
index 57c5bd3..156b8e9 100644 (file)
--- a/graph.h
+++ b/graph.h
@@ -3,7 +3,7 @@
 
 struct graph;
 
-struct graph *graph_new(int xdim, int ydim);
+struct graph *graph_new(unsigned int xdim, unsigned int ydim);
 void bar_graph_draw(struct graph *g, cairo_t *cr);
 void line_graph_draw(struct graph *g, cairo_t *cr);
 void line_graph_set_data_count_limit(struct graph *g, int per_label_limit);