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

Use const pointers in more places + MSVC fixes #114

Merged
merged 6 commits into from
Apr 14, 2021

Conversation

RReverser
Copy link
Collaborator

This is a follow-up to #109.

Switching to const pointers in image structure, and throughout the
codebase with -Wcast-qual warning to ensure that const pointers
are indeed not mutated. Also removed casts from allocation function
results - they're not necessary on void * pointers to any others.

Using const * allows consumers to more easily reason about inputs /
outputs of the API and safely share data between invocations or threads.

In the process I also fixed few more obvious UB warnings from clang-tidy
where it complained about usage of uninitialised data, although few more remain.

Also included few fixes for MSVC that got broken in #109.

Switching to const pointers in image structure, and throughout the
codebase with -Wcast-qual warning to ensure that const pointers
are indeed not mutated.

This allows consumers to more easily reason about inputs / outputs
and share data between invocations or threads.
@RReverser RReverser changed the title Use const pointers where possible Use const pointers in more places + build fixes Apr 1, 2021
@RReverser RReverser changed the title Use const pointers in more places + build fixes Use const pointers in more places + MSVC fixes Apr 1, 2021
@RReverser
Copy link
Collaborator Author

@kbarbary After this, I'll have one more separate PR and probably will be done for now :)

@RReverser
Copy link
Collaborator Author

Actually... the other change is fairly independent from this one, I'll submit both in parallel to speed up reviews :)

@RReverser
Copy link
Collaborator Author

@kbarbary Uh... ping? :) (on this and other PRs)

@kbarbary kbarbary merged commit 6e2d175 into kbarbary:master Apr 14, 2021
@kbarbary
Copy link
Owner

Ooops, sorry for the delay. Would you be interested in having write privileges to this repo?

@RReverser RReverser deleted the const-ptrs branch April 15, 2021 14:00
@RReverser
Copy link
Collaborator Author

Ooops, sorry for the delay. Would you be interested in having write privileges to this repo?

I wouldn't mind, but I don't promise active maintenance efforts from my side :)

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