From 481d332e7261ced6f92434e6504115a62e1aa7e3 Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen Date: Fri, 26 Aug 2016 14:18:04 -0700 Subject: [PATCH] Fixed compile error in LookupByKey fix. Change-Id: Ice94f09197235cf71b41a22d0767bd7b119284e1 --- src/idl_gen_general.cpp | 2 +- tests/MyGame/Example/Monster.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/idl_gen_general.cpp b/src/idl_gen_general.cpp index c678dc3f6..274a22f5e 100644 --- a/src/idl_gen_general.cpp +++ b/src/idl_gen_general.cpp @@ -1241,7 +1241,7 @@ void GenStruct(StructDef &struct_def, std::string *code_ptr) { code += "System.Text.Encoding.UTF8.GetBytes(key);\n"; code += " int vectorLocation = " + GenByteBufferLength("bb"); code += " - vectorOffset"; - if (lang_.language == IDLOptions::kCsharp) code += ".Value"; + if (lang_.language == IDLOptions::kCSharp) code += ".Value"; code += ";\n int span = "; code += "bb." + FunctionStart('G') + "etInt(vectorLocation);\n"; code += " int start = 0;\n"; diff --git a/tests/MyGame/Example/Monster.cs b/tests/MyGame/Example/Monster.cs index 91c845c64..1883659f6 100644 --- a/tests/MyGame/Example/Monster.cs +++ b/tests/MyGame/Example/Monster.cs @@ -137,7 +137,7 @@ public sealed class Monster : Table { public static Monster LookupByKey(VectorOffset vectorOffset, string key, ByteBuffer bb) { byte[] byteKey = System.Text.Encoding.UTF8.GetBytes(key); - int vectorLocation = bb.Length - vectorOffset; + int vectorLocation = bb.Length - vectorOffset.Value; int span = bb.GetInt(vectorLocation); int start = 0; vectorLocation += 4;