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

more regexp boiler plate reduction #29

Closed
wants to merge 8 commits into from
Closed

more regexp boiler plate reduction #29

wants to merge 8 commits into from

Conversation

dterrahe
Copy link
Owner

improve consistency and reduce unnecessary duplication

@TurboGit @jenshannoschwalm @ralfbrown

@jenshannoschwalm
Copy link

Whow, great simplification/maintenance stuff! Much easier to read for me, all that user_data stuff gone!

@dterrahe
Copy link
Owner Author

Removed more explicit casts from void* in initializations of variables to the same type.

This is not needed in c and potentially dangerous because it silently removes const. Even cases where it is "fine" hide (by their presence everywhere) the cases where something is really happening. This undermines the whole usefulness of const marking in the first place; we have structures containing const members that are always cast to non-const before use...
Look at some of the examples returned by dt_(.*?)_t \*(.*?) = \(dt_\1_t \*\)(.*?)->
There are a bunch of cases where one line marks a pointer const with the next declaring an additional pointer that removes that constness.

c++ requires these casts, but checks they don't remove const and offers the (better) alternative of using templates to enforce the datatypes carried inside generic structures.

@TurboGit

@dterrahe dterrahe force-pushed the castless branch 2 times, most recently from 7a2ea00 to 04ae2e9 Compare August 1, 2024 18:33
@dterrahe
Copy link
Owner Author

dterrahe commented Aug 1, 2024

Rebasing creates a mess; opening new local PR

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.

None yet

2 participants