reduce flash footprint by smarter code generation #4163

This commit is contained in:
rusefillc 2022-12-04 00:56:44 -05:00
parent 79917b5571
commit 0c7aaad887
3 changed files with 1 additions and 15 deletions

Binary file not shown.

View File

@ -30,14 +30,7 @@ public class GetConfigValueConsumer implements ConfigurationConsumer {
"float getConfigValueByName(const char *name) {\n";
static final String GET_METHOD_FOOTER = "\treturn EFI_ERROR_CODE;\n" + "}\n";
private static final String SET_METHOD_HEADER = "void setConfigValueByName(const char *name, float value) {\n" +
"\t{\n" +
"\t\tplain_get_float_s * known = findFloat(name);\n" +
"\t\tif (known != nullptr) {\n" +
"\t\t\t*(float*)hackEngineConfigurationPointer(known->value) = value;\n" +
"\t\t}\n" +
"\t}\n" +
"\n";
private static final String SET_METHOD_HEADER = "void setConfigValueByName(const char *name, float value) {\n";
private static final String SET_METHOD_FOOTER = "}\n";
private final List<Tuple<String>> variables = new ArrayList<>();
private final String outputFileName;

View File

@ -72,13 +72,6 @@ public class GetConfigValueConsumerTest {
"\treturn EFI_ERROR_CODE;\n" +
"}\n" +
"void setConfigValueByName(const char *name, float value) {\n" +
"\t{\n" +
"\t\tplain_get_float_s * known = findFloat(name);\n" +
"\t\tif (known != nullptr) {\n" +
"\t\t\t*(float*)hackEngineConfigurationPointer(known->value) = value;\n" +
"\t\t}\n" +
"\t}\n" +
"\n" +
"\tint hash = djb2lowerCase(name);\n" +
"\tswitch(hash) {\n" +
"\t\tcase -672272162:\n" +