-
Notifications
You must be signed in to change notification settings - Fork 80
Make non-mutated pointers const #545
Copy link
Copy link
Closed
Description
Current Issue
Right now, there are many functions which parameters pointers could be const. Example:
MobilityDB/meos/src/general/temporal_tile.c
Line 1154 in 2784b78
| temporal_time_split(Temporal *temp, Interval *duration, TimestampTz torigin, |
Why is it relevant
- Readability from the code as such, since if you see the
const, you know that by convention that variable won't be changed. - Wrapper improvement. The code needed to create the wrapper in Rust will be cleaner, since in Rust, if the pointer type it's specified as const, the type generated by bindgen (the tool that takes C headers and generates the Rust equivalents), is
const *T, whereas ifconstit's not specified, it outputsmut *T, this means that for functions where I wouldn't need to pass a mutable reference, I still need to.
Describe the solution you'd like
For every pointer type received as a parameter, if it's not modified, add a const modifier.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels