Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lua: refactor to use lua 5.2 syntax for custom metatables
In lua 5.0, the preferred way to define custom metatables is to use registry keys defined by pushing pointers as lightuserdata to lua. (These pointers can be pointers to arbitrary constant objects, as long as they are unique.) In lua 5.2, the preferred way is to use constant strings as the registry indices, and several lua API functions are introduced: "luaL_newmetatable, luaL_setmetatable, luaL_checkudata, luaL_testudata" which greatly simplify the operations for creating the metatable, assigning it to a userdata, and checking if the userdata has that type. This commit switches over the keys associated to textdomains, translatable strings, vconfigs, and lua gui2 dialogs to use the new style, and simplifies some of the implementation details in the process. For instance, luaW_toconfig no longer has to have an optional argument to an index on the stack where the tstring metatable is... these details are handled by the lua API instead.
- Loading branch information
Showing
6 changed files
with
76 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.