Remove redundant casts for parameters to mem* functions where implicit casts are sufficient
Registered by
Mats Kindahl
For functions that accept a void* as parameter, a cast to a pointer is unnecessary and can even hide bugs. Remove all such casts from calls to the functions memset(), memcpy(), memcmp(), and memmove().
Blueprint information
- Status:
- Complete
- Approver:
- Jay Pipes
- Priority:
- Undefined
- Drafter:
- None
- Direction:
- Needs approval
- Assignee:
- Mats Kindahl
- Definition:
- Approved
- Series goal:
- None
- Implementation:
- Implemented
- Milestone target:
- None
- Started by
- Mats Kindahl
- Completed by
- Mats Kindahl
Whiteboard
Go for it, Mats. :)
Thanks! :)
I will remove redundant casts of pointers since the mem* functions take void* as parameter, hence casting a pointer will be implicit and not generate a warning unless there is something wrong (like casting a non-pointer to void* or casting a const pointer to void*). Also, there are several cases where the length given is cast to unsigned, but this is also done implicitly and hence best left alone.
(?)