Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

runrevmark
Copy link
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 runrevmark added this to the 9.7.0-dp-1 milestone Apr 3, 2021
@runrevmark runrevmark self-assigned this Apr 3, 2021
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
Contributor

Choose a reason for hiding this comment

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

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
2 participants