Open elfprince13 opened 7 years ago
Started a branch to work on this: https://github.com/elfprince13/Torque3D/commit/595917ab7b20153cb09d2bb6c5eb8e9b3acdf40f#diff-637773112ccf1788179bc28c358075e0 . Already turned up a handful bugs. Unfortunately for every error about calling the private const char *
constructor, I get two dozen about passing non-simple types through varargs.
Okay: this is looking a bit better now that I'm conforming to the trivial type spec, but I'm starting to get deep into the engine, and scary things are popping up (like...the lexer!).
Hm, not a bad idea. Preventing inadvertently tossing around regular strings into it would curb some bad habit behavior.
As the engine currently stands,
StringTableEntry
is a simple typedef onconst char *
. We might consider making it a POD struct with an implicit conversion TOconst char *
, but no explicit conversion FROMconst char *
. This would allow the compiler to eliminate a large class of potential bugs where somebody passes a wild c-string into a method expecting an actual StringTableEntry.