unknown type is now a nice error
This commit is contained in:
parent
493bd4c677
commit
d33f117688
|
@ -9,6 +9,9 @@ public class TypesHelper {
|
|||
public static final String UINT8_T = "uint8_t";
|
||||
public static final String UINT_16_T = "uint16_t";
|
||||
public static final String INT_16_T = "int16_t";
|
||||
private static final String FLOAT_T = "float";
|
||||
private static final String INT_32_T = "int";
|
||||
private static final String UINT_32_T = "uint32_t";
|
||||
|
||||
public static int getElementSize(ReaderState state, String type) {
|
||||
Objects.requireNonNull(state);
|
||||
|
@ -23,7 +26,11 @@ public class TypesHelper {
|
|||
if (type.equals(INT_16_T) || type.equals(UINT_16_T)) {
|
||||
return 2;
|
||||
}
|
||||
return 4;
|
||||
if (type.equals(FLOAT_T) || type.equals(INT_32_T) || type.equals(UINT_32_T) ||
|
||||
type.equals("angle_t")) {
|
||||
return 4;
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown type " + type);
|
||||
}
|
||||
|
||||
public static String convertToTs(String type) {
|
||||
|
|
Loading…
Reference in New Issue