Eliminate GMT_exit calls from gmt_map.c #3401
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of proposed changes
We had 20 or so calls to exit in gmt_map.c, mostly when some map projection parameters was not in a valid range. Many of these places were in void functions so no way to pass an error code up. I have changed this to allow the error code to be returned so that the appropriate higher level function called in the module can call Return (error) and die a normal death. Because many of these functions (e.g., gmt_init_distaz ) are called in modules this PR affects numerous files. I have slowly eliminated new bugs and fixed things until all tests again pass (for me).
I also had to make a fix in pscoast for -JE since there are times we paint lakes with the ocean color when we cannot do the recursive painting. However, we never considered -B+gfill setting in that scenario. This accected the placement.sh test and tnow the new pscoast_JE4.sh test. I also found a file in cache was still in a test dir, causing failure depending on which file was used.
Please run the test to see if you agree that all is well before you approve. Important that this is checked on WIn and Linux as well as macOS.