-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Remove usages of old safe math #4153
Comments
I don't mind doing this eventually, but I have bunch of stuff in progress that I would like to try and get finished first. If anyone else wants to take it on, though, I would recommend waiting at least until #3628 is merged, because there is a fair amount of safe math code in On a similar note, I expect issue #3849 will end up replacing most, if not all, of the |
One other thing I wanted to add: there is another category of intsafe routines which I think isn't covered by the 79 uses mentioned above, and that is the type conversion functions, e.g. |
## Summary of the Pull Request <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #4013 * [x] I work here. * [x] Existing tests should be OK. Real changes, just adding a lib to use. * [x] Couldn't find any existing docs about intsafe. * [x] Am core contributor. ## Detailed Description of the Pull Request / Additional comments * [x] Can we remove min/max completely or rename it in the two projects where it had to be reintroduced? This is now moved into #4152 * [x] How many usages of the old safe math are there? **79** * [x] If not a ton, can we migrate them here or in a follow on PR? This is now moved into #4153 Files with old safe math: - TerminalControl: TSFInputControl.cpp - TerminalCore: TerminalDispatch.cpp - TerminalCore: TerminalSelection.cpp - Host: directio.cpp - RendererGdi: invalidate.cpp - RendererGdi: math.cpp - RendererGdi: paint.cpp - RendererVt: paint.cpp - TerminalAdapter: adaptDispatch.cpp - Types: viewport.cpp - Types: WindowUiaProviderBase.cpp ## Validation Steps Performed
There are approximately 79 uses of old safe math. (a.k.a. the
LongAdd
,ShortAdd
, and friends fromintsafe.h
).This task represents removing them and transitioning them to an appropriate safe/saturating math function from the chromium safe math library introduced in #4144.
After removing usages of the old safe math functions, also remove the
intsafe.h
header.Files with old safe math as of this writing:
The text was updated successfully, but these errors were encountered: