Fixed restoration of the panel divider position.
[psensor.git] / src / graph.c
index fe90331..71090aa 100644 (file)
@@ -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 <cfg.h>
 #include <graph.h>
+#include <parray.h>
 #include <plog.h>
 #include <psensor.h>
 
@@ -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))