cairo-chart: Make it clear that fabs() of integer values is intended.
[pspp] / src / output / cairo-chart.c
index 802aa07bd2a177ea39e12b8b26921999685f459c..db8eb67ecf45f65625bb2df0229a8b3335d6a17e 100644 (file)
@@ -389,8 +389,9 @@ xrchart_write_scale (cairo_t *cr, struct xrchart_geometry *geom,
   geom->axis[orient].max = upper;
   geom->axis[orient].min = lower;
 
-  geom->axis[orient].scale = (fabs (geom->axis[orient].data_max - geom->axis[orient].data_min)
-                             / fabs (geom->axis[orient].max - geom->axis[orient].min));
+  struct xrchart_axis *axis = &geom->axis[orient];
+  geom->axis[orient].scale = (fabs ((double) axis->data_max - axis->data_min)
+                             / fabs (axis->max - axis->min));
 
   if (orient == SCALE_ABSCISSA)
     {