Technical debt: ENUM_32_BITS fix #3874

This commit is contained in:
rusefi 2023-06-01 12:23:51 -04:00
parent 7f37c54648
commit b99151650c
5 changed files with 1 additions and 19 deletions

Binary file not shown.

View File

@ -83,9 +83,6 @@ public class ParseState implements DefinitionsState {
if (stringValueMap == null)
return null;
for (Value value : stringValueMap.values()) {
if (value.isForceSize())
continue;
if (isNumeric(value.getValue())) {
valueNameById.put(value.getIntValue(), value.getName());
} else {

View File

@ -15,10 +15,6 @@ import java.util.Map;
* produces java enum class from an enum defined in a C/C++ header
*/
public class ToJavaEnum {
public static final String FORCE_2_BYTES_SIZE = "Force_2_bytes_size";
public static final String FORCE_4_BYTES_SIZE = "Force_4_bytes_size";
public static void main(String[] args) throws IOException {
InvokeReader invokeReader = new InvokeReader(args).invoke();
String outputPath = invokeReader.getOutputPath();
@ -64,9 +60,7 @@ public class ToJavaEnum {
int index = 0;
for (Value value : sorted) {
int numericValue = value.getIntValueMaybeResolve(registry);
if (index != numericValue
&& !value.getName().startsWith(FORCE_2_BYTES_SIZE)
&& !value.getName().startsWith(FORCE_4_BYTES_SIZE))
if (index != numericValue)
throw new IllegalStateException("Got explicit ordinal " + numericValue + " instead of ordinal " + index + " in " + value);
sb.append("\t" + value.getName() + ",\n");
index++;

View File

@ -110,8 +110,6 @@ public class VariableRegistry {
TreeMap<Integer, String> valueNameById = new TreeMap<>();
for (Value value : stringValueMap.values()) {
if (value.isForceSize())
continue;
if (isNumeric(value.getValue())) {
valueNameById.put(value.getIntValue(), value.getName());

View File

@ -4,9 +4,6 @@ import com.rusefi.VariableRegistry;
import java.util.Objects;
import static com.rusefi.ToJavaEnum.FORCE_2_BYTES_SIZE;
import static com.rusefi.ToJavaEnum.FORCE_4_BYTES_SIZE;
public class Value implements Comparable<Value> {
private final String name;
private final String value;
@ -16,10 +13,6 @@ public class Value implements Comparable<Value> {
this.value = value;
}
public boolean isForceSize() {
return getName().startsWith(FORCE_2_BYTES_SIZE) || getName().startsWith(FORCE_4_BYTES_SIZE);
}
public String getName() {
return name;
}