Closed BullyWiiPlaza closed 1 year ago
No C++ style casts please, change to C style and I'll merge.
Okay but what's your reasoning behind it? Using C style casts in C++ are considered bad style. I now updated the pull request and used a C style cast instead.
A C style cast is the same as trying all C++ casts in order excluding a dynamic_cast. It's easier to read, more powerful, and shorter to write. For low level code like this where 'unsafe' stuff happens everywhere following the normal C++ rules does not make sense.
I prefer to write C++ as a superset of C, meaning do it like C when possible, but if not possible then use C++ features. This results in simpler code.
When compiling my x86 hooking code, I was getting the following warning in MSVC:
1>C:\vcpkg\installed\x86-windows\include\polyhook2\Instruction.hpp(198,3): warning C4018: '<=': signed/unsigned mismatch