Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the problem with -o and remote files. #8621

Merged
merged 1 commit into from
Nov 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions src/gmt_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -16663,22 +16663,24 @@ void gmt_end_module (struct GMT_CTRL *GMT, struct GMT_CTRL *Ccopy) {
without calling gmt_begin() again. This is need in externals that want to keep using the API
contents between diferent module calls.
*/
/* Reset default input column order */
for (i = 0; i < GMT_MAX_COLUMNS; i++)
GMT->current.io.col[GMT_IN][i].col = GMT->current.io.col[GMT_IN][i].order = i; /* Default order */
for (i = 0; i < GMT_MAX_COLUMNS; i++) GMT->current.io.col_skip[i] = false; /* Consider all input columns */
/* Reset default output column order */
for (i = 0; i < GMT_MAX_COLUMNS; i++)
GMT->current.io.col[GMT_OUT][i].col = GMT->current.io.col[GMT_OUT][i].order = i; /* Default order */
/* Reset default input column order, but not too soon (#8620) */
if (func_level_bak <= GMT_TOP_MODULE) {
for (i = 0; i < GMT_MAX_COLUMNS; i++)
GMT->current.io.col[GMT_IN][i].col = GMT->current.io.col[GMT_IN][i].order = i; /* Default order */
for (i = 0; i < GMT_MAX_COLUMNS; i++) GMT->current.io.col_skip[i] = false; /* Consider all input columns */
/* Reset default output column order */
for (i = 0; i < GMT_MAX_COLUMNS; i++)
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 */
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 */
gmt_M_memset (GMT->current.io.curr_rec, GMT_MAX_COLUMNS, double); /* Initialize current and previous records to zero */
gmt_M_memset (GMT->current.io.prev_rec, GMT_MAX_COLUMNS, double);
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 */
gmt_M_memset(GMT->current.io.curr_rec, GMT_MAX_COLUMNS, double); /* Initialize current and previous records to zero */
gmt_M_memset(GMT->current.io.prev_rec, GMT_MAX_COLUMNS, double);
GMT->current.io.record.data = GMT->current.io.curr_rec;
/* Time periodicity column */
GMT->current.io.cycle_col = GMT_NOTSET;
Expand Down
Loading