mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-26 12:22:39 +00:00
Refactored the Java and C# code generators into one.
Also made the C# implementation support unsigned types, and made it more like the Java version. Bug: 17359988 Change-Id: If5305c08cd5c97f35426639516ce05e53bbec36c Tested: on Linux and Windows.
This commit is contained in:
@@ -9,14 +9,14 @@ public class Test : Struct {
|
||||
public Test __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
|
||||
|
||||
public short A() { return bb.GetShort(bb_pos + 0); }
|
||||
public byte B() { return bb.Get(bb_pos + 2); }
|
||||
public sbyte B() { return bb.GetSbyte(bb_pos + 2); }
|
||||
|
||||
public static int CreateTest(FlatBufferBuilder builder, short A, byte B) {
|
||||
public static int CreateTest(FlatBufferBuilder builder, short A, sbyte B) {
|
||||
builder.Prep(2, 4);
|
||||
builder.Pad(1);
|
||||
builder.PutByte(B);
|
||||
builder.PutSbyte(B);
|
||||
builder.PutShort(A);
|
||||
return builder.Offset;
|
||||
return builder.Offset();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user