script_core 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (381) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.rubocop.yml +8 -6
  4. data/.ruby-version +1 -1
  5. data/Gemfile +2 -1
  6. data/bin/sandbox +1 -1
  7. data/ext/enterprise_script_service/Rakefile +1 -1
  8. data/ext/enterprise_script_service/flags.rb +5 -0
  9. data/ext/enterprise_script_service/libseccomp/CHANGELOG +15 -0
  10. data/ext/enterprise_script_service/libseccomp/CREDITS +3 -0
  11. data/ext/enterprise_script_service/libseccomp/Makefile.am +1 -1
  12. data/ext/enterprise_script_service/libseccomp/README.md +1 -1
  13. data/ext/enterprise_script_service/libseccomp/SECURITY.md +45 -0
  14. data/ext/enterprise_script_service/libseccomp/configure.ac +3 -3
  15. data/ext/enterprise_script_service/libseccomp/doc/admin/MAINTAINER_PROCESS.md +95 -0
  16. data/ext/enterprise_script_service/libseccomp/{RELEASE_PROCESS.md → doc/admin/RELEASE_PROCESS.md} +9 -1
  17. data/ext/enterprise_script_service/libseccomp/include/Makefile.am +1 -1
  18. data/ext/enterprise_script_service/libseccomp/include/seccomp-syscalls.h +2292 -0
  19. data/ext/enterprise_script_service/libseccomp/include/seccomp.h.in +3 -1065
  20. data/ext/enterprise_script_service/libseccomp/src/arch-aarch64-syscalls.c +35 -3
  21. data/ext/enterprise_script_service/libseccomp/src/arch-arm-syscalls.c +35 -3
  22. data/ext/enterprise_script_service/libseccomp/src/arch-mips-syscalls.c +43 -11
  23. data/ext/enterprise_script_service/libseccomp/src/arch-mips64-syscalls.c +33 -1
  24. data/ext/enterprise_script_service/libseccomp/src/arch-mips64n32-syscalls.c +33 -1
  25. data/ext/enterprise_script_service/libseccomp/src/arch-parisc-syscalls.c +34 -2
  26. data/ext/enterprise_script_service/libseccomp/src/arch-ppc-syscalls.c +43 -11
  27. data/ext/enterprise_script_service/libseccomp/src/arch-ppc64-syscalls.c +44 -12
  28. data/ext/enterprise_script_service/libseccomp/src/arch-s390-syscalls.c +46 -14
  29. data/ext/enterprise_script_service/libseccomp/src/arch-s390.c +142 -18
  30. data/ext/enterprise_script_service/libseccomp/src/arch-s390x-syscalls.c +47 -15
  31. data/ext/enterprise_script_service/libseccomp/src/arch-s390x.c +143 -17
  32. data/ext/enterprise_script_service/libseccomp/src/arch-x32-syscalls.c +33 -1
  33. data/ext/enterprise_script_service/libseccomp/src/arch-x86-syscalls.c +94 -12
  34. data/ext/enterprise_script_service/libseccomp/src/arch-x86.c +142 -19
  35. data/ext/enterprise_script_service/libseccomp/src/arch-x86_64-syscalls.c +33 -1
  36. data/ext/enterprise_script_service/libseccomp/src/db.c +1 -0
  37. data/ext/enterprise_script_service/libseccomp/src/gen_bpf.c +10 -3
  38. data/ext/enterprise_script_service/libseccomp/src/python/Makefile.am +4 -4
  39. data/ext/enterprise_script_service/libseccomp/src/python/seccomp.pyx +2 -0
  40. data/ext/enterprise_script_service/libseccomp/tests/.gitignore +1 -0
  41. data/ext/enterprise_script_service/libseccomp/tests/50-sim-hash_collision.c +98 -0
  42. data/ext/enterprise_script_service/libseccomp/tests/50-sim-hash_collision.py +61 -0
  43. data/ext/enterprise_script_service/libseccomp/tests/50-sim-hash_collision.tests +18 -0
  44. data/ext/enterprise_script_service/libseccomp/tests/Makefile.am +6 -3
  45. data/ext/enterprise_script_service/libseccomp/tools/Makefile.am +0 -2
  46. data/ext/enterprise_script_service/libseccomp/tools/check-syntax +1 -0
  47. data/ext/enterprise_script_service/libseccomp/tools/scmp_bpf_sim.c +2 -0
  48. data/ext/enterprise_script_service/mruby-mpdecimal/src/ext.c +1 -1
  49. data/ext/enterprise_script_service/mruby/.gitignore +2 -2
  50. data/ext/enterprise_script_service/mruby/CONTRIBUTING.md +10 -3
  51. data/ext/enterprise_script_service/mruby/Doxyfile +2408 -0
  52. data/ext/enterprise_script_service/mruby/README.md +21 -8
  53. data/ext/enterprise_script_service/mruby/Rakefile +4 -13
  54. data/ext/enterprise_script_service/mruby/appveyor_config.rb +1 -1
  55. data/ext/enterprise_script_service/mruby/build_config.rb +3 -3
  56. data/ext/enterprise_script_service/mruby/doc/guides/compile.md +42 -42
  57. data/ext/enterprise_script_service/mruby/doc/guides/debugger.md +1 -1
  58. data/ext/enterprise_script_service/mruby/doc/guides/mrbconf.md +45 -6
  59. data/ext/enterprise_script_service/mruby/doc/guides/mrbgems.md +5 -0
  60. data/ext/enterprise_script_service/mruby/doc/limitations.md +88 -38
  61. data/ext/enterprise_script_service/mruby/doc/mruby_logo_red_icon.png +0 -0
  62. data/ext/enterprise_script_service/mruby/doc/opcode.md +94 -94
  63. data/ext/enterprise_script_service/mruby/include/mrbconf.h +74 -11
  64. data/ext/enterprise_script_service/mruby/include/mruby.h +242 -146
  65. data/ext/enterprise_script_service/mruby/include/mruby/array.h +7 -7
  66. data/ext/enterprise_script_service/mruby/include/mruby/boxing_nan.h +2 -9
  67. data/ext/enterprise_script_service/mruby/include/mruby/boxing_no.h +11 -10
  68. data/ext/enterprise_script_service/mruby/include/mruby/boxing_word.h +104 -69
  69. data/ext/enterprise_script_service/mruby/include/mruby/class.h +7 -5
  70. data/ext/enterprise_script_service/mruby/include/mruby/common.h +9 -7
  71. data/ext/enterprise_script_service/mruby/include/mruby/compile.h +6 -6
  72. data/ext/enterprise_script_service/mruby/include/mruby/data.h +5 -5
  73. data/ext/enterprise_script_service/mruby/include/mruby/debug.h +2 -2
  74. data/ext/enterprise_script_service/mruby/include/mruby/dump.h +3 -7
  75. data/ext/enterprise_script_service/mruby/include/mruby/error.h +34 -6
  76. data/ext/enterprise_script_service/mruby/include/mruby/gc.h +2 -2
  77. data/ext/enterprise_script_service/mruby/include/mruby/hash.h +4 -11
  78. data/ext/enterprise_script_service/mruby/include/mruby/irep.h +16 -4
  79. data/ext/enterprise_script_service/mruby/include/mruby/istruct.h +4 -4
  80. data/ext/enterprise_script_service/mruby/include/mruby/khash.h +2 -2
  81. data/ext/enterprise_script_service/mruby/include/mruby/numeric.h +41 -7
  82. data/ext/enterprise_script_service/mruby/include/mruby/object.h +8 -9
  83. data/ext/enterprise_script_service/mruby/include/mruby/opcode.h +2 -2
  84. data/ext/enterprise_script_service/mruby/include/mruby/ops.h +6 -6
  85. data/ext/enterprise_script_service/mruby/include/mruby/proc.h +19 -13
  86. data/ext/enterprise_script_service/mruby/include/mruby/range.h +10 -4
  87. data/ext/enterprise_script_service/mruby/include/mruby/re.h +2 -2
  88. data/ext/enterprise_script_service/mruby/include/mruby/string.h +130 -107
  89. data/ext/enterprise_script_service/mruby/include/mruby/throw.h +2 -2
  90. data/ext/enterprise_script_service/mruby/include/mruby/value.h +137 -49
  91. data/ext/enterprise_script_service/mruby/include/mruby/variable.h +3 -5
  92. data/ext/enterprise_script_service/mruby/include/mruby/version.h +24 -10
  93. data/ext/enterprise_script_service/mruby/lib/mruby-core-ext.rb +2 -39
  94. data/ext/enterprise_script_service/mruby/lib/mruby/build.rb +32 -15
  95. data/ext/enterprise_script_service/mruby/lib/mruby/build/command.rb +63 -17
  96. data/ext/enterprise_script_service/mruby/lib/mruby/build/load_gems.rb +24 -10
  97. data/ext/enterprise_script_service/mruby/lib/mruby/gem.rb +11 -7
  98. data/ext/enterprise_script_service/mruby/lib/mruby/lockfile.rb +81 -0
  99. data/ext/enterprise_script_service/mruby/minirake +27 -11
  100. data/ext/enterprise_script_service/mruby/mrbgems/default.gembox +3 -0
  101. data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/mrbgem.rake +0 -1
  102. data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/mrblib/array.rb +47 -9
  103. data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/src/array.c +3 -3
  104. data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/test/array.rb +50 -29
  105. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c +3 -3
  106. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apiprint.c +2 -2
  107. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/cmdprint.c +3 -3
  108. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c +2 -2
  109. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.h +1 -1
  110. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdbconf.h +4 -0
  111. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +28 -1
  112. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c +1 -2
  113. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/bintest/mruby.rb +75 -8
  114. data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c +134 -90
  115. data/ext/enterprise_script_service/mruby/mrbgems/mruby-class-ext/src/class.c +7 -8
  116. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/codegen.c +69 -46
  117. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/keywords +0 -3
  118. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/lex.def +51 -59
  119. data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/parse.y +430 -241
  120. data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/mrbgem.rake +10 -0
  121. data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/mrblib/complex.rb +122 -0
  122. data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/src/complex.c +249 -0
  123. data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/test/complex.rb +153 -0
  124. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-chain/mrblib/chain.rb +19 -17
  125. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-chain/test/enum_chain.rb +41 -9
  126. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-ext/mrblib/enum.rb +30 -4
  127. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-ext/test/enum.rb +8 -3
  128. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/mrbgem.rake +0 -1
  129. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/mrblib/enumerator.rb +46 -14
  130. data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/test/enumerator.rb +51 -2
  131. data/ext/enterprise_script_service/mruby/mrbgems/mruby-error/src/exception.c +10 -0
  132. data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/src/eval.c +47 -44
  133. data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/test/eval.rb +2 -2
  134. data/ext/enterprise_script_service/mruby/mrbgems/mruby-exit/src/mruby-exit.c +9 -4
  135. data/ext/enterprise_script_service/mruby/mrbgems/mruby-fiber/src/fiber.c +16 -12
  136. data/ext/enterprise_script_service/mruby/mrbgems/mruby-fiber/test/fiber.rb +1 -1
  137. data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/mrbgem.rake +0 -2
  138. data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/mrblib/hash.rb +3 -0
  139. data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/test/hash.rb +3 -7
  140. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/README.md +1 -3
  141. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrbgem.rake +1 -1
  142. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/file.rb +0 -5
  143. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/io.rb +24 -38
  144. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/kernel.rb +16 -0
  145. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file.c +19 -18
  146. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file_test.c +5 -16
  147. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/io.c +54 -42
  148. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/file.rb +24 -20
  149. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/file_test.rb +4 -9
  150. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/io.rb +41 -35
  151. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/mruby_io_test.c +9 -36
  152. data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/mrbgem.rake +1 -1
  153. data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/src/kernel.c +9 -27
  154. data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/test/kernel.rb +2 -0
  155. data/ext/enterprise_script_service/mruby/mrbgems/mruby-math/src/math.c +5 -2
  156. data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/src/metaprog.c +39 -24
  157. data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/test/metaprog.rb +48 -17
  158. data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/mrblib/method.rb +0 -12
  159. data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/src/method.c +134 -101
  160. data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/test/method.rb +9 -1
  161. data/ext/enterprise_script_service/mruby/mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb +1 -5
  162. data/ext/enterprise_script_service/mruby/mrbgems/mruby-numeric-ext/src/numeric_ext.c +17 -37
  163. data/ext/enterprise_script_service/mruby/mrbgems/mruby-numeric-ext/test/numeric.rb +0 -8
  164. data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/mrbgem.rake +1 -1
  165. data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/mrblib/object.rb +15 -1
  166. data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/src/object.c +35 -6
  167. data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/test/nil.rb +4 -0
  168. data/ext/enterprise_script_service/mruby/mrbgems/mruby-objectspace/src/mruby_objectspace.c +1 -5
  169. data/ext/enterprise_script_service/mruby/mrbgems/mruby-objectspace/test/objectspace.rb +1 -1
  170. data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/src/pack.c +28 -23
  171. data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/test/pack.rb +43 -49
  172. data/ext/enterprise_script_service/mruby/mrbgems/mruby-print/mrblib/print.rb +3 -9
  173. data/ext/enterprise_script_service/mruby/mrbgems/mruby-proc-ext/src/proc.c +6 -9
  174. data/ext/enterprise_script_service/mruby/mrbgems/mruby-proc-ext/test/proc.rb +21 -5
  175. data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/random.c +157 -124
  176. data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/test/random.rb +72 -26
  177. data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/mrblib/range.rb +38 -0
  178. data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/src/range.c +26 -11
  179. data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/test/range.rb +111 -1
  180. data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/mrbgem.rake +5 -0
  181. data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/mrblib/rational.rb +117 -0
  182. data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/src/rational.c +209 -0
  183. data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/test/rational.rb +308 -0
  184. data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/README.md +1 -1
  185. data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/src/socket.c +10 -9
  186. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/src/kernel.c +2 -2
  187. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/src/sprintf.c +22 -24
  188. data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/mrbgem.rake +0 -1
  189. data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/mrblib/string.rb +8 -4
  190. data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/src/string.c +116 -117
  191. data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/test/numeric.rb +29 -0
  192. data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/test/range.rb +26 -0
  193. data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/test/string.rb +32 -50
  194. data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/mrblib/struct.rb +5 -7
  195. data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/src/struct.c +43 -57
  196. data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/test/struct.rb +16 -11
  197. data/ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/src/symbol.c +2 -2
  198. data/ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb +1 -1
  199. data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/driver.c +152 -1
  200. data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/mrbgem.rake +4 -3
  201. data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/vformat.c +200 -0
  202. data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/include/mruby/time.h +2 -1
  203. data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/src/time.c +199 -68
  204. data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/test/time.rb +81 -46
  205. data/ext/enterprise_script_service/mruby/mrblib/array.rb +14 -16
  206. data/ext/enterprise_script_service/mruby/mrblib/enum.rb +13 -9
  207. data/ext/enterprise_script_service/mruby/mrblib/hash.rb +5 -7
  208. data/ext/enterprise_script_service/mruby/mrblib/kernel.rb +1 -1
  209. data/ext/enterprise_script_service/mruby/mrblib/numeric.rb +4 -4
  210. data/ext/enterprise_script_service/mruby/mrblib/range.rb +1 -1
  211. data/ext/enterprise_script_service/mruby/mrblib/string.rb +55 -112
  212. data/ext/enterprise_script_service/mruby/mruby-source.gemspec +1 -1
  213. data/ext/enterprise_script_service/mruby/oss-fuzz/config/mruby.dict +105 -0
  214. data/ext/enterprise_script_service/mruby/oss-fuzz/config/mruby_fuzzer.options +5 -0
  215. data/ext/enterprise_script_service/mruby/oss-fuzz/config/mruby_proto_fuzzer.options +4 -0
  216. data/ext/enterprise_script_service/mruby/oss-fuzz/mruby_fuzzer.c +18 -0
  217. data/ext/enterprise_script_service/mruby/oss-fuzz/mruby_proto_fuzzer.cpp +44 -0
  218. data/ext/enterprise_script_service/mruby/oss-fuzz/proto_to_ruby.cpp +455 -0
  219. data/ext/enterprise_script_service/mruby/oss-fuzz/proto_to_ruby.h +55 -0
  220. data/ext/enterprise_script_service/mruby/oss-fuzz/ruby.proto +201 -0
  221. data/ext/enterprise_script_service/mruby/src/array.c +95 -46
  222. data/ext/enterprise_script_service/mruby/src/backtrace.c +6 -8
  223. data/ext/enterprise_script_service/mruby/src/class.c +370 -278
  224. data/ext/enterprise_script_service/mruby/src/codedump.c +34 -34
  225. data/ext/enterprise_script_service/mruby/src/debug.c +2 -2
  226. data/ext/enterprise_script_service/mruby/src/dump.c +8 -6
  227. data/ext/enterprise_script_service/mruby/src/enum.c +1 -1
  228. data/ext/enterprise_script_service/mruby/src/error.c +157 -55
  229. data/ext/enterprise_script_service/mruby/src/etc.c +13 -46
  230. data/ext/enterprise_script_service/mruby/src/fmt_fp.c +2 -2
  231. data/ext/enterprise_script_service/mruby/src/gc.c +30 -11
  232. data/ext/enterprise_script_service/mruby/src/hash.c +23 -14
  233. data/ext/enterprise_script_service/mruby/src/kernel.c +16 -54
  234. data/ext/enterprise_script_service/mruby/src/load.c +40 -76
  235. data/ext/enterprise_script_service/mruby/src/numeric.c +164 -94
  236. data/ext/enterprise_script_service/mruby/src/object.c +16 -39
  237. data/ext/enterprise_script_service/mruby/src/pool.c +0 -2
  238. data/ext/enterprise_script_service/mruby/src/proc.c +47 -48
  239. data/ext/enterprise_script_service/mruby/src/range.c +22 -35
  240. data/ext/enterprise_script_service/mruby/src/state.c +5 -94
  241. data/ext/enterprise_script_service/mruby/src/string.c +874 -710
  242. data/ext/enterprise_script_service/mruby/src/symbol.c +73 -48
  243. data/ext/enterprise_script_service/mruby/src/variable.c +58 -38
  244. data/ext/enterprise_script_service/mruby/src/vm.c +133 -304
  245. data/ext/enterprise_script_service/mruby/tasks/doc.rake +48 -0
  246. data/ext/enterprise_script_service/mruby/tasks/toolchains/clang.rake +3 -4
  247. data/ext/enterprise_script_service/mruby/tasks/toolchains/gcc.rake +20 -19
  248. data/ext/enterprise_script_service/mruby/tasks/toolchains/visualcpp.rake +0 -12
  249. data/ext/enterprise_script_service/mruby/test/assert.rb +186 -25
  250. data/ext/enterprise_script_service/mruby/test/t/array.rb +34 -6
  251. data/ext/enterprise_script_service/mruby/test/t/class.rb +26 -0
  252. data/ext/enterprise_script_service/mruby/test/t/enumerable.rb +2 -2
  253. data/ext/enterprise_script_service/mruby/test/t/float.rb +17 -17
  254. data/ext/enterprise_script_service/mruby/test/t/hash.rb +2 -0
  255. data/ext/enterprise_script_service/mruby/test/t/integer.rb +14 -6
  256. data/ext/enterprise_script_service/mruby/test/t/kernel.rb +38 -19
  257. data/ext/enterprise_script_service/mruby/test/t/module.rb +87 -14
  258. data/ext/enterprise_script_service/mruby/test/t/numeric.rb +65 -23
  259. data/ext/enterprise_script_service/mruby/test/t/range.rb +4 -4
  260. data/ext/enterprise_script_service/mruby/test/t/string.rb +211 -49
  261. data/ext/enterprise_script_service/mruby/test/t/syntax.rb +19 -2
  262. data/ext/enterprise_script_service/mruby/test/t/vformat.rb +92 -0
  263. data/ext/enterprise_script_service/mruby/travis_config.rb +2 -2
  264. data/ext/enterprise_script_service/mruby_config.rb +10 -0
  265. data/ext/enterprise_script_service/mruby_engine.cpp +2 -2
  266. data/ext/enterprise_script_service/mruby_engine.gembox +1 -0
  267. data/ext/enterprise_script_service/msgpack/CHANGELOG.md +14 -0
  268. data/ext/enterprise_script_service/msgpack/Files.cmake +4 -0
  269. data/ext/enterprise_script_service/msgpack/README.md +1 -1
  270. data/ext/enterprise_script_service/msgpack/appveyor.yml +1 -1
  271. data/ext/enterprise_script_service/msgpack/erb/v1/cpp03_msgpack_tuple.hpp.erb +1 -1
  272. data/ext/enterprise_script_service/msgpack/erb/v1/cpp03_msgpack_tuple_decl.hpp.erb +1 -1
  273. data/ext/enterprise_script_service/msgpack/erb/v1/cpp03_zone.hpp.erb +3 -3
  274. data/ext/enterprise_script_service/msgpack/example/boost/asio_send_recv.cpp +1 -1
  275. data/ext/enterprise_script_service/msgpack/include/msgpack/adaptor/cpp11/timespec.hpp +16 -0
  276. data/ext/enterprise_script_service/msgpack/include/msgpack/adaptor/wstring.hpp +15 -0
  277. data/ext/enterprise_script_service/msgpack/include/msgpack/object.h +2 -0
  278. data/ext/enterprise_script_service/msgpack/include/msgpack/pack_template.h +17 -9
  279. data/ext/enterprise_script_service/msgpack/include/msgpack/sysdep.h +27 -16
  280. data/ext/enterprise_script_service/msgpack/include/msgpack/type.hpp +2 -0
  281. data/ext/enterprise_script_service/msgpack/include/msgpack/unpack_template.h +5 -0
  282. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/array_ref.hpp +0 -1
  283. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/check_container_size.hpp +1 -1
  284. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/cpp11/chrono.hpp +5 -5
  285. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/cpp11/timespec.hpp +140 -0
  286. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp03_msgpack_tuple.hpp +32 -32
  287. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp03_msgpack_tuple_decl.hpp +32 -32
  288. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp11_msgpack_tuple.hpp +6 -6
  289. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp11_msgpack_tuple_decl.hpp +10 -10
  290. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/ext.hpp +1 -1
  291. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/fixint.hpp +5 -4
  292. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/int.hpp +40 -13
  293. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/int_decl.hpp +3 -2
  294. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/wstring.hpp +121 -0
  295. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/detail/cpp03_zone.hpp +3 -3
  296. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/detail/cpp11_zone.hpp +3 -3
  297. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/object.hpp +6 -6
  298. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/object_fwd.hpp +1 -1
  299. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/pack.hpp +40 -5
  300. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/unpack.hpp +11 -11
  301. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/vrefbuffer.hpp +7 -7
  302. data/ext/enterprise_script_service/msgpack/include/msgpack/v1/zbuffer.hpp +5 -5
  303. data/ext/enterprise_script_service/msgpack/include/msgpack/v2/adaptor/int_decl.hpp +1 -1
  304. data/ext/enterprise_script_service/msgpack/include/msgpack/v2/create_object_visitor.hpp +1 -1
  305. data/ext/enterprise_script_service/msgpack/include/msgpack/v2/parse.hpp +13 -13
  306. data/ext/enterprise_script_service/msgpack/include/msgpack/v2/x3_parse.hpp +28 -26
  307. data/ext/enterprise_script_service/msgpack/include/msgpack/v3/adaptor/int_decl.hpp +1 -1
  308. data/ext/enterprise_script_service/msgpack/include/msgpack/v3/parse.hpp +13 -13
  309. data/ext/enterprise_script_service/msgpack/include/msgpack/version_master.h +2 -2
  310. data/ext/enterprise_script_service/msgpack/include/msgpack/zbuffer.h +6 -6
  311. data/ext/enterprise_script_service/msgpack/include/msgpack/zone.h +1 -1
  312. data/ext/enterprise_script_service/msgpack/src/objectc.c +83 -148
  313. data/ext/enterprise_script_service/msgpack/src/unpack.c +73 -47
  314. data/ext/enterprise_script_service/msgpack/test/CMakeLists.txt +1 -1
  315. data/ext/enterprise_script_service/msgpack/test/array_ref.cpp +5 -0
  316. data/ext/enterprise_script_service/msgpack/test/boost_fusion.cpp +5 -0
  317. data/ext/enterprise_script_service/msgpack/test/boost_optional.cpp +7 -0
  318. data/ext/enterprise_script_service/msgpack/test/boost_string_ref.cpp +7 -0
  319. data/ext/enterprise_script_service/msgpack/test/boost_string_view.cpp +6 -0
  320. data/ext/enterprise_script_service/msgpack/test/boost_variant.cpp +15 -9
  321. data/ext/enterprise_script_service/msgpack/test/buffer.cpp +7 -0
  322. data/ext/enterprise_script_service/msgpack/test/carray.cpp +7 -0
  323. data/ext/enterprise_script_service/msgpack/test/cases.cpp +7 -1
  324. data/ext/enterprise_script_service/msgpack/test/convert.cpp +6 -0
  325. data/ext/enterprise_script_service/msgpack/test/fixint.cpp +7 -1
  326. data/ext/enterprise_script_service/msgpack/test/fixint_c.cpp +6 -1
  327. data/ext/enterprise_script_service/msgpack/test/fuzz_unpack_pack_fuzzer_cpp11.cpp +5 -0
  328. data/ext/enterprise_script_service/msgpack/test/iterator_cpp11.cpp +8 -2
  329. data/ext/enterprise_script_service/msgpack/test/json.cpp +6 -0
  330. data/ext/enterprise_script_service/msgpack/test/limit.cpp +7 -0
  331. data/ext/enterprise_script_service/msgpack/test/msgpack_basic.cpp +128 -6
  332. data/ext/enterprise_script_service/msgpack/test/msgpack_c.cpp +7 -2
  333. data/ext/enterprise_script_service/msgpack/test/msgpack_container.cpp +20 -3
  334. data/ext/enterprise_script_service/msgpack/test/msgpack_cpp11.cpp +159 -0
  335. data/ext/enterprise_script_service/msgpack/test/msgpack_cpp17.cpp +5 -0
  336. data/ext/enterprise_script_service/msgpack/test/msgpack_stream.cpp +8 -3
  337. data/ext/enterprise_script_service/msgpack/test/msgpack_tuple.cpp +6 -0
  338. data/ext/enterprise_script_service/msgpack/test/msgpack_vref.cpp +5 -0
  339. data/ext/enterprise_script_service/msgpack/test/msgpack_x3_parse.cpp +23 -18
  340. data/ext/enterprise_script_service/msgpack/test/object.cpp +77 -45
  341. data/ext/enterprise_script_service/msgpack/test/object_with_zone.cpp +28 -10
  342. data/ext/enterprise_script_service/msgpack/test/pack_unpack.cpp +25 -18
  343. data/ext/enterprise_script_service/msgpack/test/pack_unpack_c.cpp +7 -0
  344. data/ext/enterprise_script_service/msgpack/test/raw.cpp +17 -12
  345. data/ext/enterprise_script_service/msgpack/test/reference.cpp +6 -0
  346. data/ext/enterprise_script_service/msgpack/test/reference_cpp11.cpp +6 -0
  347. data/ext/enterprise_script_service/msgpack/test/reference_wrapper_cpp11.cpp +6 -0
  348. data/ext/enterprise_script_service/msgpack/test/shared_ptr_cpp11.cpp +6 -0
  349. data/ext/enterprise_script_service/msgpack/test/size_equal_only.cpp +6 -2
  350. data/ext/enterprise_script_service/msgpack/test/streaming.cpp +10 -3
  351. data/ext/enterprise_script_service/msgpack/test/streaming_c.cpp +7 -0
  352. data/ext/enterprise_script_service/msgpack/test/unique_ptr_cpp11.cpp +6 -0
  353. data/ext/enterprise_script_service/msgpack/test/user_class.cpp +5 -0
  354. data/ext/enterprise_script_service/msgpack/test/version.cpp +6 -0
  355. data/ext/enterprise_script_service/msgpack/test/visitor.cpp +7 -0
  356. data/ext/enterprise_script_service/msgpack/test/zone.cpp +6 -0
  357. data/lib/script_core/version.rb +1 -1
  358. data/lib/tasks/mruby/engine.gembox.example +1 -0
  359. data/lib/tasks/script_core.rake +21 -3
  360. data/spec/dummy/app/helpers/fields_helper.rb +2 -2
  361. data/spec/dummy/mruby/engine.gembox +1 -0
  362. data/spec/script_core_spec.rb +1 -1
  363. metadata +38 -22
  364. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/.gitignore +0 -1
  365. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/.travis.yml +0 -2
  366. data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/run_test.rb +0 -26
  367. data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/mrblib/kernel.rb +0 -15
  368. data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/mrblib/unbound_method.rb +0 -9
  369. data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/.gitignore +0 -5
  370. data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/.travis.yml +0 -2
  371. data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/packtest.rb +0 -157
  372. data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/run_test.rb +0 -26
  373. data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/mt19937ar.c +0 -224
  374. data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/mt19937ar.h +0 -80
  375. data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/random.h +0 -12
  376. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/.gitignore +0 -4
  377. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/.travis.yml +0 -29
  378. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/.travis_build_config.rb +0 -6
  379. data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/Rakefile +0 -29
  380. data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/.travis.yml +0 -4
  381. data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/run_test.rb +0 -28
@@ -22,6 +22,7 @@
22
22
  #if __GNUC__ >= 4
23
23
  #pragma GCC diagnostic push
24
24
  #pragma GCC diagnostic ignored "-Wunused-parameter"
25
+ #pragma GCC diagnostic ignored "-Wconversion"
25
26
  #endif // __GNUC__ >= 4
26
27
 
27
28
  #include <boost/config/warning_disable.hpp>
@@ -202,7 +203,7 @@ const auto mp_object_def =
202
203
  (
203
204
  [](auto& ctx){
204
205
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
205
- std::int8_t val = _attr(ctx);
206
+ std::int8_t val = static_cast<std::int8_t>(_attr(ctx));
206
207
  app_specific.vis.visit_negative_integer(val);
207
208
  }
208
209
  )
@@ -253,7 +254,7 @@ const auto mp_object_def =
253
254
  (
254
255
  [](auto& ctx){
255
256
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
256
- std::int8_t val = _attr(ctx);
257
+ std::int8_t val = static_cast<std::int8_t>(_attr(ctx));
257
258
  app_specific.vis.visit_negative_integer(val);
258
259
  }
259
260
  )
@@ -264,7 +265,7 @@ const auto mp_object_def =
264
265
  (
265
266
  [](auto& ctx){
266
267
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
267
- std::int16_t val = _attr(ctx);
268
+ std::int16_t val = static_cast<std::int16_t>(_attr(ctx));
268
269
  app_specific.vis.visit_negative_integer(val);
269
270
  }
270
271
  )
@@ -275,7 +276,7 @@ const auto mp_object_def =
275
276
  (
276
277
  [](auto& ctx){
277
278
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
278
- std::int32_t val = _attr(ctx);
279
+ std::int32_t val = static_cast<std::int32_t>(_attr(ctx));
279
280
  app_specific.vis.visit_negative_integer(val);
280
281
  }
281
282
  )
@@ -286,7 +287,7 @@ const auto mp_object_def =
286
287
  (
287
288
  [](auto& ctx){
288
289
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
289
- std::int64_t val = _attr(ctx);
290
+ std::int64_t val = static_cast<std::int64_t>(_attr(ctx));
290
291
  app_specific.vis.visit_negative_integer(val);
291
292
  }
292
293
  )
@@ -339,7 +340,7 @@ const auto mp_object_def =
339
340
  [](auto& ctx){
340
341
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
341
342
  auto const& str = _attr(ctx);
342
- std::size_t size = std::distance(str.begin(), str.end());
343
+ auto size = static_cast<uint32_t>(std::distance(str.begin(), str.end()));
343
344
  app_specific.vis.visit_str(size ? &str.front() : nullptr, size);
344
345
  }
345
346
  )
@@ -363,7 +364,7 @@ const auto mp_object_def =
363
364
  [](auto& ctx){
364
365
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
365
366
  auto const& str = _attr(ctx);
366
- std::size_t size = std::distance(str.begin(), str.end());
367
+ auto size = static_cast<uint32_t>(std::distance(str.begin(), str.end()));
367
368
  app_specific.vis.visit_str(size ? &str.front() : nullptr, size);
368
369
  }
369
370
  )
@@ -387,7 +388,7 @@ const auto mp_object_def =
387
388
  [](auto& ctx){
388
389
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
389
390
  auto const& str = _attr(ctx);
390
- std::size_t size = std::distance(str.begin(), str.end());
391
+ auto size = static_cast<uint32_t>(std::distance(str.begin(), str.end()));
391
392
  app_specific.vis.visit_str(size ? &str.front() : nullptr, size);
392
393
  }
393
394
  )
@@ -411,7 +412,7 @@ const auto mp_object_def =
411
412
  [](auto& ctx){
412
413
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
413
414
  auto const& str = _attr(ctx);
414
- std::size_t size = std::distance(str.begin(), str.end());
415
+ auto size = static_cast<uint32_t>(std::distance(str.begin(), str.end()));
415
416
  app_specific.vis.visit_str(size ? &str.front() : nullptr, size);
416
417
  }
417
418
  )
@@ -435,7 +436,7 @@ const auto mp_object_def =
435
436
  [](auto& ctx){
436
437
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
437
438
  auto const& bin = _attr(ctx);
438
- std::size_t size = std::distance(bin.begin(), bin.end());
439
+ auto size = static_cast<uint32_t>(std::distance(bin.begin(), bin.end()));
439
440
  app_specific.vis.visit_bin(size ? &bin.front() : nullptr, size);
440
441
  }
441
442
  )
@@ -459,7 +460,7 @@ const auto mp_object_def =
459
460
  [](auto& ctx){
460
461
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
461
462
  auto const& bin = _attr(ctx);
462
- std::size_t size = std::distance(bin.begin(), bin.end());
463
+ auto size = static_cast<uint32_t>(std::distance(bin.begin(), bin.end()));
463
464
  app_specific.vis.visit_bin(size ? &bin.front() : nullptr, size);
464
465
  }
465
466
  )
@@ -483,7 +484,7 @@ const auto mp_object_def =
483
484
  [](auto& ctx){
484
485
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
485
486
  auto const& bin = _attr(ctx);
486
- std::size_t size = std::distance(bin.begin(), bin.end());
487
+ auto size = static_cast<uint32_t>(std::distance(bin.begin(), bin.end()));
487
488
  app_specific.vis.visit_bin(size ? &bin.front() : nullptr, size);
488
489
  }
489
490
  )
@@ -494,7 +495,7 @@ const auto mp_object_def =
494
495
  (
495
496
  [](auto& ctx){
496
497
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
497
- std::size_t size = _attr(ctx) & 0b00001111;
498
+ uint32_t size = _attr(ctx) & 0b00001111;
498
499
  app_specific.index_sizes.emplace_back(size, index_size::type_t::array);
499
500
  app_specific.vis.start_array(size);
500
501
  }
@@ -508,7 +509,7 @@ const auto mp_object_def =
508
509
  (
509
510
  [](auto& ctx){
510
511
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
511
- std::size_t size = _attr(ctx);
512
+ uint32_t size = _attr(ctx);
512
513
  app_specific.index_sizes.emplace_back(size, index_size::type_t::array);
513
514
  app_specific.vis.start_array(size);
514
515
  }
@@ -522,7 +523,7 @@ const auto mp_object_def =
522
523
  (
523
524
  [](auto& ctx){
524
525
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
525
- std::size_t size = _attr(ctx);
526
+ uint32_t size = _attr(ctx);
526
527
  app_specific.index_sizes.emplace_back(size, index_size::type_t::array);
527
528
  app_specific.vis.start_array(size);
528
529
  }
@@ -536,7 +537,7 @@ const auto mp_object_def =
536
537
  (
537
538
  [](auto& ctx){
538
539
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
539
- std::size_t size = _attr(ctx) & 0b00001111;
540
+ uint32_t size = _attr(ctx) & 0b00001111;
540
541
  app_specific.index_sizes.emplace_back(size, index_size::type_t::map);
541
542
  app_specific.vis.start_map(size);
542
543
  }
@@ -550,7 +551,7 @@ const auto mp_object_def =
550
551
  (
551
552
  [](auto& ctx){
552
553
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
553
- std::size_t size = _attr(ctx);
554
+ uint32_t size = _attr(ctx);
554
555
  app_specific.index_sizes.emplace_back(size, index_size::type_t::map);
555
556
  app_specific.vis.start_map(size);
556
557
  }
@@ -564,7 +565,7 @@ const auto mp_object_def =
564
565
  (
565
566
  [](auto& ctx){
566
567
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
567
- std::size_t size = _attr(ctx);
568
+ uint32_t size = _attr(ctx);
568
569
  app_specific.index_sizes.emplace_back(size, index_size::type_t::map);
569
570
  app_specific.vis.start_map(size);
570
571
  }
@@ -591,7 +592,7 @@ const auto mp_object_def =
591
592
  [](auto& ctx){
592
593
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
593
594
  auto const& ext = _attr(ctx);
594
- std::size_t size = std::distance(ext.begin(), ext.end());
595
+ auto size = static_cast<uint32_t>(std::distance(ext.begin(), ext.end()));
595
596
  app_specific.vis.visit_ext(size ? &ext.front() : nullptr, size);
596
597
  }
597
598
  )
@@ -615,7 +616,7 @@ const auto mp_object_def =
615
616
  [](auto& ctx){
616
617
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
617
618
  auto const& ext = _attr(ctx);
618
- std::size_t size = std::distance(ext.begin(), ext.end());
619
+ auto size = static_cast<uint32_t>(std::distance(ext.begin(), ext.end()));
619
620
  app_specific.vis.visit_ext(size ? &ext.front() : nullptr, size);
620
621
  }
621
622
  )
@@ -639,7 +640,7 @@ const auto mp_object_def =
639
640
  [](auto& ctx){
640
641
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
641
642
  auto const& ext = _attr(ctx);
642
- std::size_t size = std::distance(ext.begin(), ext.end());
643
+ auto size = static_cast<uint32_t>(std::distance(ext.begin(), ext.end()));
643
644
  app_specific.vis.visit_ext(size ? &ext.front() : nullptr, size);
644
645
  }
645
646
  )
@@ -663,7 +664,7 @@ const auto mp_object_def =
663
664
  [](auto& ctx){
664
665
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
665
666
  auto const& ext = _attr(ctx);
666
- std::size_t size = std::distance(ext.begin(), ext.end());
667
+ auto size = static_cast<uint32_t>(std::distance(ext.begin(), ext.end()));
667
668
  app_specific.vis.visit_ext(size ? &ext.front() : nullptr, size);
668
669
  }
669
670
  )
@@ -687,7 +688,7 @@ const auto mp_object_def =
687
688
  [](auto& ctx){
688
689
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
689
690
  auto const& ext = _attr(ctx);
690
- std::size_t size = std::distance(ext.begin(), ext.end());
691
+ auto size = static_cast<uint32_t>(std::distance(ext.begin(), ext.end()));
691
692
  app_specific.vis.visit_ext(size ? &ext.front() : nullptr, size);
692
693
  }
693
694
  )
@@ -711,7 +712,7 @@ const auto mp_object_def =
711
712
  [](auto& ctx){
712
713
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
713
714
  auto const& ext = _attr(ctx);
714
- std::size_t size = std::distance(ext.begin(), ext.end());
715
+ auto size = static_cast<uint32_t>(std::distance(ext.begin(), ext.end()));
715
716
  app_specific.vis.visit_ext(size ? &ext.front() : nullptr, size);
716
717
  }
717
718
  )
@@ -735,7 +736,7 @@ const auto mp_object_def =
735
736
  [](auto& ctx){
736
737
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
737
738
  auto const& ext = _attr(ctx);
738
- std::size_t size = std::distance(ext.begin(), ext.end());
739
+ auto size = static_cast<uint32_t>(std::distance(ext.begin(), ext.end()));
739
740
  app_specific.vis.visit_ext(size ? &ext.front() : nullptr, size);
740
741
  }
741
742
  )
@@ -759,7 +760,7 @@ const auto mp_object_def =
759
760
  [](auto& ctx){
760
761
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
761
762
  auto const& ext = _attr(ctx);
762
- std::size_t size = std::distance(ext.begin(), ext.end());
763
+ auto size = static_cast<uint32_t>(std::distance(ext.begin(), ext.end()));
763
764
  app_specific.vis.visit_ext(size ? &ext.front() : nullptr, size);
764
765
  }
765
766
  )
@@ -771,6 +772,7 @@ const auto array_item_def =
771
772
  [](auto& ctx){
772
773
  auto& app_specific = x3::get<tag_app_specific>(ctx).get();
773
774
  app_specific.vis.start_array_item();
775
+
774
776
  _pass(ctx) = true;
775
777
  }
776
778
  )
@@ -30,7 +30,7 @@ struct is_signed;
30
30
 
31
31
 
32
32
  template <bool Signed>
33
- struct object_char_sign;
33
+ struct object_sign;
34
34
 
35
35
  //using v2::type::detail::convert_integer_sign;
36
36
 
@@ -63,29 +63,29 @@ private:
63
63
  load<T>(size, load_pos);
64
64
  if (size == 0) {
65
65
  if (!sv(size)) {
66
- off = m_current - m_start;
66
+ off = static_cast<std::size_t>(m_current - m_start);
67
67
  return PARSE_STOP_VISITOR;
68
68
  }
69
69
  if (!ev()) {
70
- off = m_current - m_start;
70
+ off = static_cast<std::size_t>(m_current - m_start);
71
71
  return PARSE_STOP_VISITOR;
72
72
  }
73
73
  parse_return ret = m_stack.consume(holder(), m_current);
74
74
  ++m_current;
75
75
  if (ret != PARSE_CONTINUE) {
76
- off = m_current - m_start;
76
+ off = static_cast<std::size_t>(m_current - m_start);
77
77
  return ret;
78
78
  }
79
79
  }
80
80
  else {
81
81
  if (!sv(size)) {
82
- off = m_current - m_start;
82
+ off = static_cast<std::size_t>(m_current - m_start);
83
83
  return PARSE_STOP_VISITOR;
84
84
  }
85
85
  parse_return ret = m_stack.push(holder(), sv.type(), static_cast<uint32_t>(size));
86
86
  ++m_current;
87
87
  if (ret != PARSE_CONTINUE) {
88
- off = m_current - m_start;
88
+ off = static_cast<std::size_t>(m_current - m_start);
89
89
  return ret;
90
90
  }
91
91
  }
@@ -95,13 +95,13 @@ private:
95
95
 
96
96
  parse_return after_visit_proc(bool visit_result, std::size_t& off) {
97
97
  if (!visit_result) {
98
- off = m_current - m_start;
98
+ off = static_cast<std::size_t>(m_current - m_start);
99
99
  return PARSE_STOP_VISITOR;
100
100
  }
101
101
  parse_return ret = m_stack.consume(holder(), m_current);
102
102
  ++m_current;
103
103
  if (ret != PARSE_CONTINUE) {
104
- off = m_current - m_start;
104
+ off = static_cast<std::size_t>(m_current - m_start);
105
105
  }
106
106
  m_cs = MSGPACK_CS_HEADER;
107
107
  return ret;
@@ -253,7 +253,7 @@ inline parse_return context<VisitorHolder>::execute(const char* data, std::size_
253
253
  msgpack::object obj;
254
254
 
255
255
  if(m_current == pe) {
256
- off = m_current - m_start;
256
+ off = static_cast<std::size_t>(m_current - m_start);
257
257
  return PARSE_CONTINUE;
258
258
  }
259
259
  bool fixed_trail_again = false;
@@ -335,7 +335,7 @@ inline parse_return context<VisitorHolder>::execute(const char* data, std::size_
335
335
  parse_return upr = after_visit_proc(visret, off);
336
336
  if (upr != PARSE_CONTINUE) return upr;
337
337
  } else {
338
- off = m_current - m_start;
338
+ off = static_cast<std::size_t>(m_current - m_start);
339
339
  holder().visitor().parse_error(off - 1, off);
340
340
  return PARSE_PARSE_ERROR;
341
341
  }
@@ -347,7 +347,7 @@ inline parse_return context<VisitorHolder>::execute(const char* data, std::size_
347
347
  fixed_trail_again = false;
348
348
  }
349
349
  if(static_cast<std::size_t>(pe - m_current) < m_trail) {
350
- off = m_current - m_start;
350
+ off = static_cast<std::size_t>(m_current - m_start);
351
351
  return PARSE_CONTINUE;
352
352
  }
353
353
  n = m_current;
@@ -617,14 +617,14 @@ inline parse_return context<VisitorHolder>::execute(const char* data, std::size_
617
617
  if (ret != PARSE_CONTINUE) return ret;
618
618
  } break;
619
619
  default:
620
- off = m_current - m_start;
621
- holder().visitor().parse_error(n - m_start - 1, n - m_start);
620
+ off = static_cast<std::size_t>(m_current - m_start);
621
+ holder().visitor().parse_error(static_cast<std::size_t>(n - m_start - 1), static_cast<std::size_t>(n - m_start));
622
622
  return PARSE_PARSE_ERROR;
623
623
  }
624
624
  }
625
625
  } while(m_current != pe);
626
626
 
627
- off = m_current - m_start;
627
+ off = static_cast<std::size_t>(m_current - m_start);
628
628
  return PARSE_CONTINUE;
629
629
  }
630
630
 
@@ -1,3 +1,3 @@
1
1
  #define MSGPACK_VERSION_MAJOR 3
2
- #define MSGPACK_VERSION_MINOR 1
3
- #define MSGPACK_VERSION_REVISION 1
2
+ #define MSGPACK_VERSION_MINOR 2
3
+ #define MSGPACK_VERSION_REVISION 0
@@ -100,8 +100,9 @@ static inline void msgpack_zbuffer_free(msgpack_zbuffer* zbuf)
100
100
 
101
101
  static inline bool msgpack_zbuffer_expand(msgpack_zbuffer* zbuf)
102
102
  {
103
- size_t used = (char*)zbuf->stream.next_out - zbuf->data;
103
+ size_t used = static_cast<size_t>(reinterpret_cast<char*>(zbuf->stream.next_out) - zbuf->data);
104
104
  size_t csize = used + zbuf->stream.avail_out;
105
+
105
106
  size_t nsize = (csize == 0) ? zbuf->init_size : csize * 2;
106
107
 
107
108
  char* tmp = (char*)realloc(zbuf->data, nsize);
@@ -111,7 +112,7 @@ static inline bool msgpack_zbuffer_expand(msgpack_zbuffer* zbuf)
111
112
 
112
113
  zbuf->data = tmp;
113
114
  zbuf->stream.next_out = (Bytef*)(tmp + used);
114
- zbuf->stream.avail_out = nsize - used;
115
+ zbuf->stream.avail_out = static_cast<uInt>(nsize - used);
115
116
 
116
117
  return true;
117
118
  }
@@ -121,7 +122,7 @@ static inline int msgpack_zbuffer_write(void* data, const char* buf, size_t len)
121
122
  msgpack_zbuffer* zbuf = (msgpack_zbuffer*)data;
122
123
 
123
124
  zbuf->stream.next_in = (Bytef*)buf;
124
- zbuf->stream.avail_in = len;
125
+ zbuf->stream.avail_in = static_cast<uInt>(len);
125
126
 
126
127
  while(zbuf->stream.avail_in > 0) {
127
128
  if(zbuf->stream.avail_out < MSGPACK_ZBUFFER_RESERVE_SIZE) {
@@ -162,12 +163,12 @@ static inline const char* msgpack_zbuffer_data(const msgpack_zbuffer* zbuf)
162
163
 
163
164
  static inline size_t msgpack_zbuffer_size(const msgpack_zbuffer* zbuf)
164
165
  {
165
- return (char*)zbuf->stream.next_out - zbuf->data;
166
+ return static_cast<size_t>(reinterpret_cast<char*>(zbuf->stream.next_out) - zbuf->data);
166
167
  }
167
168
 
168
169
  static inline void msgpack_zbuffer_reset_buffer(msgpack_zbuffer* zbuf)
169
170
  {
170
- zbuf->stream.avail_out += (char*)zbuf->stream.next_out - zbuf->data;
171
+ zbuf->stream.avail_out += (uInt)((char*)zbuf->stream.next_out - zbuf->data);
171
172
  zbuf->stream.next_out = (Bytef*)zbuf->data;
172
173
  }
173
174
 
@@ -197,4 +198,3 @@ static inline char* msgpack_zbuffer_release_buffer(msgpack_zbuffer* zbuf)
197
198
  #endif
198
199
 
199
200
  #endif /* msgpack/zbuffer.h */
200
-
@@ -111,7 +111,7 @@ static inline void* msgpack_zone_malloc(msgpack_zone* zone, size_t size)
111
111
  zone->chunk_list.ptr + (MSGPACK_ZONE_ALIGN - 1)
112
112
  ) / MSGPACK_ZONE_ALIGN * MSGPACK_ZONE_ALIGN
113
113
  );
114
- size_t adjusted_size = size + (aligned - zone->chunk_list.ptr);
114
+ size_t adjusted_size = size + (size_t)(aligned - zone->chunk_list.ptr);
115
115
  if(zone->chunk_list.free >= adjusted_size) {
116
116
  zone->chunk_list.free -= adjusted_size;
117
117
  zone->chunk_list.ptr += adjusted_size;
@@ -7,9 +7,15 @@
7
7
  * (See accompanying file LICENSE_1_0.txt or copy at
8
8
  * http://www.boost.org/LICENSE_1_0.txt)
9
9
  */
10
+ #if defined(_KERNEL_MODE)
11
+ # undef _NO_CRT_STDIO_INLINE
12
+ # define _NO_CRT_STDIO_INLINE
13
+ #endif
14
+
10
15
  #include "msgpack/object.h"
11
16
  #include "msgpack/pack.h"
12
17
  #include <ctype.h>
18
+
13
19
  #include <stdio.h>
14
20
  #include <string.h>
15
21
 
@@ -25,6 +31,10 @@
25
31
  #include <inttypes.h>
26
32
  #endif
27
33
 
34
+ #if defined(_KERNEL_MODE)
35
+ # undef snprintf
36
+ # define snprintf _snprintf
37
+ #endif
28
38
 
29
39
  int msgpack_pack_object(msgpack_packer* pk, msgpack_object d)
30
40
  {
@@ -115,6 +125,7 @@ int msgpack_pack_object(msgpack_packer* pk, msgpack_object d)
115
125
  }
116
126
  }
117
127
 
128
+ #if !defined(_KERNEL_MODE)
118
129
 
119
130
  static void msgpack_object_bin_print(FILE* out, const char *ptr, size_t size)
120
131
  {
@@ -130,35 +141,6 @@ static void msgpack_object_bin_print(FILE* out, const char *ptr, size_t size)
130
141
  }
131
142
  }
132
143
 
133
- static int msgpack_object_bin_print_buffer(char *buffer, size_t buffer_size, const char *ptr, size_t size)
134
- {
135
- size_t i;
136
- char *aux_buffer = buffer;
137
- size_t aux_buffer_size = buffer_size;
138
- int ret;
139
-
140
- for (i = 0; i < size; ++i) {
141
- if (ptr[i] == '"') {
142
- ret = snprintf(aux_buffer, aux_buffer_size, "\\\"");
143
- aux_buffer = aux_buffer + ret;
144
- aux_buffer_size = aux_buffer_size - ret;
145
- } else if (isprint((unsigned char)ptr[i])) {
146
- if (aux_buffer_size > 0) {
147
- memcpy(aux_buffer, ptr + i, 1);
148
- aux_buffer = aux_buffer + 1;
149
- aux_buffer_size = aux_buffer_size - 1;
150
- }
151
- } else {
152
- ret = snprintf(aux_buffer, aux_buffer_size, "\\x%02x", (unsigned char)ptr[i]);
153
- aux_buffer = aux_buffer + ret;
154
- aux_buffer_size = aux_buffer_size - ret;
155
- }
156
- }
157
-
158
- return buffer_size - aux_buffer_size;
159
- }
160
-
161
-
162
144
  void msgpack_object_print(FILE* out, msgpack_object o)
163
145
  {
164
146
  switch(o.type) {
@@ -270,6 +252,38 @@ void msgpack_object_print(FILE* out, msgpack_object o)
270
252
  }
271
253
  }
272
254
 
255
+ #endif
256
+
257
+ #define MSGPACK_CHECKED_CALL(ret, func, aux_buffer, aux_buffer_size, ...) \
258
+ ret = func(aux_buffer, aux_buffer_size, __VA_ARGS__); \
259
+ if (ret <= 0 || ret > (int)aux_buffer_size) return 0; \
260
+ aux_buffer = aux_buffer + ret; \
261
+ aux_buffer_size = aux_buffer_size - ret \
262
+
263
+ static int msgpack_object_bin_print_buffer(char *buffer, size_t buffer_size, const char *ptr, size_t size)
264
+ {
265
+ size_t i;
266
+ char *aux_buffer = buffer;
267
+ size_t aux_buffer_size = buffer_size;
268
+ int ret;
269
+
270
+ for (i = 0; i < size; ++i) {
271
+ if (ptr[i] == '"') {
272
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "\\\"");
273
+ } else if (isprint((unsigned char)ptr[i])) {
274
+ if (aux_buffer_size > 0) {
275
+ memcpy(aux_buffer, ptr + i, 1);
276
+ aux_buffer = aux_buffer + 1;
277
+ aux_buffer_size = aux_buffer_size - 1;
278
+ }
279
+ } else {
280
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "\\x%02x", (unsigned char)ptr[i]);
281
+ }
282
+ }
283
+
284
+ return (int)(buffer_size - aux_buffer_size);
285
+ }
286
+
273
287
  int msgpack_object_print_buffer(char *buffer, size_t buffer_size, msgpack_object o)
274
288
  {
275
289
  char *aux_buffer = buffer;
@@ -277,197 +291,118 @@ int msgpack_object_print_buffer(char *buffer, size_t buffer_size, msgpack_object
277
291
  int ret;
278
292
  switch(o.type) {
279
293
  case MSGPACK_OBJECT_NIL:
280
- ret = snprintf(aux_buffer, aux_buffer_size, "nil");
281
- aux_buffer = aux_buffer + ret;
282
- aux_buffer_size = aux_buffer_size - ret;
294
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "nil");
283
295
  break;
284
296
 
285
297
  case MSGPACK_OBJECT_BOOLEAN:
286
- ret = snprintf(aux_buffer, aux_buffer_size, (o.via.boolean ? "true" : "false"));
287
- aux_buffer = aux_buffer + ret;
288
- aux_buffer_size = aux_buffer_size - ret;
298
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, (o.via.boolean ? "true" : "false"));
289
299
  break;
290
300
 
291
301
  case MSGPACK_OBJECT_POSITIVE_INTEGER:
292
302
  #if defined(PRIu64)
293
- ret = snprintf(aux_buffer, aux_buffer_size, "%" PRIu64, o.via.u64);
294
- aux_buffer = aux_buffer + ret;
295
- aux_buffer_size = aux_buffer_size - ret;
303
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "%" PRIu64, o.via.u64);
296
304
  #else
297
305
  if (o.via.u64 > ULONG_MAX) {
298
- ret = snprintf(aux_buffer, aux_buffer_size, "over 4294967295");
299
- aux_buffer = aux_buffer + ret;
300
- aux_buffer_size = aux_buffer_size - ret;
306
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "over 4294967295");
301
307
  } else {
302
- ret = snprintf(aux_buffer, aux_buffer_size, "%lu", (unsigned long)o.via.u64);
303
- aux_buffer = aux_buffer + ret;
304
- aux_buffer_size = aux_buffer_size - ret;
308
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "%lu", (unsigned long)o.via.u64);
305
309
  }
306
310
  #endif
307
311
  break;
308
312
 
309
313
  case MSGPACK_OBJECT_NEGATIVE_INTEGER:
310
314
  #if defined(PRIi64)
311
- ret = snprintf(aux_buffer, aux_buffer_size, "%" PRIi64, o.via.i64);
312
- aux_buffer = aux_buffer + ret;
313
- aux_buffer_size = aux_buffer_size - ret;
315
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "%" PRIi64, o.via.i64);
314
316
  #else
315
317
  if (o.via.i64 > LONG_MAX) {
316
- ret = snprintf(aux_buffer, aux_buffer_size, "over +2147483647");
317
- aux_buffer = aux_buffer + ret;
318
- aux_buffer_size = aux_buffer_size - ret;
318
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "over +2147483647");
319
319
  } else if (o.via.i64 < LONG_MIN) {
320
- ret = snprintf(aux_buffer, aux_buffer_size, "under -2147483648");
321
- aux_buffer = aux_buffer + ret;
322
- aux_buffer_size = aux_buffer_size - ret;
320
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "under -2147483648");
323
321
  } else {
324
- ret = snprintf(aux_buffer, aux_buffer_size, "%ld", (signed long)o.via.i64);
325
- aux_buffer = aux_buffer + ret;
326
- aux_buffer_size = aux_buffer_size - ret;
322
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "%ld", (signed long)o.via.i64);
327
323
  }
328
324
  #endif
329
325
  break;
330
326
 
331
327
  case MSGPACK_OBJECT_FLOAT32:
332
328
  case MSGPACK_OBJECT_FLOAT64:
333
- ret = snprintf(aux_buffer, aux_buffer_size, "%f", o.via.f64);
334
- aux_buffer = aux_buffer + ret;
335
- aux_buffer_size = aux_buffer_size - ret;
329
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "%f", o.via.f64);
336
330
  break;
337
331
 
338
332
  case MSGPACK_OBJECT_STR:
339
- ret = snprintf(aux_buffer, aux_buffer_size, "\"");
340
- aux_buffer = aux_buffer + ret;
341
- aux_buffer_size = aux_buffer_size - ret;
342
- ret = snprintf(aux_buffer, aux_buffer_size, "%.*s", (int)o.via.str.size, o.via.str.ptr);
343
- aux_buffer = aux_buffer + ret;
344
- aux_buffer_size = aux_buffer_size - ret;
345
- ret = snprintf(aux_buffer, aux_buffer_size, "\"");
346
- aux_buffer = aux_buffer + ret;
347
- aux_buffer_size = aux_buffer_size - ret;
333
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "\"");
334
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "%.*s", (int)o.via.str.size, o.via.str.ptr);
335
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "\"");
348
336
  break;
349
337
 
350
338
  case MSGPACK_OBJECT_BIN:
351
- ret = snprintf(aux_buffer, aux_buffer_size, "\"");
352
- aux_buffer = aux_buffer + ret;
353
- aux_buffer_size = aux_buffer_size - ret;
354
-
355
- ret = msgpack_object_bin_print_buffer(aux_buffer, aux_buffer_size, o.via.bin.ptr, o.via.bin.size);
356
- aux_buffer = aux_buffer + ret;
357
- aux_buffer_size = aux_buffer_size - ret;
358
-
359
- ret = snprintf(aux_buffer, aux_buffer_size, "\"");
360
- aux_buffer = aux_buffer + ret;
361
- aux_buffer_size = aux_buffer_size - ret;
339
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "\"");
340
+ MSGPACK_CHECKED_CALL(ret, msgpack_object_bin_print_buffer, aux_buffer, aux_buffer_size, o.via.bin.ptr, o.via.bin.size);
341
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "\"");
362
342
  break;
363
343
 
364
344
  case MSGPACK_OBJECT_EXT:
365
345
  #if defined(PRIi8)
366
- ret = snprintf(aux_buffer, aux_buffer_size, "(ext: %" PRIi8 ")", o.via.ext.type);
367
- aux_buffer = aux_buffer + ret;
368
- aux_buffer_size = aux_buffer_size - ret;
346
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "(ext: %" PRIi8 ")", o.via.ext.type);
369
347
  #else
370
- ret = snprintf(aux_buffer, aux_buffer_size, "(ext: %d)", (int)o.via.ext.type);
371
- aux_buffer = aux_buffer + ret;
372
- aux_buffer_size = aux_buffer_size - ret;
348
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "(ext: %d)", (int)o.via.ext.type);
373
349
  #endif
374
- ret = snprintf(aux_buffer, aux_buffer_size, "\"");
375
- aux_buffer = aux_buffer + ret;
376
- aux_buffer_size = aux_buffer_size - ret;
377
-
378
- ret = msgpack_object_bin_print_buffer(aux_buffer, aux_buffer_size, o.via.ext.ptr, o.via.ext.size);
379
- aux_buffer = aux_buffer + ret;
380
- aux_buffer_size = aux_buffer_size - ret;
381
-
382
- ret = snprintf(aux_buffer, aux_buffer_size, "\"");
383
- aux_buffer = aux_buffer + ret;
384
- aux_buffer_size = aux_buffer_size - ret;
350
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "\"");
351
+ MSGPACK_CHECKED_CALL(ret, msgpack_object_bin_print_buffer, aux_buffer, aux_buffer_size, o.via.ext.ptr, o.via.ext.size);
352
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "\"");
385
353
  break;
386
354
 
387
355
  case MSGPACK_OBJECT_ARRAY:
388
- ret = snprintf(aux_buffer, aux_buffer_size, "[");
389
- aux_buffer = aux_buffer + ret;
390
- aux_buffer_size = aux_buffer_size - ret;
356
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "[");
391
357
  if(o.via.array.size != 0) {
392
358
  msgpack_object* p = o.via.array.ptr;
393
359
  msgpack_object* const pend = o.via.array.ptr + o.via.array.size;
394
- ret = msgpack_object_print_buffer(aux_buffer, aux_buffer_size, *p);
395
- aux_buffer = aux_buffer + ret;
396
- aux_buffer_size = aux_buffer_size - ret;
360
+ MSGPACK_CHECKED_CALL(ret, msgpack_object_print_buffer, aux_buffer, aux_buffer_size, *p);
397
361
  ++p;
398
362
  for(; p < pend; ++p) {
399
- ret = snprintf(aux_buffer, aux_buffer_size, ", ");
400
- aux_buffer = aux_buffer + ret;
401
- aux_buffer_size = aux_buffer_size - ret;
402
- ret = msgpack_object_print_buffer(aux_buffer, aux_buffer_size, *p);
403
- aux_buffer = aux_buffer + ret;
404
- aux_buffer_size = aux_buffer_size - ret;
363
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, ", ");
364
+ MSGPACK_CHECKED_CALL(ret, msgpack_object_print_buffer, aux_buffer, aux_buffer_size, *p);
405
365
  }
406
366
  }
407
- ret = snprintf(aux_buffer, aux_buffer_size, "]");
408
- aux_buffer = aux_buffer + ret;
409
- aux_buffer_size = aux_buffer_size - ret;
367
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "]");
410
368
  break;
411
369
 
412
370
  case MSGPACK_OBJECT_MAP:
413
- ret = snprintf(aux_buffer, aux_buffer_size, "{");
414
- aux_buffer = aux_buffer + ret;
415
- aux_buffer_size = aux_buffer_size - ret;
371
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "{");
416
372
  if(o.via.map.size != 0) {
417
373
  msgpack_object_kv* p = o.via.map.ptr;
418
374
  msgpack_object_kv* const pend = o.via.map.ptr + o.via.map.size;
419
- ret = msgpack_object_print_buffer(aux_buffer, aux_buffer_size, p->key);
420
- aux_buffer = aux_buffer + ret;
421
- aux_buffer_size = aux_buffer_size - ret;
422
- ret = snprintf(aux_buffer, aux_buffer_size, "=>");
423
- aux_buffer = aux_buffer + ret;
424
- aux_buffer_size = aux_buffer_size - ret;
425
- ret = msgpack_object_print_buffer(aux_buffer, aux_buffer_size, p->val);
426
- aux_buffer = aux_buffer + ret;
427
- aux_buffer_size = aux_buffer_size - ret;
375
+ MSGPACK_CHECKED_CALL(ret, msgpack_object_print_buffer, aux_buffer, aux_buffer_size, p->key);
376
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "=>");
377
+ MSGPACK_CHECKED_CALL(ret, msgpack_object_print_buffer, aux_buffer, aux_buffer_size, p->val);
428
378
  ++p;
429
379
  for(; p < pend; ++p) {
430
- ret = snprintf(aux_buffer, aux_buffer_size, ", ");
431
- aux_buffer = aux_buffer + ret;
432
- aux_buffer_size = aux_buffer_size - ret;
433
- ret = msgpack_object_print_buffer(aux_buffer, aux_buffer_size, p->key);
434
- aux_buffer = aux_buffer + ret;
435
- aux_buffer_size = aux_buffer_size - ret;
436
- ret = snprintf(aux_buffer, aux_buffer_size, "=>");
437
- aux_buffer = aux_buffer + ret;
438
- aux_buffer_size = aux_buffer_size - ret;
439
- ret = msgpack_object_print_buffer(aux_buffer, aux_buffer_size, p->val);
440
- aux_buffer = aux_buffer + ret;
441
- aux_buffer_size = aux_buffer_size - ret;
380
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, ", ");
381
+ MSGPACK_CHECKED_CALL(ret, msgpack_object_print_buffer, aux_buffer, aux_buffer_size, p->key);
382
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "=>");
383
+ MSGPACK_CHECKED_CALL(ret, msgpack_object_print_buffer, aux_buffer, aux_buffer_size, p->val);
442
384
  }
443
385
  }
444
- ret = snprintf(aux_buffer, aux_buffer_size, "}");
445
- aux_buffer = aux_buffer + ret;
446
- aux_buffer_size = aux_buffer_size - ret;
386
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "}");
447
387
  break;
448
388
 
449
389
  default:
450
390
  // FIXME
451
391
  #if defined(PRIu64)
452
- ret = snprintf(aux_buffer, aux_buffer_size, "#<UNKNOWN %i %" PRIu64 ">", o.type, o.via.u64);
453
- aux_buffer = aux_buffer + ret;
454
- aux_buffer_size = aux_buffer_size - ret;
392
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "#<UNKNOWN %i %" PRIu64 ">", o.type, o.via.u64);
455
393
  #else
456
394
  if (o.via.u64 > ULONG_MAX) {
457
- ret = snprintf(aux_buffer, aux_buffer_size, "#<UNKNOWN %i over 4294967295>", o.type);
458
- aux_buffer = aux_buffer + ret;
459
- aux_buffer_size = aux_buffer_size - ret;
395
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "#<UNKNOWN %i over 4294967295>", o.type);
460
396
  } else {
461
- ret = snprintf(aux_buffer, aux_buffer_size, "#<UNKNOWN %i %lu>", o.type, (unsigned long)o.via.u64);
462
- aux_buffer = aux_buffer + ret;
463
- aux_buffer_size = aux_buffer_size - ret;
397
+ MSGPACK_CHECKED_CALL(ret, snprintf, aux_buffer, aux_buffer_size, "#<UNKNOWN %i %lu>", o.type, (unsigned long)o.via.u64);
464
398
  }
465
399
  #endif
466
400
  }
467
401
 
468
- return buffer_size - aux_buffer_size;
402
+ return (int)(buffer_size - aux_buffer_size);
469
403
  }
470
404
 
405
+ #undef MSGPACK_CHECKED_CALL
471
406
 
472
407
  bool msgpack_object_equal(const msgpack_object x, const msgpack_object y)
473
408
  {