AP_Scripting: keep enum definitions in flash

Saves ~100B of statically allocated RAM.
This commit is contained in:
Thomas Watson 2024-06-30 17:09:18 -05:00 committed by Andrew Tridgell
parent fc8147ead0
commit 50eac0ef31

View File

@ -2381,7 +2381,7 @@ void emit_methods(struct userdata *node) {
} }
void emit_enum(struct userdata * data) { void emit_enum(struct userdata * data) {
fprintf(source, "struct userdata_enum %s_enums[] = {\n", data->sanatized_name); fprintf(source, "const struct userdata_enum %s_enums[] = {\n", data->sanatized_name);
struct userdata_enum *ud_enum = data->enums; struct userdata_enum *ud_enum = data->enums;
while (ud_enum != NULL) { while (ud_enum != NULL) {
fprintf(source, " {\"%s\", %s::%s},\n", ud_enum->name, data->name, ud_enum->name); fprintf(source, " {\"%s\", %s::%s},\n", ud_enum->name, data->name, ud_enum->name);