Yukihiro "Matz" Matsumoto
4c859e754d
string.c (bytes2chars): skip scanning if the string is ASCII only
2024-01-10 14:40:39 +09:00
Yukihiro "Matz" Matsumoto
df0a5e838d
string.c (chars2bytes): use early return
2024-01-10 12:41:28 +09:00
Yukihiro "Matz" Matsumoto
e39e4ea26d
string.c (chars2bytes): small refactoring
2024-01-10 11:09:47 +09:00
Yukihiro "Matz" Matsumoto
1d243bc58b
string.c (bytes2chars): takes a string object instead of char*
2024-01-10 10:53:26 +09:00
Yukihiro "Matz" Matsumoto
59a1d74937
string.c: inline str_range_to_bytes
2024-01-09 18:22:38 +09:00
Yukihiro "Matz" Matsumoto
9135f0991b
string.c: avoid RSTRING_CHAR_LEN() if possible
...
Current code scan the string twice (once from RSTRING_CHAR_LEN, and once
from chars2bytes), but those scans are not necessary. Just point the end
of the string.
2024-01-09 11:44:12 +09:00
Yukihiro "Matz" Matsumoto
f3ebef1172
mruby-string (chars2bytes): reduce the scope of local variables
2024-01-09 11:00:44 +09:00
Yukihiro "Matz" Matsumoto
f1d01a6107
string.c (mrb_utf8len): should return 1 for invalid chars; ref #6143
2024-01-09 10:39:03 +09:00
Yukihiro "Matz" Matsumoto
64a4bf0e28
string.c: avoid infinite loop; fix #6143
...
`mrb_utf8len` returns 0 for invalid characters.
2024-01-09 10:37:52 +09:00
Yukihiro "Matz" Matsumoto
a5e83075d4
string.c: reduce the scope of a local variable
2024-01-09 08:22:26 +09:00
Yukihiro "Matz" Matsumoto
af3482d562
mruby-math: use erfc(x) instead of 1.0 - erf(x)
2024-01-09 08:01:28 +09:00
Yukihiro "Matz" Matsumoto
51c4c4716a
mruby-math: use log1p(x) instead of log(1.0+x)
2024-01-09 07:59:42 +09:00
Yukihiro "Matz" Matsumoto
8a2e88390b
mruby-math: reduce the scope of a local variable
2024-01-09 07:47:57 +09:00
Yukihiro "Matz" Matsumoto
c1fc3219db
mruby-math: fix spacing
2024-01-08 23:18:57 +09:00
Yukihiro "Matz" Matsumoto
05e9fa34af
mruby-random: rename a conflicting local variable
2024-01-08 19:12:55 +09:00
Yukihiro "Matz" Matsumoto
27c2f9ac38
mruby-random (mrb_ary_sample): reduce the scope of loop variables
2024-01-08 07:23:03 +09:00
Yukihiro "Matz" Matsumoto
2cf6f7f5c7
mruby-rational: move misplaced #ifndef MRB_NO_FLOAT
2024-01-08 07:19:30 +09:00
Yukihiro "Matz" Matsumoto
be3b93ecb9
array.c (ary_expand_capa): rename a conflicting local variable
2024-01-06 14:33:50 +09:00
Yukihiro "Matz" Matsumoto
d47f1b4df3
array.c (ary_expand_capa): remove unnecessary condition check
2024-01-06 14:32:54 +09:00
Yukihiro "Matz" Matsumoto
2eeb19a5ed
mruby-kernel-ext (mrb_f_caller): remove unnecessary condition check
2024-01-06 14:31:32 +09:00
Yukihiro "Matz" Matsumoto
b06fdb4bfa
mruby-io/file.c: reduce the scope of local variables
2024-01-06 08:30:56 +09:00
Yukihiro "Matz" Matsumoto
e1b6501183
mruby-io: fix local variable initialization redundancy
2024-01-05 13:03:33 +09:00
Yukihiro "Matz" Matsumoto
f1b8d38eb5
mruby-io: narrow a local variable scope
2024-01-05 13:02:39 +09:00
Yukihiro "Matz" Matsumoto
20dd737a4a
mruby-io (io_s_popen): remove fflush(stdin)
...
Flushing input I/O should be useless.
2024-01-05 13:00:55 +09:00
Yukihiro "Matz" Matsumoto
9ee7d955e3
mruby-metaprog: narrow the scope of a local variable
2024-01-04 11:18:14 +09:00
Yukihiro "Matz" Matsumoto
2ce5c52726
mruby-errno (mrb_sce_sys_fail): remove redundant assignment
2024-01-04 10:08:22 +09:00
Yukihiro "Matz" Matsumoto
7861422cbe
mruby-fiber (fiber_switch): reduce the scope of local variables
2024-01-03 16:07:15 +09:00
Yukihiro "Matz" Matsumoto
93bda0d27f
mruby-fiber (fiber_init_fiber): rename conflicting local variables
2024-01-03 16:05:46 +09:00
Yukihiro "Matz" Matsumoto
f0ab79b195
Merge pull request #6136 from dearblue/fiber-fix
...
Fixed when combined `mrb_fiber_resume()` and `Fiber#transfer`
2024-01-03 07:33:48 +09:00
Yukihiro "Matz" Matsumoto
5257fe4333
mruby-bigint (mrb_bint_new_float): narrow the scope of variable 'f'
2024-01-03 07:23:55 +09:00
Yukihiro "Matz" Matsumoto
d632085b5b
mruby-bigint (udiv): narrow the scope of loop variable 'i'
2024-01-03 07:23:55 +09:00
Yukihiro "Matz" Matsumoto
d944a079a3
mruby-numeric-ext (int_digits): avoid variable name override
2024-01-03 07:23:55 +09:00
Yukihiro "Matz" Matsumoto
e71e1bc50e
mruby-hash-ext: reduce the scope of the loop variable i
2024-01-03 07:23:55 +09:00
Yukihiro "Matz" Matsumoto
17b2ec643e
Merge pull request #6140 from jbampton/actions-label-more-files
...
actions: label more files for build
2024-01-03 07:23:39 +09:00
dearblue
519a2cbd59
Fixed when combined mrb_fiber_resume() and Fiber#transfer
...
For example, the following code was crashing.
```c
#include <mruby.h>
#include <mruby/compile.h>
#include <mruby/proc.h>
int
main(int argc, char *argv[])
{
mrb_state *mrb = mrb_open();
mrb_value fiber = mrb_load_string(mrb, "Fiber.new { Fiber.new { 12345.6789 }.transfer }");
mrb_value res = mrb_fiber_resume(mrb, fiber, 0, NULL);
mrb_p(mrb, res);
mrb_close(mrb);
return 0;
}
```
2024-01-02 21:34:44 +09:00
John Bampton
e471399044
actions: label more files for build
2024-01-01 17:19:53 +10:00
Yukihiro "Matz" Matsumoto
d7a2174519
Merge pull request #6139 from jbampton/fix-prettier-hook
...
Fix `pre-commit` failure from `prettier`
2024-01-01 15:46:41 +09:00
Yukihiro "Matz" Matsumoto
a406e008d1
Merge branch 'master' into fix-prettier-hook
2024-01-01 15:29:08 +09:00
John Bampton
19d0ea803d
Fix pre-commit failure from prettier
2023-12-31 21:57:58 +10:00
Yukihiro "Matz" Matsumoto
8094ac27d7
NEWS: add mruby3.3 changes description
2023-12-31 00:43:02 +09:00
Yukihiro "Matz" Matsumoto
39f48d732a
mruby-pack: update README.md
...
'X' and '@' directives are not listed
2023-12-30 16:02:20 +09:00
Yukihiro "Matz" Matsumoto
56b67f8613
mruby-pack (u64tostr): reimplement the function
...
- direct conversion of single digit numbers
- remove unnecessary update of `line` variable
- simplify the body according to the assertion
2023-12-30 15:35:55 +09:00
Yukihiro "Matz" Matsumoto
8cbd4638f4
mruby-pack (u64tostr): len should always be positive
...
Add `mrb_assert()` instead of just skipping the function.
2023-12-30 15:33:57 +09:00
Yukihiro "Matz" Matsumoto
1871ff14db
mruby-pack (pack_unpack): skip continuous extraction from unpack1
...
Ref #6134
2023-12-30 15:31:44 +09:00
Yukihiro "Matz" Matsumoto
7765c23f69
mruby-pack (pack_hex): the scope of variables a and b can be reduced
2023-12-30 15:12:17 +09:00
Yukihiro "Matz" Matsumoto
fca2bbdcca
mruby-pack (unpack_str): the scope of the variable cp can be reduced
2023-12-30 15:12:10 +09:00
Yukihiro "Matz" Matsumoto
159687bef3
mruby-pack: add tests for unpack1 method; ref #6134
2023-12-29 15:05:16 +09:00
Yukihiro "Matz" Matsumoto
6d8323f3c7
mruby-pack (pack_unpack): unpack1 did not return single data; fix #6134
...
For following unpack directives:
- PACK_DIR_HEX (h)
- PACK_DIR_BSTR (b)
- PACK_DIR_STR (a,A,Z)
- PACK_DIR_BASE64 (m)
- PACK_DIR_QENC (M)
2023-12-29 13:09:14 +09:00
Yukihiro "Matz" Matsumoto
95aa92d5c4
Update AUTHORS (date and commit hash)
2023-12-28 23:36:40 +09:00
Yukihiro "Matz" Matsumoto
c1511d5f5d
AUTHORS: update entries [ci skip]
2023-12-28 19:51:31 +09:00