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
@@ -55,7 +55,7 @@ class zone {
55
55
  ++m_tail;
56
56
  }
57
57
  void push_expand(void (*func)(void*), void* data) {
58
- const size_t nused = m_end - m_array;
58
+ const size_t nused = static_cast<size_t>(m_end - m_array);
59
59
  size_t nnext;
60
60
  if(nused == 0) {
61
61
  nnext = (sizeof(finalizer) < 72/2) ?
@@ -246,12 +246,12 @@ inline char* zone::get_aligned(char* ptr, size_t align)
246
246
  inline void* zone::allocate_align(size_t size, size_t align)
247
247
  {
248
248
  char* aligned = get_aligned(m_chunk_list.m_ptr, align);
249
- size_t adjusted_size = size + (aligned - m_chunk_list.m_ptr);
249
+ size_t adjusted_size = size + static_cast<size_t>(aligned - m_chunk_list.m_ptr);
250
250
  if (m_chunk_list.m_free < adjusted_size) {
251
251
  size_t enough_size = size + align - 1;
252
252
  char* ptr = allocate_expand(enough_size);
253
253
  aligned = get_aligned(ptr, align);
254
- adjusted_size = size + (aligned - m_chunk_list.m_ptr);
254
+ adjusted_size = size + static_cast<size_t>(aligned - m_chunk_list.m_ptr);
255
255
  }
256
256
  m_chunk_list.m_free -= adjusted_size;
257
257
  m_chunk_list.m_ptr += adjusted_size;
@@ -61,7 +61,7 @@ private:
61
61
  ++m_tail;
62
62
  }
63
63
  void push_expand(void (*func)(void*), void* data) {
64
- const size_t nused = m_end - m_array;
64
+ const size_t nused = static_cast<size_t>(m_end - m_array);
65
65
  size_t nnext;
66
66
  if(nused == 0) {
67
67
  nnext = (sizeof(finalizer) < 72/2) ?
@@ -239,12 +239,12 @@ inline char* zone::get_aligned(char* ptr, size_t align)
239
239
  inline void* zone::allocate_align(size_t size, size_t align)
240
240
  {
241
241
  char* aligned = get_aligned(m_chunk_list.m_ptr, align);
242
- size_t adjusted_size = size + (aligned - m_chunk_list.m_ptr);
242
+ size_t adjusted_size = size + static_cast<size_t>(aligned - m_chunk_list.m_ptr);
243
243
  if (m_chunk_list.m_free < adjusted_size) {
244
244
  size_t enough_size = size + align - 1;
245
245
  char* ptr = allocate_expand(enough_size);
246
246
  aligned = get_aligned(ptr, align);
247
- adjusted_size = size + (aligned - m_chunk_list.m_ptr);
247
+ adjusted_size = size + static_cast<size_t>(aligned - m_chunk_list.m_ptr);
248
248
  }
249
249
  m_chunk_list.m_free -= adjusted_size;
250
250
  m_chunk_list.m_ptr += adjusted_size;
@@ -352,8 +352,8 @@ struct object_pack_visitor {
352
352
  return true;
353
353
  }
354
354
  bool visit_ext(const char* v, uint32_t size) {
355
- m_packer.pack_ext(size, *v);
356
- m_packer.pack_ext_body(v, size);
355
+ m_packer.pack_ext(size - 1, static_cast<int8_t>(*v));
356
+ m_packer.pack_ext_body(v + 1, size - 1);
357
357
  return true;
358
358
  }
359
359
  bool start_array(uint32_t num_elements) {
@@ -467,7 +467,7 @@ struct object_stringize_visitor {
467
467
  return true;
468
468
  }
469
469
  bool visit_bin(const char* v, uint32_t size) {
470
- (m_os << '"').write(v, size) << '"';
470
+ (m_os << '"').write(v, static_cast<std::streamsize>(size)) << '"';
471
471
  return true;
472
472
  }
473
473
  bool visit_ext(const char* /*v*/, uint32_t /*size*/) {
@@ -527,7 +527,7 @@ private:
527
527
  };
528
528
 
529
529
  struct aligned_zone_size_visitor {
530
- explicit aligned_zone_size_visitor(std::size_t s)
530
+ explicit aligned_zone_size_visitor(std::size_t& s)
531
531
  :m_size(s) {}
532
532
  bool visit_nil() {
533
533
  return true;
@@ -596,7 +596,7 @@ struct aligned_zone_size_visitor {
596
596
  return true;
597
597
  }
598
598
  private:
599
- std::size_t m_size;
599
+ std::size_t& m_size;
600
600
  };
601
601
 
602
602
  inline std::size_t aligned_zone_size(msgpack::object const& obj) {
@@ -938,7 +938,7 @@ struct object_equal_visitor {
938
938
  }
939
939
  bool visit_ext(const char* v, uint32_t size) {
940
940
  if (m_ptr->type != msgpack::type::EXT ||
941
- m_ptr->via.ext.size != size ||
941
+ m_ptr->via.ext.size != size - 1 ||
942
942
  std::memcmp(m_ptr->via.ext.ptr, v, size) != 0) {
943
943
  m_result = false;
944
944
  return false;
@@ -40,7 +40,7 @@ struct object_bin {
40
40
  };
41
41
 
42
42
  struct object_ext {
43
- int8_t type() const { return ptr[0]; }
43
+ int8_t type() const { return static_cast<int8_t>(ptr[0]); }
44
44
  const char* data() const { return &ptr[1]; }
45
45
  uint32_t size;
46
46
  const char* ptr;
@@ -16,6 +16,7 @@
16
16
  #include <limits>
17
17
  #include <cstring>
18
18
  #include <climits>
19
+ #include <ostream>
19
20
 
20
21
  namespace msgpack {
21
22
 
@@ -271,6 +272,20 @@ public:
271
272
  */
272
273
  packer<Stream>& pack_char(char d);
273
274
 
275
+ /// Packing wchar_t
276
+ /**
277
+ * The byte size of the packed data depends on `d`.
278
+ * If `d` is zero or positive, the packed type is positive fixnum, or uint*,
279
+ * else the packed type is negative fixnum, or int*
280
+ * The minimum byte size expression is used.
281
+ * See https://github.com/msgpack/msgpack/blob/master/spec.md#formats-int
282
+ *
283
+ * @param d a packing object.
284
+ *
285
+ * @return The reference of `*this`.
286
+ */
287
+ packer<Stream>& pack_wchar(wchar_t d);
288
+
274
289
  /// Packing signed char
275
290
  /**
276
291
  * The byte size of the packed data depends on `d`.
@@ -604,7 +619,15 @@ private:
604
619
  void pack_imp_int64(T d);
605
620
 
606
621
  void append_buffer(const char* buf, size_t len)
607
- { m_stream.write(buf, len); }
622
+ {
623
+ append_buffer(&Stream::write, buf, len);
624
+ }
625
+
626
+ template <typename Ret, typename Cls, typename SizeType>
627
+ void append_buffer(Ret (Cls::*)(const char*, SizeType), const char* buf, size_t len)
628
+ {
629
+ m_stream.write(buf, static_cast<SizeType>(len));
630
+ }
608
631
 
609
632
  private:
610
633
  Stream& m_stream;
@@ -781,7 +804,7 @@ template <typename Stream>
781
804
  inline packer<Stream>& packer<Stream>::pack_fix_int16(int16_t d)
782
805
  {
783
806
  char buf[3];
784
- buf[0] = static_cast<char>(0xd1u); _msgpack_store16(&buf[1], d);
807
+ buf[0] = static_cast<char>(0xd1u); _msgpack_store16(&buf[1], (uint16_t)d);
785
808
  append_buffer(buf, 3);
786
809
  return *this;
787
810
  }
@@ -790,7 +813,7 @@ template <typename Stream>
790
813
  inline packer<Stream>& packer<Stream>::pack_fix_int32(int32_t d)
791
814
  {
792
815
  char buf[5];
793
- buf[0] = static_cast<char>(0xd2u); _msgpack_store32(&buf[1], d);
816
+ buf[0] = static_cast<char>(0xd2u); _msgpack_store32(&buf[1], (uint32_t)d);
794
817
  append_buffer(buf, 5);
795
818
  return *this;
796
819
  }
@@ -820,6 +843,18 @@ inline packer<Stream>& packer<Stream>::pack_char(char d)
820
843
  return *this;
821
844
  }
822
845
 
846
+ template <typename Stream>
847
+ inline packer<Stream>& packer<Stream>::pack_wchar(wchar_t d)
848
+ {
849
+ if (d < 0) {
850
+ pack_imp_int64(static_cast<int64_t>(d));
851
+ }
852
+ else {
853
+ pack_imp_uint64(static_cast<uint64_t>(d));
854
+ }
855
+ return *this;
856
+ }
857
+
823
858
  template <typename Stream>
824
859
  inline packer<Stream>& packer<Stream>::pack_signed_char(signed char d)
825
860
  {
@@ -1202,7 +1237,7 @@ inline packer<Stream>& packer<Stream>::pack_str(uint32_t l)
1202
1237
  append_buffer(&buf, 1);
1203
1238
  } else if(l < 256) {
1204
1239
  char buf[2];
1205
- buf[0] = static_cast<char>(0xd9u); buf[1] = static_cast<uint8_t>(l);
1240
+ buf[0] = static_cast<char>(0xd9u); buf[1] = static_cast<char>(l);
1206
1241
  append_buffer(buf, 2);
1207
1242
  } else if(l < 65536) {
1208
1243
  char buf[3];
@@ -1256,7 +1291,7 @@ inline packer<Stream>& packer<Stream>::pack_bin(uint32_t l)
1256
1291
  {
1257
1292
  if(l < 256) {
1258
1293
  char buf[2];
1259
- buf[0] = static_cast<char>(0xc4u); buf[1] = static_cast<uint8_t>(l);
1294
+ buf[0] = static_cast<char>(0xc4u); buf[1] = static_cast<char>(l);
1260
1295
  append_buffer(buf, 2);
1261
1296
  } else if(l < 65536) {
1262
1297
  char buf[3];
@@ -78,19 +78,19 @@ inline void unpack_uint64(uint64_t d, msgpack::object& o)
78
78
  { o.type = msgpack::type::POSITIVE_INTEGER; o.via.u64 = d; }
79
79
 
80
80
  inline void unpack_int8(int8_t d, msgpack::object& o)
81
- { if(d >= 0) { o.type = msgpack::type::POSITIVE_INTEGER; o.via.u64 = d; }
81
+ { if(d >= 0) { o.type = msgpack::type::POSITIVE_INTEGER; o.via.u64 = static_cast<uint64_t>(d); }
82
82
  else { o.type = msgpack::type::NEGATIVE_INTEGER; o.via.i64 = d; } }
83
83
 
84
84
  inline void unpack_int16(int16_t d, msgpack::object& o)
85
- { if(d >= 0) { o.type = msgpack::type::POSITIVE_INTEGER; o.via.u64 = d; }
85
+ { if(d >= 0) { o.type = msgpack::type::POSITIVE_INTEGER; o.via.u64 = static_cast<uint64_t>(d); }
86
86
  else { o.type = msgpack::type::NEGATIVE_INTEGER; o.via.i64 = d; } }
87
87
 
88
88
  inline void unpack_int32(int32_t d, msgpack::object& o)
89
- { if(d >= 0) { o.type = msgpack::type::POSITIVE_INTEGER; o.via.u64 = d; }
89
+ { if(d >= 0) { o.type = msgpack::type::POSITIVE_INTEGER; o.via.u64 = static_cast<uint64_t>(d); }
90
90
  else { o.type = msgpack::type::NEGATIVE_INTEGER; o.via.i64 = d; } }
91
91
 
92
92
  inline void unpack_int64(int64_t d, msgpack::object& o)
93
- { if(d >= 0) { o.type = msgpack::type::POSITIVE_INTEGER; o.via.u64 = d; }
93
+ { if(d >= 0) { o.type = msgpack::type::POSITIVE_INTEGER; o.via.u64 = static_cast<uint64_t>(d); }
94
94
  else { o.type = msgpack::type::NEGATIVE_INTEGER; o.via.i64 = d; } }
95
95
 
96
96
  inline void unpack_float(float d, msgpack::object& o)
@@ -418,10 +418,10 @@ private:
418
418
  m_stack[0].set_obj(obj);
419
419
  ++m_current;
420
420
  /*printf("-- finish --\n"); */
421
- off = m_current - m_start;
421
+ off = static_cast<std::size_t>(m_current - m_start);
422
422
  }
423
423
  else if (ret < 0) {
424
- off = m_current - m_start;
424
+ off = static_cast<std::size_t>(m_current - m_start);
425
425
  }
426
426
  else {
427
427
  m_cs = MSGPACK_CS_HEADER;
@@ -461,7 +461,7 @@ inline int context::execute(const char* data, std::size_t len, std::size_t& off)
461
461
  msgpack::object obj;
462
462
 
463
463
  if(m_current == pe) {
464
- off = m_current - m_start;
464
+ off = static_cast<std::size_t>(m_current - m_start);
465
465
  return 0;
466
466
  }
467
467
  bool fixed_trail_again = false;
@@ -544,7 +544,7 @@ inline int context::execute(const char* data, std::size_t len, std::size_t& off)
544
544
  int ret = push_proc(obj, off);
545
545
  if (ret != 0) return ret;
546
546
  } else {
547
- off = m_current - m_start;
547
+ off = static_cast<std::size_t>(m_current - m_start);
548
548
  return -1;
549
549
  }
550
550
  // end MSGPACK_CS_HEADER
@@ -555,7 +555,7 @@ inline int context::execute(const char* data, std::size_t len, std::size_t& off)
555
555
  fixed_trail_again = false;
556
556
  }
557
557
  if(static_cast<std::size_t>(pe - m_current) < m_trail) {
558
- off = m_current - m_start;
558
+ off = static_cast<std::size_t>(m_current - m_start);
559
559
  return 0;
560
560
  }
561
561
  n = m_current;
@@ -830,13 +830,13 @@ inline int context::execute(const char* data, std::size_t len, std::size_t& off)
830
830
  if (ret != 0) return ret;
831
831
  } break;
832
832
  default:
833
- off = m_current - m_start;
833
+ off = static_cast<std::size_t>(m_current - m_start);
834
834
  return -1;
835
835
  }
836
836
  }
837
837
  } while(m_current != pe);
838
838
 
839
- off = m_current - m_start;
839
+ off = static_cast<std::size_t>(m_current - m_start);
840
840
  return 0;
841
841
  }
842
842
 
@@ -117,7 +117,7 @@ public:
117
117
  void append_ref(const char* buf, size_t len)
118
118
  {
119
119
  if(m_tail == m_end) {
120
- const size_t nused = m_tail - m_array;
120
+ const size_t nused = static_cast<size_t>(m_tail - m_array);
121
121
  const size_t nnext = nused * 2;
122
122
 
123
123
  iovec* nvec = static_cast<iovec*>(::realloc(
@@ -145,11 +145,11 @@ public:
145
145
  if(sz < len) {
146
146
  sz = len;
147
147
  }
148
-
148
+
149
149
  if(sizeof(chunk) + sz < sz){
150
150
  throw std::bad_alloc();
151
151
  }
152
-
152
+
153
153
  chunk* c = static_cast<chunk*>(::malloc(sizeof(chunk) + sz));
154
154
  if(!c) {
155
155
  throw std::bad_alloc();
@@ -184,7 +184,7 @@ public:
184
184
 
185
185
  size_t vector_size() const
186
186
  {
187
- return m_tail - m_array;
187
+ return static_cast<size_t>(m_tail - m_array);
188
188
  }
189
189
 
190
190
  void migrate(vrefbuffer* to)
@@ -202,11 +202,11 @@ public:
202
202
 
203
203
  empty->next = MSGPACK_NULLPTR;
204
204
 
205
- const size_t nused = m_tail - m_array;
205
+ const size_t nused = static_cast<size_t>(m_tail - m_array);
206
206
  if(to->m_tail + nused < m_end) {
207
- const size_t tosize = to->m_tail - to->m_array;
207
+ const size_t tosize = static_cast<size_t>(to->m_tail - to->m_array);
208
208
  const size_t reqsize = nused + tosize;
209
- size_t nnext = (to->m_end - to->m_array) * 2;
209
+ size_t nnext = static_cast<size_t>(to->m_end - to->m_array) * 2;
210
210
  while(nnext < reqsize) {
211
211
  size_t tmp_nnext = nnext * 2;
212
212
  if (tmp_nnext <= nnext) {
@@ -47,7 +47,7 @@ public:
47
47
  void write(const char* buf, size_t len)
48
48
  {
49
49
  m_stream.next_in = reinterpret_cast<Bytef*>(const_cast<char*>(buf));
50
- m_stream.avail_in = len;
50
+ m_stream.avail_in = static_cast<uInt>(len);
51
51
 
52
52
  while(m_stream.avail_in > 0) {
53
53
  if(m_stream.avail_out < MSGPACK_ZBUFFER_RESERVE_SIZE) {
@@ -91,7 +91,7 @@ public:
91
91
 
92
92
  size_t size() const
93
93
  {
94
- return reinterpret_cast<char*>(m_stream.next_out) - m_data;
94
+ return static_cast<size_t>(reinterpret_cast<char*>(m_stream.next_out) - m_data);
95
95
  }
96
96
 
97
97
  void reset()
@@ -104,7 +104,7 @@ public:
104
104
 
105
105
  void reset_buffer()
106
106
  {
107
- m_stream.avail_out += reinterpret_cast<char*>(m_stream.next_out) - m_data;
107
+ m_stream.avail_out += static_cast<uInt>(reinterpret_cast<char*>(m_stream.next_out) - m_data);
108
108
  m_stream.next_out = reinterpret_cast<Bytef*>(m_data);
109
109
  }
110
110
 
@@ -120,7 +120,7 @@ public:
120
120
  private:
121
121
  bool expand()
122
122
  {
123
- size_t used = reinterpret_cast<char*>(m_stream.next_out) - m_data;
123
+ size_t used = static_cast<size_t>(reinterpret_cast<char*>(m_stream.next_out) - m_data);
124
124
  size_t csize = used + m_stream.avail_out;
125
125
  size_t nsize = (csize == 0) ? m_init_size : csize * 2;
126
126
 
@@ -131,7 +131,7 @@ private:
131
131
 
132
132
  m_data = tmp;
133
133
  m_stream.next_out = reinterpret_cast<Bytef*>(tmp + used);
134
- m_stream.avail_out = nsize - used;
134
+ m_stream.avail_out = static_cast<uInt>(nsize - used);
135
135
 
136
136
  return true;
137
137
  }
@@ -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 v1::type::detail::convert_integer_sign;
36
36
 
@@ -85,7 +85,7 @@ public:
85
85
  msgpack::object* obj = m_stack.back();
86
86
  if(v >= 0) {
87
87
  obj->type = msgpack::type::POSITIVE_INTEGER;
88
- obj->via.u64 = v;
88
+ obj->via.u64 = static_cast<uint64_t>(v);
89
89
  }
90
90
  else {
91
91
  obj->type = msgpack::type::NEGATIVE_INTEGER;
@@ -71,27 +71,27 @@ private:
71
71
  ++m_current;
72
72
  if (size == 0) {
73
73
  if (!sv(size)) {
74
- off = m_current - m_start;
74
+ off = static_cast<std::size_t>(m_current - m_start);
75
75
  return PARSE_STOP_VISITOR;
76
76
  }
77
77
  if (!ev()) {
78
- off = m_current - m_start;
78
+ off = static_cast<std::size_t>(m_current - m_start);
79
79
  return PARSE_STOP_VISITOR;
80
80
  }
81
81
  parse_return ret = m_stack.consume(holder());
82
82
  if (ret != PARSE_CONTINUE) {
83
- off = m_current - m_start;
83
+ off = static_cast<std::size_t>(m_current - m_start);
84
84
  return ret;
85
85
  }
86
86
  }
87
87
  else {
88
88
  if (!sv(size)) {
89
- off = m_current - m_start;
89
+ off = static_cast<std::size_t>(m_current - m_start);
90
90
  return PARSE_STOP_VISITOR;
91
91
  }
92
92
  parse_return ret = m_stack.push(holder(), sv.type(), static_cast<uint32_t>(size));
93
93
  if (ret != PARSE_CONTINUE) {
94
- off = m_current - m_start;
94
+ off = static_cast<std::size_t>(m_current - m_start);
95
95
  return ret;
96
96
  }
97
97
  }
@@ -102,12 +102,12 @@ private:
102
102
  parse_return after_visit_proc(bool visit_result, std::size_t& off) {
103
103
  ++m_current;
104
104
  if (!visit_result) {
105
- off = m_current - m_start;
105
+ off = static_cast<std::size_t>(m_current - m_start);
106
106
  return PARSE_STOP_VISITOR;
107
107
  }
108
108
  parse_return ret = m_stack.consume(holder());
109
109
  if (ret != PARSE_CONTINUE) {
110
- off = m_current - m_start;
110
+ off = static_cast<std::size_t>(m_current - m_start);
111
111
  }
112
112
  m_cs = MSGPACK_CS_HEADER;
113
113
  return ret;
@@ -244,7 +244,7 @@ inline parse_return context<VisitorHolder>::execute(const char* data, std::size_
244
244
  msgpack::object obj;
245
245
 
246
246
  if(m_current == pe) {
247
- off = m_current - m_start;
247
+ off = static_cast<std::size_t>(m_current - m_start);
248
248
  return PARSE_CONTINUE;
249
249
  }
250
250
  bool fixed_trail_again = false;
@@ -326,7 +326,7 @@ inline parse_return context<VisitorHolder>::execute(const char* data, std::size_
326
326
  parse_return upr = after_visit_proc(visret, off);
327
327
  if (upr != PARSE_CONTINUE) return upr;
328
328
  } else {
329
- off = m_current - m_start;
329
+ off = static_cast<std::size_t>(m_current - m_start);
330
330
  holder().visitor().parse_error(off - 1, off);
331
331
  return PARSE_PARSE_ERROR;
332
332
  }
@@ -338,7 +338,7 @@ inline parse_return context<VisitorHolder>::execute(const char* data, std::size_
338
338
  fixed_trail_again = false;
339
339
  }
340
340
  if(static_cast<std::size_t>(pe - m_current) < m_trail) {
341
- off = m_current - m_start;
341
+ off = static_cast<std::size_t>(m_current - m_start);
342
342
  return PARSE_CONTINUE;
343
343
  }
344
344
  n = m_current;
@@ -608,14 +608,14 @@ inline parse_return context<VisitorHolder>::execute(const char* data, std::size_
608
608
  if (ret != PARSE_CONTINUE) return ret;
609
609
  } break;
610
610
  default:
611
- off = m_current - m_start;
612
- holder().visitor().parse_error(n - m_start - 1, n - m_start);
611
+ off = static_cast<std::size_t>(m_current - m_start);
612
+ holder().visitor().parse_error(static_cast<std::size_t>(n - m_start - 1), static_cast<std::size_t>(n - m_start));
613
613
  return PARSE_PARSE_ERROR;
614
614
  }
615
615
  }
616
616
  } while(m_current != pe);
617
617
 
618
- off = m_current - m_start;
618
+ off = static_cast<std::size_t>(m_current - m_start);
619
619
  return PARSE_CONTINUE;
620
620
  }
621
621