Allow using function literals with function pointers, allow narrowing classes parameter types, and widening classes in return types, allow pointers to non-static, non-virtual functions, add null checking to function calls
src/common/scripting/backend/vmbuilder.cpp:869:88: error: cannot pass non-trivial object of type 'FString' to variadic method; expected type from format string was 'char *' [-Wnon-pod-varargs]
src/common/scripting/backend/vmbuilder.cpp:916:85: error: cannot pass non-trivial object of type 'FString' to variadic method; expected type from format string was 'char *' [-Wnon-pod-varargs]
* add QualifiedName to VMFunction and allocate these static names from the class data memory arena instead of using FStrings.
* null pointer type checks in the VM added to avoid crash on bad codegen.
This allocated some memory and never freed it again. A TArray would have been better - but since we know the maximum size is 4 we may just use a static array here to keep things as efficient as possible.
Due to C++ conversion rules this was a bit too volatile. There's really not enough places where being able to pass a string directly into the sound API was beneficial - the two most frequent functions now got overloaded variants.
This solves two problems:
* The linked list is too slow, a map is better. A map cannot be used with statically allocated CVARs because order of initialization is undefined.
* The current CVAR system is an unordered mishmash of static variables and dynamically allocated ones and the means of identification are unsafe. With this everything is allocated on the heap so it can all be handled the same by the cleanup code.
* Emit a warning when relational comparisons are made between signed and unsigned ints.
* Handle shift operators so that they do not fail for constant definitions.
* changed return type of Array::Size() to signed int as most code out there is using it this way and would otherwise drown in warnings.
* fixed a few deprecation warnings.
* the first operand must never be sign-changed.
* the second operand should always be made unsigned. Shift by negative values is undefined and may produce undefined behavior on some systems.
The C-style rules for integer promotion are that when you have a signed int and an unsigned int, if you can't promote to a wider type, then the signed type is promoted to an unsigned type.