Skip to content
Snippets Groups Projects
  1. Apr 24, 2017
  2. Mar 29, 2017
  3. Mar 10, 2017
    • chronoxor's avatar
      Pedantic Visual Studio build (/W4 /WX) (#4214) · f5387387
      chronoxor authored
      * Pedantic Visual Studio build (/W4 /WX)
      
      * Pedantic Visual Studio build (/W4 /WX)
      
      * Pedantic Visual Studio build (/W4 /WX)
      
      * Remove /wd4512 from CMakeLists.txt
      
      * Suppress Visual Studio 4512 warning ('class' : assignment operator could not be generated)
      f5387387
  4. Feb 26, 2017
  5. Feb 16, 2017
  6. Feb 08, 2017
  7. Jan 25, 2017
  8. Jan 14, 2017
    • Wouter van Oortmerssen's avatar
      Add CodeWriter utility class. · 7b94eab2
      Wouter van Oortmerssen authored
      Helps simplify code generation code.  Instead of this:
        code += "inline const " + cpp_qualified_name + " *Get";
        code += name;
        code += "(const void *buf) {\n  return flatbuffers::GetRoot<";
        code += cpp_qualified_name + ">(buf);\n}\n\n";
      
      You do this:
        code.SetValue("NAME", struct_def.name);
        code.SetValue("CPP_NAME", cpp_qualified_name);
        code += "inline const {{CPP_NAME}} *Get{{NAME}}(const void *buf) {";
        code += "  return flatbuffers::GetRoot<{{CPP_NAME}}>(buf);";
        code += "}";
        code += "";
      
      Updated the CPP code generator to use the CodeWriter class.  Most of the
      changes in the generated code are white-space changes, esp. around new
      lines (since the code generator class automatically appends new lines
      when appending a string).  Actual code changes include:
      
      * Renamed "rehasher" to "_rehasher" for consistency with other args in
        Pack function.
      
      * Renamed "union_obj" to "obj: in UnPack function.
      
      * Always do "(void)_o;" to prevent unused variable warning in Create
        function (instead of only doing it if there are no fields) in order
        to avoid two-passes.
      
      * Renamed padding variables from __paddingX to paddingX__.
        "Each name that contains a double underscore (_ _) [...] is reserved
         to the implementation for any use."  C++ standards 17.4.3.1.2.
      
      * Add braces around switch cases.
      
      * Calculate index as a separate statement in EnumName function, eg.
          const size_t index = ...;
          return EnumNamesX()[index];
        vs.
          return EnumNamesX()[...];
      
      * Stored end table offset in variable in Finish() functions, eg.
          const auto end = fbb_.EndTable(start_, ...);
          auto o = flatbuffers::Offset<T>(end);
        vs.
          auto o = flatbuffers::Offset<T>(fbb_.EndTable(start, ...));
      
      * Separate reinterpret_cast calls from function calls in Union
        functions, eg.
          auto ptr = reinterpret_cast<const T *>(obj);
          return ptr->UnPack(resolver);
        vs.
          return reinterpret_cast<const T *>(obj)->UnPack(resolver);
      
      * Removed unecessary (void)(padding__X) no-ops from constructors, eg.
          Test(int16_t a, int8_t b) : ... {
            (void)__padding0;  // <-- Removed this line.
          }
      
      In the idl_gen_cpp.cpp file itself, I refactored some code generation into
      new functions: GenParam, GenNativeTable, GenVerifyCall, GenBuilders,
      GenUnpackFieldStatement, and GenCreateParam.
      
      Change-Id: I727b1bd8719d05b7ce33cbce00eb58fda817b25d
      7b94eab2
  9. Dec 16, 2016
    • Zarian Waheed's avatar
      Changes for verifying a buffer dynamically using reflection. (#4102) · 6d6271db
      Zarian Waheed authored
      * Changes for verifying a buffer dynamically using reflection.
      
      * Fixing build issues on linux and applied code reformatting.
      
      * Fixing the file order in cmake file that was messing up the macro based code inclusion.
      
      Added tests for reflection based verification.
      
      * Changes for verifying a buffer dynamically using reflection.
      
      Fixing build issues on linux and applied code reformatting.
      
      Fixing the file order in cmake file that was messing up the macro based code inclusion.
      
      Added tests for reflection based verification.
      
      * Incorporated the code review changes that were requested:
      
      1. Changed the Verify function signature.
      2. Changed the variable names to use snake_case.
      3. Added better comments.
      4. Refactored duplicate code.
      5. Changed the verifier class so that it has the same size when compiled with or without FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE macro.
      
      * Setting FLATBUFFERS_TRACK_VERIFIER_BUFFER_SIZE and FLATBUFFERS_DEBUG_VERIFICATION_FAILURE through cmake for flattests so that it gets propagted to all translation units of flattests.
      
      * Making the Verifier struct fields the same in all cases. Also reverting the target_compile_definitions change in cmake file because build machine on travis does not have cmake version 3.0 or higher which was the version when target_compile_definitions was added in cmake.
      
      * Defining macros through cmake in a portable way using functions that are available in cmake 2.8.
      6d6271db
  10. Dec 05, 2016
    • Ronak Jain's avatar
      Support for Golang GRPC (Experimental) (#4082) · a31ddd2b
      Ronak Jain authored
      * support for grpc golang
      
      * refactored grpc go generator
      
      * added grpc-go test and refactored
      
      * refactored idl_gen_grpc.cpp
      
      * fixed grpc generate method name
      
      * refactored flatc and fixed line length issue
      
      * added codec to go lib and fixed formatting issues
      
      * fixed spacing issues
      a31ddd2b
  11. Oct 17, 2016
  12. Oct 05, 2016
  13. Sep 09, 2016
    • Jason Sanmiya's avatar
      Fix Windows warnings. · 985de211
      Jason Sanmiya authored
      Cmake issued a warning when the variable is in quotation marks
      in an if statement.
      
      Visual Studio upgrades constants to int and issues a truncation
      warning, so inserted a cast.
      
      Change-Id: I60cdcb5c2565cd5e97f80b9c2ff1e6abc32b1deb
      Tested: Builds without warning on VS2015.
      985de211
  14. Sep 06, 2016
  15. Aug 24, 2016
  16. Jul 26, 2016
    • Jason Sanmiya's avatar
      Fix Mac build. · 30c07f4e
      Jason Sanmiya authored
      The new line in the set(CMAKE_CXX_FLAGS...) line was getting insert
      verbatim into the Makefile. Makefiles don't like new lines in their
      assignment operators.
      
      The newline escape fix works for CMake 3.0 and above, but since
      we support 2.x, we need to use the legacy solution, which is to
      split into two separate statements.
      
      Tested: cmake -G"Unix Makefiles" works now on Mac.
      Change-Id: I6f4655981b85087c4760c3d26ed0c97c4469ba93
      30c07f4e
  17. Jul 22, 2016
  18. Jul 20, 2016
  19. Jul 01, 2016
  20. Jun 29, 2016
  21. May 01, 2016
  22. Apr 13, 2016
  23. Apr 04, 2016
  24. Apr 02, 2016
  25. Mar 14, 2016
  26. Mar 03, 2016
  27. Feb 11, 2016
  28. Jan 19, 2016
  29. Dec 21, 2015
  30. Dec 02, 2015
  31. Dec 01, 2015
  32. Nov 26, 2015
  33. Nov 17, 2015
    • Johan Euphrosine's avatar
      flatbuffers/cmake: move build_flatbuffers to a standalone file · 331d2d83
      Johan Euphrosine authored
      So that it could be included from both flatbuffers CMakeLists.txt and
      FindFlatBuffers.cmake.
      
      Change-Id: Ie16a879beef9367cd6fd9b2d2157044841a7cdbc
      331d2d83
    • Shuhei Taunma's avatar
      (PHP) add experimental support for PHP language. · 5ce86826
      Shuhei Taunma authored
      * codegen for all basic features: WIP (probably implemented all basic feature)
      * JSON parsing: NO
      * Simple mutation: NO
      * Reflection: NO
      * Buffer verifier: NO (will be add later)
      * Testing: basic: Yes
      * Testing: fuzz: Yes
      * Performance: Not bad
      * Platform: Supported Linux, OS X, Windows (has 32bit integer limitation)
      * Engine Unity: No
      
      flatc --php monster_test.fbs
      
        <?php
        //include neccessary files.
        $fbb = new Google\FlatBuffers\FlatBufferBuilder(1);
        $str = $fbb->createString("monster");
        \MyGame\Example\Monster::startMonster($fbb);
        \MyGame\Example\Monster::addHp($fbb, 80);
        \MyGame\Example\Monster::addName($fbb, $str);
        $mon = \MyGame\Example\Monster::endMonster($fbb);
        $fbb->finish($mon);
        echo $fbb->sizedByteArray();
      
      PHP 5.4 higher
      
      Currently, we do not register this library to packagist as still experimental and versioning problem.
      If you intended to use flatbuffers with composer. add repostiories section to composer.json like below.
      
        "repositories": [{
          "type": "vcs",
          "url": "https://github.com/google/flatbuffers"
        }],
      
       and just put google/flatbuffers.
      
        "require": {
          "google/flatbuffers": "*"
        }
      
      * PHP's integer is platform dependant. we strongly recommend use 64bit machine
        and don't use uint, ulong types as prevent overflow issue.
        ref: http://php.net/manual/en/language.types.integer.php
      
      * php don't support float type. floating point numbers are always parsed as double precision internally.
        ref: http://php.net/manual/en/language.types.float.php
      
      * ByteBuffer is little bit slow implemnentation due to many chr/ord function calls. Especially encoding objects.
        This is expected performance as PHP5 has parsing arguments overhead. probably we'll add C-extension.
      
      Basically, PHP implementation respects Java and C# implementation.
      
      Note: ByteBuffer and FlatBuffersBuilder class are not intended to use other purposes.
            we may change internal API foreseeable future.
      
      PSR-2, PSR-4 standards.
      
      Implemented simple assertion class (respect JavaScript testcase implementation) as we prefer small code base.
      this also keeps CI iteration speed.
      
      we'll choose phpunit or something when the test cases grown.
      5ce86826
  34. Nov 14, 2015
    • Jon Simantov's avatar
      Store the dirs you pass into build_flatbuffers as properties. · 65c9b355
      Jon Simantov authored
      This allows you to query the generated target for those properties
      later, so dependent modules can refer to the directories to, for example,
      add them to the include_directories.
      
      Change-Id: I7a6bd34c5c1d08e2ea69b5ad845223297cad1159
      65c9b355
    • Jon Simantov's avatar
      Added build_flatbuffers function to CMake. · f2949c3f
      Jon Simantov authored
      This function is designed to be called by projects that use FlatBuffers.
      It takes a list of FlatBuffers schemas and a list of schema include
      directories, and generates build rules to create generated headers
      and/or binary schemas for those files, as well as optionally copying
      all of the text schemas into a directory for your use (for example if
      you need to parse text schemas within your app).
      
      See function comments for more details.
      
      Change-Id: I181684b916e91d965e14849d8f83ec2c83e9a4a4
      f2949c3f
  35. Oct 15, 2015
    • Evan Wallace's avatar
      Add support for JavaScript code generation · 224e33ed
      Evan Wallace authored
      This adds a JavaScript language target. The generated JavaScript uses Google
      Closure Compiler type annotations and can be compiled using the advanced
      compilation mode, which performs type checking and optimizations such as
      inlining and dead code elimination. The generated JavaScript also exports all
      generated symbols for use with Node.js and RequireJS. This export behavior
      can be turned off with the --no-js-exports flag for use with Google Closure
      Compiler.
      224e33ed
  36. Aug 03, 2015
Loading