This command constructor is only sufficient for the not yet implemented commands. For now it also sets the default code (no code), blank option string, and null function pointers. This class definition was put into a new header file. In the corresponding source file, instances were created for all of the not yet implemented commands, for example:
static Command Dim("DIM");The entries for these commands were removed from the static table entry array and the code index enumerators for these commands were removed from the code index enumeration.
The type of the string arguments to the table constructor (name, second name, and option) was changed from a standard string to a C-style string (constant character array pointer) because otherwise, passing a blank string to this constructor required a standard string std::string("") instance, instead of just a blank "" string.
The first time these changes were one, a crash occurred during initialization when trying to add the first of the new command instances because the static table members had not been initialized yet. Because the new command source file appeared before the table source file in the source file list in the CMake build file, so command instances were initialized before the static table members, but these are needed to initialize the command instances. To resolve this, the basic sub-directory source files (which will contain the entry instances) were moved to the end of the source file list so that the table source file with the static table members are initialized first.
[branch table commit 97ff351060]
No comments:
Post a Comment
All comments and feedback welcomed, whether positive or negative.
(Anonymous comments are allowed, but comments with URL links or unrelated comments will be removed.)