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

Integer signedness in API is inconsistent #80

Open
Sakarah opened this issue Oct 24, 2020 · 0 comments
Open

Integer signedness in API is inconsistent #80

Sakarah opened this issue Oct 24, 2020 · 0 comments

Comments

@Sakarah
Copy link
Contributor

Sakarah commented Oct 24, 2020

Currently with modern compilers, using the API of this library can generate a lot of warnings, or useless conversions simply because the API is not consistent about signedness of its integers...
To give a single example, in Tmx::MapTile, id is unsigned but in Tmx::Tileset::GetTile, the argument is a signed integer.

I really thing that most interfaces should be changed to unsigned to avoid conversions on std::vector indexing, and restore internal consistency.

This may cause compatibility issues, so I think we should keep the old versions but mark them deprecated and remove them at next major version. This may prevent some changes inside public members.

If there is more problem in the API, we could also directly work on a next version release and rework API even more in the process.

In either case, this issue requires some amount of manual work to list all the misuses of signed int, and classify them correctly. However, compiler warnings on signed to unsigned conversion can help a lot to speed up the process.

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

1 participant