summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2021-09-01Merge pull request #5544 from stuarth/change-languageYukihiro "Matz" Matsumoto
Use gender-neutral pronouns
2021-08-31use gender-neutral pronounsStuart Hinson
2021-09-01Merge pull request #5543 from ↵Yukihiro "Matz" Matsumoto
mruby/dependabot/github_actions/github/super-linter-4.6.3 build(deps): bump github/super-linter from 4.6.2 to 4.6.3
2021-09-01string.c: need to adjust index for UTF-8.Yukihiro "Matz" Matsumoto
2021-09-01build_config/ci/gcc-clang.rb: enable `MRB_UTF8_STRING`.Yukihiro "Matz" Matsumoto
2021-09-01string.c: implement `__sub_replace()` in C.Yukihiro "Matz" Matsumoto
To reduce number of string allocation.
2021-09-01mruby.h: obsolete `mrb_to_str()`.Yukihiro "Matz" Matsumoto
Replace them by `mrb_ensure_string_type()`.
2021-09-01string.rb: avoid internal `__to_str` calls.Yukihiro "Matz" Matsumoto
`__to_str` was a mere type check method despite its name.
2021-09-01object.c: remove `mrb_convert_to_integer()' function.Yukihiro "Matz" Matsumoto
And merged to `mrb_f_integer()` which is only usage of the function.
2021-09-01string-ext/string.c: implement `casecmp` in C.Yukihiro "Matz" Matsumoto
* should not raise error for non-string arguments * avoid allocating case converted string internally
2021-09-01string.h: obsolete `mrb_str_to_str()`, even from examples.Yukihiro "Matz" Matsumoto
2021-09-01Do no use return values from `mrb_ensure_` functions.Yukihiro "Matz" Matsumoto
They return the checking argument without modification, so the values are already there. Maybe we should change the return type to `void` but keep them unchanged for compatibility.
2021-09-01mruby.h: reorganize `mrb_ensure/check` functions in headers.Yukihiro "Matz" Matsumoto
2021-08-31build(deps): bump github/super-linter from 4.6.2 to 4.6.3dependabot[bot]
Bumps [github/super-linter](https://github.com/github/super-linter) from 4.6.2 to 4.6.3. - [Release notes](https://github.com/github/super-linter/releases) - [Commits](https://github.com/github/super-linter/compare/v4.6.2...v4.6.3) --- updated-dependencies: - dependency-name: github/super-linter dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
2021-08-30Merge pull request #5542 from dearblue/mrb_get_args-cIYukihiro "Matz" Matsumoto
Allow `nil` for `c!` and `I!` specifiers of `mrb_get_args()`
2021-08-29Merge pull request #5541 from dearblue/mrb_get_args-oCSAHYukihiro "Matz" Matsumoto
Integrate the processing of similar specifiers of `mrb_get_args()`
2021-08-28Allow `nil` for `c!` and `I!` specifiers of `mrb_get_args()`dearblue
2021-08-28Integrate the processing of similar specifiers of `mrb_get_args()`dearblue
It is `o`, `C`, `S`, `A` and `H` specifiers that are integrated. As a side effect, the `C!` Specifier can now be used.
2021-08-28Merge pull request #5540 from dearblue/mrb_get_argsYukihiro "Matz" Matsumoto
Refactor the `mrb_get_args()` function
2021-08-27Refactor the `mrb_get_args()` functiondearblue
- Removed the `ARGV` macro. The current path doesn't go into the mruby VM and there's also no need to separate variables. - Use common functions to check object types. - Use `mrb_ensure_string_type()` to check the string instead of `mrb_to_str()`. This is for consistency with array and hash. - Use `mrb_ensure_array_type()` to check the array instead of `to_ary()`. - Use `mrb_ensure_hash_type()` to check the hash instead of `to_hash()`. - Add and use `ensure_class_type()` to check class and module. - Changed the argument index type from `mrb_int` to `int`. Even if it is `int16_t`, it is enough. `mrb_int` is overkill, especially if `MRB_32BIT` and `MRB_INT64` are defined.
2021-08-27Merge pull request #5539 from ↵Yukihiro "Matz" Matsumoto
mruby/dependabot/github_actions/github/super-linter-4.6.2 build(deps): bump github/super-linter from 4.6.1 to 4.6.2
2021-08-26build(deps): bump github/super-linter from 4.6.1 to 4.6.2dependabot[bot]
Bumps [github/super-linter](https://github.com/github/super-linter) from 4.6.1 to 4.6.2. - [Release notes](https://github.com/github/super-linter/releases) - [Commits](https://github.com/github/super-linter/compare/v4.6.1...v4.6.2) --- updated-dependencies: - dependency-name: github/super-linter dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
2021-08-26etc.c: keep full `float32` with `MRB_64BIT` and `MRB_USE_FLOAT32`.Yukihiro "Matz" Matsumoto
2021-08-26boxing_nan.h: rename prefix `BOXNAN` to `NANBOX`.Yukihiro "Matz" Matsumoto
2021-08-26boxing_word.h: rename prefix `BOXWORD` to `WORDBOX`.Yukihiro "Matz" Matsumoto
2021-08-26boxing_word.h: rename configuration macro name.Yukihiro "Matz" Matsumoto
`MRB_WORDBOX_USE_HEAP_FLOAT` instead of `MRB_USE_FLOAT_FULL_PRECISION`.
2021-08-26value.h: reconstruct `mrb_ro_data_p()`.Yukihiro "Matz" Matsumoto
* use predefined `mrb_ro_data_p()` for user-mode Linux and macOS * define `MRB_LINK_TIME_RO_DATA_P` if predefined one is used * configure macro `MRB_USE_LINK_TIME_RO_DATA_P` is no longer used * contributions for new platforms are welcome
2021-08-26Merge pull request #5538 from jbampton/pre-commit-autoupdateYukihiro "Matz" Matsumoto
pre-commit autoupdate
2021-08-25pre-commit autoupdateJohn Bampton
https://pre-commit.com/#pre-commit-autoupdate
2021-08-24Merge pull request #5535 from dearblue/get-args-frozenYukihiro "Matz" Matsumoto
Checks the frozen object with `mrb_get_args()`
2021-08-23Checks the frozen object with `mrb_get_args()`dearblue
This now works with the `+` modifier that can be added after each specifier. - `nil` is bypassed. - The `s` and `z` specifiers are received in C as a `const char *`, so adding a `+` modifier will raise an exception. - The `a` specifier is received in C as `const mrb_value *`, so adding a `+` modifier will raise an exception. - The `|`, `*`, `&`, `?` and `:` specifiers with `+` modifier raises an exception. If `!`/`+` exceeds one for each specifier, an exception will occur in the subsequent processing. This is the same behavior as before.
2021-08-23Integrate each element expansion process of the argumentdearblue
The previously used `given` variable will be merged into the `pickarg` pointer variable, which points to the argument currently being processed for each loop.
2021-08-23numeric.c: fix: `-0.0.abs` returned `-0.0`.Yukihiro "Matz" Matsumoto
2021-08-23Merge pull request #5537 from dearblue/header-filesYukihiro "Matz" Matsumoto
Organize the include of header files
2021-08-22Merge pull request #5536 from dearblue/random-seedYukihiro "Matz" Matsumoto
Stirs internal state when `seed` is set in `Random`
2021-08-21Organize the include of header filesdearblue
- `#include <math.h>` is done in `mruby.h`. Eliminate the need to worry about the `MRB_NO_FLOAT` macro. - Include mruby header files before standard header files. If the standard header file is already placed before `mruby.h`, the standard header file added in the future tends to be placed before `mruby.h`. This change should some reduce the chances of macros that must be defined becoming undefined in C++ or including problematic header files in a particular mruby build configuration.
2021-08-21Stirs internal state when `seed` is set in `Random`dearblue
This is to avoid the approximation of `Random#rand` when `seed`s are close together. For example, the first `#rand` values after doing `Random#srand(0)` and `Random#srand(1)` are very similar. Below is the sequence of mruby before this patch was given a `seed` of `0...20`: ```console % bin/mruby -e 'r = Random.new; 20.times { |i| r.srand(i); puts "seed=%2d %s" % [i, 10.times.map { "%0.3f" % r.rand }.join(" ")] }' seed= 0 0.643 0.585 0.198 0.732 0.087 0.605 0.548 0.468 0.573 0.966 seed= 1 0.643 0.585 0.198 0.607 0.370 0.605 0.633 0.593 0.395 0.439 seed= 2 0.643 0.585 0.197 0.981 0.652 0.730 0.875 0.713 0.529 0.269 seed= 3 0.643 0.585 0.198 0.857 0.934 0.730 0.960 0.216 0.286 0.523 seed= 4 0.643 0.585 0.197 0.231 0.217 0.605 0.959 0.958 0.478 0.482 seed= 5 0.643 0.585 0.197 0.106 0.249 0.605 0.044 0.330 0.925 0.047 seed= 6 0.643 0.585 0.197 0.481 0.781 0.731 0.285 0.960 0.804 0.725 seed= 7 0.643 0.585 0.197 0.356 0.813 0.731 0.370 0.711 0.937 0.448 seed= 8 0.643 0.585 0.198 0.732 0.329 0.108 0.243 0.974 0.766 0.936 seed= 9 0.643 0.585 0.198 0.607 0.611 0.108 0.827 0.102 0.962 0.597 seed=10 0.643 0.585 0.198 0.981 0.393 0.233 0.569 0.723 0.472 0.805 seed=11 0.643 0.585 0.198 0.857 0.676 0.233 0.154 0.222 0.603 0.371 seed=12 0.643 0.585 0.198 0.231 0.458 0.108 0.654 0.979 0.928 0.577 seed=13 0.643 0.585 0.198 0.106 0.490 0.108 0.239 0.355 0.749 0.831 seed=14 0.643 0.585 0.198 0.481 0.523 0.233 0.981 0.486 0.505 0.131 seed=15 0.643 0.585 0.198 0.356 0.555 0.234 0.565 0.233 0.011 0.666 seed=16 0.643 0.585 0.197 0.730 0.573 0.611 0.904 0.512 0.971 0.153 seed=17 0.643 0.585 0.197 0.605 0.855 0.611 0.240 0.636 0.041 0.509 seed=18 0.643 0.585 0.196 0.979 0.137 0.736 0.229 0.765 0.674 0.832 seed=19 0.643 0.585 0.197 0.855 0.420 0.736 0.566 0.268 0.183 0.219 ```
2021-08-21etc.c: clear `mrb_value` if `sizeof(void*)` is bigger than `sizeof(mrb_float)`.Yukihiro "Matz" Matsumoto
2021-08-21test/float.rb: avoid `1.0e16` in tests without precision specified.Yukihiro "Matz" Matsumoto
2021-08-21mruby-test/driver.c: change `FLOAT_TOLERANCE` bigger for inline floats.Yukihiro "Matz" Matsumoto
2021-08-21boxing_word.h: embed `mrb_float` in `mrb_value` if possible.Yukihiro "Matz" Matsumoto
Embedding reduce memory consumption, sacrificing precision. It clips least significant 2 bits from `mrb_float`, so if you need to keep float precision, define `MRB_USE_FLOAT_FULL_PRECISION`. `MRB_WORD_BOXING` and `MRB_INT64`: `mrb_float` (`double`) is embedded in `mrb_value` clipped last 2 bits. `MRB_WORD_BOXING` and `MRB_INT64` and `MRB_USE_FLOAT_FULL_PRECISION`: `mrb_float` is allocated in the heaps wrapped by `struct RFloat`. `MRB_WORD_BOXING` and `MRB_INT32` and `MRB_USE_FLOAT32`: `mrb_float` (`float`) is embedded in `mrb_value` clipped last 2 bits. In addition, to reserve bit space in the `mrb_value`, maximum inline symbol length become 4 (instead of 5) in the configuration. `MRB_WORD_BOXING` and `MRB_INT32`: Assume `MRB_USE_FLOAT_FULL_PRECISION` and allocate Float values in heap.
2021-08-21Merge pull request #5533 from dantecatalfamo/serenity-32bit-crossbuildYukihiro "Matz" Matsumoto
Add SerenityOS crossbuild
2021-08-20Specify potential values for SERENITY_ARCHDante Catalfamo
2021-08-20Replace 32-bit serenity config with 64-bit compatible version.Dante Catalfamo
2021-08-19Add serenity-32bit crossbuildDante Catalfamo
Cross compile mruby for SerenityOS (https://github.com/SerenityOS/serenity)
2021-08-19symbol.c: reduce memory by avoiding alignment gaps.Yukihiro "Matz" Matsumoto
In additions: * use bitmap for flags * BER integer compression for length
2021-08-19gc.c: remove unused `struct`s from `RVALUE`.Yukihiro "Matz" Matsumoto
2021-08-19value.h: fixed warnings on `__APPLE__`.Yukihiro "Matz" Matsumoto
2021-08-19value.h: enable `mrb_ro_data_p()` on `__linux__` and `__APPLE__`.Yukihiro "Matz" Matsumoto
Probably we should add conditions for FreeBSD, etc.
2021-08-18string.c: `mrb_str_to_cstr()` should always return a mutable string.Yukihiro "Matz" Matsumoto