Fixed warnings generated by recent JSON sorting feature.

Change-Id: I6fd6283b616c7a39bb878b1610e4ddf6e208fa0a
diff --git a/src/idl_parser.cpp b/src/idl_parser.cpp
index 93bdf6c..37692f9 100644
--- a/src/idl_parser.cpp
+++ b/src/idl_parser.cpp
@@ -1257,7 +1257,7 @@
   return NoError();
 }
 
-static int CompareType(const uint8_t *a, const uint8_t *b, BaseType ftype) {
+static bool CompareType(const uint8_t *a, const uint8_t *b, BaseType ftype) {
   switch (ftype) {
     #define FLATBUFFERS_TD(ENUM, IDLTYPE, CTYPE, JTYPE, GTYPE, NTYPE, \
                            PTYPE, RTYPE, KTYPE) \
@@ -1394,8 +1394,9 @@
         // stored in memory, so compute the distance between these pointers:
         ptrdiff_t diff = (b - a) * sizeof(Offset<Table>);
         assert(diff >= 0);  // Guaranteed by SimpleQsort.
-        a->o = EndianScalar(ReadScalar<uoffset_t>(a) - diff);
-        b->o = EndianScalar(ReadScalar<uoffset_t>(b) + diff);
+        auto udiff = static_cast<uoffset_t>(diff);
+        a->o = EndianScalar(ReadScalar<uoffset_t>(a) - udiff);
+        b->o = EndianScalar(ReadScalar<uoffset_t>(b) + udiff);
         std::swap(*a, *b);
       });
     }
diff --git a/tests/javatest.bin b/tests/javatest.bin
index 43b3766..804dbba 100644
--- a/tests/javatest.bin
+++ b/tests/javatest.bin
Binary files differ