Skip to content

Use ISMISSING in place of MISSING#16

Open
ms609 wants to merge 6 commits intomasterfrom
R-combatibility
Open

Use ISMISSING in place of MISSING#16
ms609 wants to merge 6 commits intomasterfrom
R-combatibility

Conversation

@ms609
Copy link
Copy Markdown
Collaborator

@ms609 ms609 commented Nov 2, 2017

I am encountering a warning when using MorphyLib in R (i.e. copying the source files to my inapplicable package), because R defines a variable MISSING in its own header files, so when the Morphy library headers are called, MISSING is already defined.

An easy way to avoid this conflict would be to rename MISSING to ISMISSING, as I've suggested here; perhaps MPLMISSING would be better still.

Comment thread src/morphydefs.h
@@ -28,7 +28,7 @@ typedef double Mflt;
typedef unsigned int MPLstate;

#define NA ((MPLstate)0b1)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a quick comment, not that you guys care, but typically I like to prefix things like this, it makes the code more greppable. Try and grep the codebase for NA and see what you get... If it was something like MORPHY_NA, or MFL_ISMISSING etc... then it doesn't get lost so easily.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funny, I just read the comment on why the MISSING define was changed to ISMISSING... that is yet another reason to have prefixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants