reduce flash footprint by smarter code generation #4163
This commit is contained in:
parent
79917b5571
commit
0c7aaad887
Binary file not shown.
|
@ -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;
|
||||
|
|
|
@ -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" +
|
||||
|
|
Loading…
Reference in New Issue