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

Replace types with standard C #250

Merged
merged 1 commit into from
Mar 27, 2017

Conversation

josesimoes
Copy link
Member

  • add struct for Monitor_Ping command

Signed-off-by: José Simões jose.simoes@eclo.solutions

- add struct for Monitor_Ping command

Signed-off-by: José Simões <jose.simoes@eclo.solutions>
@josesimoes josesimoes added Area: Interpreter Everything related with the interpreter, execution engine and such Area: Targets Type: enhancement labels Mar 27, 2017
@nfbot
Copy link
Member

nfbot commented Mar 27, 2017

Hi @josesimoes,

I'm nanoFramework bot.
Thank you for your contribution!

Everything seems to be in order.
A human will be reviewing it shortly. 😉

@josesimoes josesimoes merged commit c12a7dd into nanoframework:master Mar 27, 2017
@josesimoes josesimoes deleted the rework-wp-and-commands branch March 27, 2017 15:45
uint32_t m_source;
uint32_t m_dbg_flags;
unsigned int m_source;
unsigned int m_dbg_flags;

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry for hijacking, but I don't think you really want to do this - this structure is part of a public/shared interface, so it is important to use type of exact size here, which is uint32_t. int is platform dependent and the standard does not define its exact size (it only specifies min and max values and general size rules such as sizeof(char) <= sizeof(int) <= sizeof(long) etc.).

Even though majority of platforms for which nF is being compiled most likely have 32-bit int, making the above point somewhat moot, there could be exceptions; the use of well defined types at such places is a matter of a principle (e.g. char may or may not be signed, long may or may not be of same size as int etc.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Your comment is most valuable! Many thanks for pointing out this. 👍
Makes me wonder if the same applies to other types that have also been replaced...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Interpreter Everything related with the interpreter, execution engine and such Area: Targets Type: enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants