mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 12:05:50 +00:00
Make type conversions explicit. (#7595)
As Java does not support unsigned integer types, the value types are "rounded up" (an uint32 is represented as a long) but persisted correctly (an uint32 is persisted as 4 bytes). This CL makes a cast operation explicit so that the compiler does not throw warning messages. Co-authored-by: Dominic Battre <battre@chromium.org> Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
@@ -47,12 +47,12 @@ public final class StructOfStructsOfStructs extends Struct {
|
||||
}
|
||||
public static int pack(FlatBufferBuilder builder, StructOfStructsOfStructsT _o) {
|
||||
if (_o == null) return 0;
|
||||
int _a_a_id = _o.getA().getA().getId();
|
||||
int _a_a_distance = _o.getA().getA().getDistance();
|
||||
int _a_a_id = (int) _o.getA().getA().getId();
|
||||
int _a_a_distance = (int) _o.getA().getA().getDistance();
|
||||
short _a_b_a = _o.getA().getB().getA();
|
||||
byte _a_b_b = _o.getA().getB().getB();
|
||||
int _a_c_id = _o.getA().getC().getId();
|
||||
int _a_c_distance = _o.getA().getC().getDistance();
|
||||
int _a_c_id = (int) _o.getA().getC().getId();
|
||||
int _a_c_distance = (int) _o.getA().getC().getDistance();
|
||||
return createStructOfStructsOfStructs(
|
||||
builder,
|
||||
_a_a_id,
|
||||
|
||||
Reference in New Issue
Block a user