Fixed two bugs in the old color strip function. #7

Closed
anomaly wants to merge 5 commits from anomaly/iw6-mod:color_strip_bug_fixes into master
First-time contributor
No description provided.
anomaly added 5 commits 2024-12-31 19:12:47 +00:00
Owner

I have this completed as well but I haven't closed it yet because I am pretty sure there is just one bug in this function:

I have added !max check because it can happen if whoever invokes this function is not careful but I am unable to understand why the static cast is needed. isn't it fine to keep everything between signed integers like the rest of the function?

I have this completed as well but I haven't closed it yet because I am pretty sure there is just one bug in this function: I have added !max check because it can happen if whoever invokes this function is not careful but I am unable to understand why the static cast is needed. isn't it fine to keep everything between signed integers like the rest of the function?
Author
First-time contributor

I have this completed as well but I haven't closed it yet because I am pretty sure there is just one bug in this function:

I have added !max check because it can happen if whoever invokes this function is not careful but I am unable to understand why the static cast is needed. isn't it fine to keep everything between signed integers like the rest of the function?

Check this out: https://godbolt.org/z/EGnofMn7q
It'd seem to me that the behavior with the cast is the intended behavior.

> I have this completed as well but I haven't closed it yet because I am pretty sure there is just one bug in this function: > > I have added !max check because it can happen if whoever invokes this function is not careful but I am unable to understand why the static cast is needed. isn't it fine to keep everything between signed integers like the rest of the function? Check this out: https://godbolt.org/z/EGnofMn7q It'd seem to me that the behavior **with** the cast is the intended behavior.
Author
First-time contributor
https://github.com/iw4x/iw4x-client/blob/develop/src/Components/Modules/TextRenderer.cpp#L1327-L1332 **With** the cast would also be consistent with iw4x.
Owner

Interesting, I'm glad I asked.

Interesting, I'm glad I asked.
Owner

Okay, i played with godbolt a bit so yeah iw4x way is better as laupetin took a bit more care than the original xlabs dev when they coded this strip function

so I remove your email address as well from the commit history I hope you like your new email

completed via 199206ee5a

Okay, i played with godbolt a bit so yeah iw4x way is better as laupetin took a bit more care than the original xlabs dev when they coded this strip function so I remove your email address as well from the commit history I hope you like your new email completed via https://git.alterware.dev/alterware/iw6-mod/commit/199206ee5ae6919cdd101f2f5e5aa76a1f676ce3
Future closed this pull request 2025-01-11 09:23:14 +00:00

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
No Milestone
No project
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: alterware/iw6-mod#7
No description provided.