mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +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:
@@ -52,12 +52,12 @@ public final class StructOfStructs extends Struct {
|
||||
}
|
||||
public static int pack(FlatBufferBuilder builder, StructOfStructsT _o) {
|
||||
if (_o == null) return 0;
|
||||
int _a_id = _o.getA().getId();
|
||||
int _a_distance = _o.getA().getDistance();
|
||||
int _a_id = (int) _o.getA().getId();
|
||||
int _a_distance = (int) _o.getA().getDistance();
|
||||
short _b_a = _o.getB().getA();
|
||||
byte _b_b = _o.getB().getB();
|
||||
int _c_id = _o.getC().getId();
|
||||
int _c_distance = _o.getC().getDistance();
|
||||
int _c_id = (int) _o.getC().getId();
|
||||
int _c_distance = (int) _o.getC().getDistance();
|
||||
return createStructOfStructs(
|
||||
builder,
|
||||
_a_id,
|
||||
|
||||
Reference in New Issue
Block a user