| Age | Commit message (Collapse) | Author |
|
|
|
Array index became potentially negative because `uint32_t` is cast to
`mrb_int`.
|
|
shuujii/fix-wrong-argument-for-fprintf-in-mruby-bin-mrbc
Fix wrong argument for `fprintf` in `mruby-bin-mrbc`
|
|
|
|
shuujii/fix-Range-max-test-TypeError-is-raised-on-32-bit-mode
Fix `Range#max` test (`TypeError` is raised) on 32-bit mode
|
|
|
|
Because the linker gives a warning on FreeBSD 12.0.
```
warning: mktemp() possibly used unsafely; consider using mkstemp()
```
|
|
Remove deprecated iij stuffs
|
|
|
|
|
|
|
|
Suppress warnings for `strncat()`
|
|
Simplify get arguments
|
|
Make symbolic link names unique for test
|
|
|
|
`strncat()` also needs `'\0'`.
|
|
- `mrb_str_index_m()` and `mrb_str_rindex()`
Make `mrb_get_args()` called only once from called twice.
- `mrb_str_byteslice()`
Replace `goto` with `if ~ else`.
|
|
|
|
|
|
|
|
But this changes requires `OP_ARYCAT` and `OP_ARYPUSH` to accept `nil`
as their first operand. Alternative VMs (e.g. `mruby/c`) that understand
mruby bytecode need to be updated.
|
|
|
|
|
|
Math.hypot avoids premature overflow and underflow
|
|
`mrb_string_value_cstr` and `mrb_string_value_len`: obsolete
`mrb_string_cstr`: new function to retrieve NULL terminated C string
`RSTRING_CSTR`: wrapper macro of `mrb_string_cstr`
|
|
|
|
|
|
shuujii/use-new-specifiers-modifiers-of-mrb_vfromat
Use new specifiers/modifiers of `mrb_vfromat()`
|
|
The binary sizes (gems are only `mruby-bin-mruby`) are reduced slightly in
my environment than before the introduction of new specifiers/modifiers
(5116789a) with this change.
------------+-------------------+-------------------+--------
BINARY | BEFORE (5116789a) | AFTER (This PR) | RATIO
------------+-------------------+-------------------+--------
mruby | 593416 bytes | 593208 bytes | -0.04%
libmruby.a | 769048 bytes | 767264 bytes | -0.23%
------------+-------------------+-------------------+--------
BTW, I accidentally changed `tasks/toolchains/visualcpp.rake` at #4613,
so I put it back.
|
|
shuujii/use-mrb_int-instead-of-to_int-in-mruby-numeric-ext
Use `mrb_int()` instead of `to_int()` in `mruby-numeric-ext`
|
|
Add constants for floating point number
|
|
|
|
|
|
- `size_t` is more commonly used.
- `len` argument of `mrb_str_new()` is `size_t`.
NOTE:
The test for `%l` is temporarily disabled because adding a new type to
`mrbgems/mruby-test/vformat.c` causes an error (memory error?) on Visual
Studio 2017 in AppVeyor.
|
|
Fix `mrb_vformat("%f")` with `MRB_USE_FLOAT`
|
|
It potentially not work when `mrb_float` is `float` because `float` variable
in variable length arguments is promoted to `double`.
Also I fixed build with `MRB_WITHOUT_FLOAT`.
|
|
Warnings:
- If `MRB_TIME_T_UINT` is defined, the compiler issues a warning with an
integer comparison of different signs.
- It is mentioned that the `usec` variable passed to the
`mrb_to_time_t()` function may not be initialized
|
|
It potentially breaks, for example, in the case of `mrb_int` is 64-bit
and more smaller type is passed by `%d`. In fact, the problem could
become apparent when I used `%d` to `backtrace_location::lineno` in
`src/backtrace.c:mrb_unpack_backtrace()` on AppVeyor.
Therefore, change `%d` for `int` (not `mrb_int`) so that it can be
used mostly without casting.
|
|
Format sequence syntax:
%[modifier]specifier
Modifiers:
----------+------------------------------------------------------------
Modifier | Meaning
----------+------------------------------------------------------------
! | Convert to string by corresponding `inspect` instead of
| corresponding `to_s`.
----------+------------------------------------------------------------
Specifiers:
----------+----------------+--------------------------------------------
Specifier | Argument Type | Note
----------+----------------+--------------------------------------------
c | char |
d,i | mrb_int |
f | mrb_float |
l | char*, mrb_int | Arguments are string and length.
n | mrb_sym |
s | char* | Argument is NUL terminated string.
t | mrb_value | Convert to type (class) of object.
v,S | mrb_value |
C | struct RClass* |
T | mrb_value | Convert to real type (class) of object.
Y | mrb_value | Same as `!v` if argument is `true`, `false`
| | or `nil`, otherwise same as `T`.
% | - | Convert to percent sign itself (no argument
| | taken).
----------+----------------+--------------------------------------------
This change will increase the binary size, but replacing all format strings
with new specifiers/modifiers will decrease the size because it reduces
inline expansion of `mrb_obj_value()`, etc. at the caller.
|
|
Use own implementation to calculate UTC offset on Visual Studio 2015 or
earlier or MinGW because `strftime("%z")` on these environments does not
conform C99.
|
|
Refine message to `skip` in nested `assert`
|
|
- I think "Info" is used only to `skip`, so change to "Skip".
- Changed the default value of `assert` and specify the argument explicitly
at the caller of `assert` because it is unnatural "Assertion failed" is
output even though the assertion doesn't fail.
== Example:
def assert_foo(exp, act)
assert do
assert_equal exp[0], act[0]
assert_equal exp[1], act[1]
end
end
def assert_bar(exp, act)
assert do
skip
end
end
def assert_baz(exp, act)
assert do
assert_equal exp, act
assert_bar exp, act
end
end
assert 'test#skip_in_nested_assert' do
assert_baz 1, 1
end
=== Before this patch:
?..
Info: test#skip_in_nested_assert (core)
- Assertion[1]
Info: Assertion failed (core)
- Assertion[1-2]
Skip: Assertion failed (core)
Total: 3
OK: 2
KO: 0
Crash: 0
Warning: 0
Skip: 1
=== After this patch:
???
Skip: test#skip_in_nested_assert (core)
- Assertion[1]
Skip: assert (core)
- Assertion[1-2]
Skip: assert (core)
Total: 3
OK: 0
KO: 0
Crash: 0
Warning: 0
Skip: 3
|
|
strftime() on Windows returns locale encoding time zone for "%z" even
if MSDN says "%z" is "The offset from UTC in ISO 8601 format; no
characters if time zone is unknown" in MSDN:
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strftime-wcsftime-strftime-l-wcsftime-l?view=vs-2019
So we need to convert encoding of string from strftime().
|
|
|
|
Remove `Enumerator::Chain#initialize_copy`
|
|
|
|
I think `Enumerator::Chain#initialize_copy` is unnecessary because CRuby
doesn't clone elements.
|
|
|
|
Fix the lack of precision for `Time`; ref d74355061
|
|
- `Time.local` and `Time.utc` are able to use with `MRB_INT16 + MRB_WITHOUT_FLOAT`.
- `time_t` is converted directly from the Ruby object.
- `time + sec` and` time - sec` are not affected by the precision of `mrb_float`.
Similarly, calculations are possible with `MRB_INT16 + MRB_WITHOUT_FLOAT`.
|