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

No more gcc/clang warnings #169

Merged
merged 26 commits into from
Sep 24, 2022
Merged

Conversation

madebr
Copy link
Collaborator

@madebr madebr commented Sep 16, 2022

This pr fixes all gcc/clang warnings.
-Werror for Apple/clang is not (yet) enabled, as I would like to fix MSVC warnings in a future pr first.

Fixes these types of warnings:
cast between incompatible function types from ‘br_uint_32 (*)(br_actor *, void *)’ {aka ‘unsigned int (*)(struct br_actor *, void *)’} to ‘intptr_t (*)(br_actor *, void *)’ {aka ‘long int (*)(struct br_actor *, void *)’} [-Wcast-function-type]
@madebr
Copy link
Collaborator Author

madebr commented Sep 19, 2022

I also fixed a few -Wextra warnings (not enabled yet).
99% of the remaining warnings are due to -Wsign-compare.

BrVector3Cross(&displacement, &positive_y_vector, &direction_v);
BrVector3Normalise(&displacement, &displacement);
BrVector3Scale(&displacement, &displacement, (pMassage_count / 4) * 0.1f);
} else {
BrVector3Normalise(&displacement, &displacement);
BrVector3Scale(&displacement, &displacement, (pMassage_count / 4) * 0.5f);
BrVector3Normalise(&direction_v, &direction_v);
Copy link
Owner

@dethrace-labs dethrace-labs Sep 23, 2022

Choose a reason for hiding this comment

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

I think you're right - the original code here is not quite correct. After looking at it again, I think it should be this though (slightly different from what you propose:

BrVector3Normalise(&displacement, &direction_v);
BrVector3Scale(&displacement, &displacement, (pMassage_count / 4) * 0.5f);

@dethrace-labs dethrace-labs merged commit b5ccfe7 into dethrace-labs:main Sep 24, 2022
@madebr madebr deleted the no-warnings branch September 28, 2022 17:38
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.

2 participants