X-Git-Url: https://git.wpitchoune.net/gitweb/?p=psensor.git;a=blobdiff_plain;f=src%2Fgraph.c;h=71090aa4f4e38600da10a780e59e41bd04e2c5eb;hp=fe903314164be73c8a9208296b47fe21ef429dc8;hb=c1e20f2631a1249720e9c75d753eacfcb0f6c7b9;hpb=9a85d16663d7837698a3b00574a0652db1f849af diff --git a/src/graph.c b/src/graph.c index fe90331..71090aa 100644 --- a/src/graph.c +++ b/src/graph.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2014 jeanfi@gmail.com + * Copyright (C) 2010-2016 jeanfi@gmail.com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -247,7 +248,7 @@ static double dashes[] = { 1.0, /* ink */ 2.0, /* skip */ }; -static int ndash = sizeof(dashes) / sizeof(dashes[0]); +static int ndash = ARRAY_SIZE(dashes); static void draw_background_lines(cairo_t *cr, int min, int max, @@ -331,7 +332,8 @@ static void draw_sensor_smooth_curve(struct psensor *s, /* search the index of the first measure used as a start point * of a Bezier curve. The start and end points of the Bezier * curves must be preserved to ensure the same overall shape - * of the graph. */ + * of the graph. + */ i = 0; if (stimes) { while (i < s->values_max_length) { @@ -486,7 +488,6 @@ graph_update(struct psensor **sensors, cairo_text_extents_t te_btime, te_etime, te_max, te_min; struct psensor **sensor_cur, **enabled_sensors; GtkAllocation galloc; - GtkStyleContext *style_ctx; struct graph_info info; if (!gtk_widget_is_drawable(w_graph))