From 38973b5988b6916d13c35ee3c8abc26aacf99f35 Mon Sep 17 00:00:00 2001 From: sfeam Date: Mon, 9 Oct 2017 20:56:36 +0000 Subject: [PATCH] We have an enum AXIS_INDEX. Use it. --- ChangeLog | 3 +++ src/graphics.h | 12 ++++++++---- src/unset.c | 4 ++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 303baac46..0fcf2020a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ "set link x2 via f(x) inv g(x)" (primary axis x1). Bug #1973 + * src/graphics.h src/unset.c: We have an enum AXIS_INDEX. Use it. + (mostly to aid debugging; shouldn't affect code generation). + 2017-10-08 Ethan A Merritt * src/axis.c (reconcile_linked_axes) src/axis.h src/plot2d.c: diff --git a/src/graphics.h b/src/graphics.h index 2033b5565..a64dce520 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -1,5 +1,5 @@ /* - * $Id: graphics.h,v 1.73 2017-09-11 20:13:24 sfeam Exp $ + * $Id: graphics.h,v 1.74 2017-10-09 20:56:36 sfeam Exp $ */ /* GNUPLOT - graphics.h */ @@ -43,6 +43,10 @@ #include "gadgets.h" #include "term_api.h" +#ifndef AXIS_INDEX +#include "axis.h" +#endif + /* types defined for 2D plotting */ typedef struct curve_points { @@ -76,9 +80,9 @@ typedef struct curve_points { int boxplot_factors; /* Only used if plot_style == BOXPLOT */ int p_max; /* how many points are allocated */ int p_count; /* count of points in points */ - int x_axis; /* FIRST_X_AXIS or SECOND_X_AXIS */ - int y_axis; /* FIRST_Y_AXIS or SECOND_Y_AXIS */ - int z_axis; /* same as either x_axis or y_axis, for 5-column plot types */ + AXIS_INDEX x_axis; /* FIRST_X_AXIS or SECOND_X_AXIS */ + AXIS_INDEX y_axis; /* FIRST_Y_AXIS or SECOND_Y_AXIS */ + AXIS_INDEX z_axis; /* same as either x_axis or y_axis, for 5-column plot types */ int current_plotno; /* Only used by "pn" option of linespoints */ int n_par_axes; /* Only used for parallel axis plots */ double **z_n; /* Only used for parallel axis plots */ diff --git a/src/unset.c b/src/unset.c index 738f10528..bb1cd28d7 100644 --- a/src/unset.c +++ b/src/unset.c @@ -1,5 +1,5 @@ #ifndef lint -static char *RCSid() { return RCSid("$Id: unset.c,v 1.258 2017-09-11 20:13:24 sfeam Exp $"); } +static char *RCSid() { return RCSid("$Id: unset.c,v 1.259 2017-10-09 20:56:36 sfeam Exp $"); } #endif /* GNUPLOT - unset.c */ @@ -721,7 +721,7 @@ unset_autoscale() } else { /* HBB 20000506: parse axis name, and unset the right element * of the array: */ - int axis = lookup_table(axisname_tbl, c_token); + AXIS_INDEX axis = lookup_table(axisname_tbl, c_token); if (axis >= 0) { axis_array[axis].set_autoscale = AUTOSCALE_NONE; c_token++;