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

The component _index property is long but _getcomp_index returns int #1597

Open
g5t opened this issue Apr 12, 2024 · 1 comment
Open

The component _index property is long but _getcomp_index returns int #1597

g5t opened this issue Apr 12, 2024 · 1 comment

Comments

@g5t
Copy link
Contributor

g5t commented Apr 12, 2024

As seen in the code generator, the property of each component representing its position along the instrument is long valued

coutf(" long _index; /* e.g. %i index in TRACE list */", index);

The _getcomp_index function finds the component which has a user-provided name and returns an int valued index.

cout("int _getcomp_index(char* compname)");

This type difference is unlikely to produce problems, but may be problematic on systems where int and long are not type aliases for the same underlying integer value type.

To alleviate any possible comparison errors, the component _index and return value for _getcomp_index should have the same type -- either int or long.

@willend
Copy link
Contributor

willend commented Apr 12, 2024

I guess we can make/should do with int... :)

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

No branches or pull requests

2 participants