FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[[ Bug 23148 ]] Cleanup access to keyword tables by runrevmark · Pull Request #7543 · livecode/livecode · GitHub

This repository was archived by the owner on Aug 31, 2021. It is now read-only.
/ livecode Public archive

[[ Bug 23148 ]] Cleanup access to keyword tables - #7543

Open
runrevmark wants to merge 1 commit into
developfrom
bugfix-23148
Open

[[ Bug 23148 ]] Cleanup access to keyword tables#7543
runrevmark wants to merge 1 commit into
developfrom
bugfix-23148

Conversation

Copy link
Copy Markdown
Contributor

This patch cleans up access to the keyword tables, used by the script parser
and syntax such as the commandNames. The tables are now accessible via
global variables MCkeywordtablepointers and MCkeywordtablesizes which are
defined in scriptpt.h; and all direct access to the underlying tables in
other files have been updated to use them.

Closes https://quality.livecode.com/show_bug.cgi?id=23148

This patch cleans up access to the keyword tables, used by the script parser
and syntax such as `the commandNames`. The tables are now accessible via
global variables `MCkeywordtablepointers` and `MCkeywordtablesizes` which are
defined in `scriptpt.h`; and all direct access to the underlying tables in
other files have been updated to use them.
runrevmark added this to the 9.7.0-dp-1 milestone Apr 3, 2021
runrevmark self-assigned this Apr 3, 2021
Comment thread engine/src/lextable.cpp
Comment on lines +2456 to +2459
LT **MCkeywordtablepointers = (LT **)table_pointers;
uint4 MCkeywordtablepointerssize = table_pointers_size;
uint2 *MCkeywordtablesizes = (uint2 *)table_sizes;
uint4 MCkeywordtablesizessize = table_sizes_size;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Could the global variables be defined as const instead of the const-ness being cast away? e.g const LT * const * const MCkeywordtablepointers = table_pointers; (a constant pointer to constant pointers to constant LTs)
If not perhaps const_cast should be used here to signify what is being done.

This file contains hidden or 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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL