| 864 | #define BITMATCH(x,y) (((x) & (y)) == (y)) |
| 865 | |
| 866 | static void PushNils(std::vector<unsigned char>& output, int& nilcount) |
| 867 | { |
| 868 | int count = nilcount; |
| 869 | nilcount = 0; |
| 870 | |
| 871 | static const int minNilsWorthEncoding = 6; // because a LUAEXT_TNILS entry is 5 bytes |
| 872 | |
| 873 | if(count < minNilsWorthEncoding) |
| 874 | { |
| 875 | for(int i = 0; i < count; i++) |
| 876 | output.push_back(LUA_TNIL); |
| 877 | } |
| 878 | else |
| 879 | { |
| 880 | output.push_back(LUAEXT_TNILS); |
| 881 | PushBinaryItem<uint32>(count, output); |
| 882 | } |
| 883 | } |
| 884 | |
| 885 | static std::vector<const void*> s_tableAddressStack; // prevents infinite recursion of a table within a table (when cycle is found, print something like table:parent) |
| 886 | static std::vector<const void*> s_metacallStack; // prevents infinite recursion if something's __tostring returns another table that contains that something (when cycle is found, print the inner result without using __tostring) |
no outgoing calls
no test coverage detected