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

Eliminate some unnecessary macros #432

Closed
busstoptaktik opened this issue Oct 12, 2016 · 0 comments
Closed

Eliminate some unnecessary macros #432

busstoptaktik opened this issue Oct 12, 2016 · 0 comments
Assignees

Comments

@busstoptaktik
Copy link
Member

busstoptaktik commented Oct 12, 2016

The "error return macros" defined in projects.h are mostly unnecessary and makes the code harder to read.

They are used all in all 157 times all over the code base. I suggest to eliminate them (this is seconded by @kbevers in comments to pull request #431 )

# define E_ERROR(err) { pj_ctx_set_errno( P->ctx, err); freeup(P); return(0); }
# define E_ERROR_0 { freeup(P); return(0); }
# define F_ERROR { pj_ctx_set_errno( P->ctx, -20); return(xy); }
# define F3_ERROR { pj_ctx_set_errno( P->ctx, -20); return(xyz); }
# define I_ERROR { pj_ctx_set_errno( P->ctx, -20); return(lp); }
# define I3_ERROR { pj_ctx_set_errno( P->ctx, -20); return(lpz); }
@busstoptaktik busstoptaktik self-assigned this Oct 12, 2016
kbevers added a commit to kbevers/PROJ that referenced this issue Jul 17, 2017
Expanded *_ERROR* macros with calls to proj_errno_set() and proper
returns when necessary. Defined a bunch of new PJD_ERR_ constants in
projects.h that corresponds to the error numbers in pj_strerrno.c. A few
unknown error numbers were replaced by existing ones in pj_strerrno.c.

Fixes OSGeo#432.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants