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 8f84638c356c2223aea9d24b984773e6bcdad9ca..6e70c3e7e1659890c5cbd3fd7e9ab875ae7a6a40 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);
 {
        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");
        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);
 {
        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");
        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 3e76fa914b3c78df751f3bc544b1c20f33ec226d..18d47dec1559510adb886796d5f8081e6327a2f8 100644 (file)
--- a/graph.c
+++ b/graph.c
@@ -53,13 +53,13 @@ struct graph {
        char *title;
        char *xtitle;
        char *ytitle;
        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_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;
 
 {
        struct graph *g;
 
diff --git a/graph.h b/graph.h
index 57c5bd32c53ede9373f30e12f01f82aaa9d557d7..156b8e92ce33e5b565ac9d2ab042bdfedb52dc66 100644 (file)
--- a/graph.h
+++ b/graph.h
@@ -3,7 +3,7 @@
 
 struct graph;
 
 
 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);
 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);