Skip to content

Commit

Permalink
Only reset the column type at level zero. (#8124)
Browse files Browse the repository at this point in the history
This doesn't affect the CLI because it will end anyway but makes a difference for externals that keep the API alive between module calls.

Fixes #8115
  • Loading branch information
joa-quim authored Dec 4, 2023
1 parent ef015b1 commit 566a8dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gmt_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -16635,7 +16635,8 @@ void gmt_end_module (struct GMT_CTRL *GMT, struct GMT_CTRL *Ccopy) {
GMT->current.io.col[GMT_OUT][i].col = GMT->current.io.col[GMT_OUT][i].order = i; /* Default order */

for (i = 0; i < 2; i++) GMT->current.io.skip_if_NaN[i] = true; /* x/y must be non-NaN */
for (i = 0; i < 2; i++) gmt_set_column_type (GMT, GMT_IO, i, GMT_IS_UNKNOWN); /* Must be told [or find out] what x/y are */
if (GMT->hidden.func_level == 0) /* Only when top-level module ends. Doesn't affect CLI but useful for externals */
for (i = 0; i < 2; i++) gmt_set_column_type (GMT, GMT_IO, i, GMT_IS_UNKNOWN); /* Must be told [or find out] what x/y are */
for (i = 2; i < GMT_MAX_COLUMNS; i++) gmt_set_column_type (GMT, GMT_IO, i, GMT_IS_FLOAT); /* Other columns default to floats */
gmt_M_memset (GMT->current.io.col_set[GMT_X], GMT_MAX_COLUMNS, char); /* This is the initial state of input columns - all available to be changed by modules */
gmt_M_memset (GMT->current.io.col_set[GMT_Y], GMT_MAX_COLUMNS, char); /* This is the initial state of output columns - all available to be changed by modules */
Expand Down

0 comments on commit 566a8dc

Please sign in to comment.