Change int to any with Address Functions#1250
Change int to any with Address Functions#1250Headline merged 2 commits intoalliedmodders:masterfrom Scags:addr-any
Conversation
|
There's one pitfall with this change on The addition operator will always treat the left operand as an int, in either case you'd have to explicitly reinterpret it as a float but the current documentation makes the integer behavior clear. I think having a separate |
|
Fair point, but there's two things here: 1: People who are even trying to do this kind of stuff would (should) be aware of how float operations work. I think compiler warnings on implicit |
|
I can't think of any reason not to do this, but it should be clarified that they're 32-bit loads if that's not done already. |
|
Certainly. Added notes concerning bit size with the latest commit. |
Github PR alliedmodders/sourcemod#1250 causes spcomp to error on `LoadStringFromAddress` due to not being able to assign `char[]` to `any[]` due to differing storage classes. Reinterpreting the result as an integer clears up the error.
Since getting from and storing to addresses gives no regard to the type you throw at it, it makes sense to change these to
any.Would help with having to do some obnoxious tagging at the moment: