libobs-opengl: Fix incompatible pointer type error for 32-bit arches
Description
Fix a small pointer type error in libobs-opengl
Motivation and Context
It fixes a build for the library on 32-bit architectures.
How Has This Been Tested?
OBS Studio packages in Fedora has been shipping this since Fedora 40.
Types of changes
- Bug fix (non-breaking change which fixes an issue)
Checklist:
- [x] My code has been run through clang-format.
- [x] I have read the contributing document.
- [x] My code is not on the master branch.
- [x] The code has been tested.
- [x] All commit messages are properly formatted and commits squashed where appropriate.
- [x] I have included updates to all appropriate documentation.
I'm quiet sure that 32 bit support was dropped since the complete switch to Qt6.
Our api expects a size_t pointer so callers will be sending in pointers to size_t. You will need to copy the size_t into a correctly sized variable first for this to be correct.
Is there any way to exclude 32bit builds? We generally just don't support 32bit right now. Because this cast is technically erroneous on 32bit and will cast a 32bit integer (size_t on 32bit) to 64bit (EGLuint64KHR which presumably is 64bit even on 32bit)
Honestly, the only reason I care is because of the vkcapture plugin... It needs a 32-bit libobs because it needs a 32-bit build for 32-bit games. ☹️
beside if 32-bit architecture is supported or not, casting a 32-bit integer pointer to a 64-bit integer would result in a buffer overrun. You should have a 64-bit integer local variable and pass the pointer of it. Then, cast the value of the variable to n_modifiers.