Commit Graph

14871 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto e62d672ef3 mruby-time/time.c (mrb_to_time_t): support Bigint if defined 2023-03-10 08:52:06 +09:00
Yukihiro "Matz" Matsumoto 01233f70bd mruby-bigint/bigint.c: add two new functions to convert to 64bit int
- mrb_bint_as_int64()
- mrb_bint_as_uint64()
2023-03-10 08:52:05 +09:00
Yukihiro "Matz" Matsumoto c71408bc0a mruby-time/time.c (mrb_to_time_t): raise error if obj is not time
Or a time-compatible object like a number.
2023-03-10 08:52:05 +09:00
Yukihiro "Matz" Matsumoto 7096d277da mruby-time/time.c: support bigint to time_t if necessary 2023-03-10 08:52:05 +09:00
Yukihiro "Matz" Matsumoto da8c23524f mruby-time/time.c (mrb_to_time_t): use floor instead of llround
Since we should generate `t=(sec+usec)` from a floating point number
`sec` should be `floor(f)` especially for negative numbers, if the place
for `usec` is specified. In contrast, we can `round` the below point
digits if we are going to ignore them. But we now use `round` instead of
`llround` which directly convert `double` to `long long`, to add
boundary check for conversion.
2023-03-10 08:52:05 +09:00
Yukihiro "Matz" Matsumoto 2f0265d078 mruby-io/io.c (check_file_descriptor): stop "unused label" warning 2023-03-10 08:52:05 +09:00
Yukihiro "Matz" Matsumoto 9a3199cadd mruby-io/file.c: atime, ctime, mtime to return Bigint if possible 2023-03-10 08:52:05 +09:00
Yukihiro "Matz" Matsumoto a3b84fbb08 mruby-bigint/bigint.c: add 2 new functions for 64 bit integer
- mrb_bint_new_int64()
- mrb_bint_new_uint64()
2023-03-10 08:52:05 +09:00
Yukihiro "Matz" Matsumoto b1d0a3d3aa etc.c (mrb_float_id): define the function only when necessary 2023-03-10 08:52:04 +09:00
Yukihiro "Matz" Matsumoto e5de08b692 mruby-time/time.c (time_mktime): should allow year before 1900
If the platform use 64 bit time_t, it is possible to represent the year
before 1903. So we should remove this check.
2023-03-10 08:52:04 +09:00
Yukihiro "Matz" Matsumoto bcd595ad1b mruby-bigint/bigint.c: add else to skip if check 2023-03-10 08:52:04 +09:00
Yukihiro "Matz" Matsumoto f1ffedc3fa vm.c: kdict may be converted to a normal argument; fix #5944 2023-03-10 08:52:04 +09:00
Yukihiro "Matz" Matsumoto 18158c96f5 Merge pull request #5948 from dearblue/cinfo
Added note to `CINFO_*` constants
2023-03-10 08:50:26 +09:00
Yukihiro "Matz" Matsumoto 840953b55a Merge pull request #5947 from dearblue/fiber-resume
Remove unreachable codes in `Fiber#resume`
2023-03-10 08:49:12 +09:00
dearblue ddaf3bdc0f Added note to CINFO_* constants 2023-03-09 22:13:52 +09:00
dearblue f4c4809750 Remove unreachable codes in Fiber#resume
ref. #5782
2023-03-09 21:40:03 +09:00
Yukihiro "Matz" Matsumoto 42d3efee1c mruby-socket/socket.c: read/write should be redefined on Windows; fix #5943
Since normal file descriptors and sockets cannot be mixed on the
platform.
2023-03-03 15:30:51 +09:00
Yukihiro "Matz" Matsumoto 011edf6e99 mruby-io/file.c: hide internal methods in backtraces 2023-03-03 14:23:10 +09:00
Yukihiro "Matz" Matsumoto 5237b2cccc mruby-io/file.c: atime, ctime, mtime check mrb_int overflow
When `sizeof(time_t)` is different from `mrb_int`, overflow may happen.
2023-03-03 14:21:05 +09:00
Yukihiro "Matz" Matsumoto 0e51da81bb mruby-io/file.rb (inspect): include path in the #inspect output 2023-03-03 13:33:30 +09:00
Yukihiro "Matz" Matsumoto a956ef35a4 mruby-io/file.c: atime, ctime, mtime should raise error
For fstat(3) failure.
2023-03-03 13:33:29 +09:00
Yukihiro "Matz" Matsumoto 9c6848a594 mruby-io/io.c (check_file_descriptor): only check EBADF 2023-03-03 13:33:29 +09:00
Yukihiro "Matz" Matsumoto 0529f5fc31 mruby-io/test/file.rb: add tests for File#atime, File#ctime 2023-03-03 13:33:29 +09:00
Yukihiro "Matz" Matsumoto 321cfe9760 mruby-io/file.c: add File#atime and File#ctime 2023-03-03 13:33:29 +09:00
Yukihiro "Matz" Matsumoto 31c1b7bc78 mruby-file: File#mtime has been available for long time 2023-03-03 13:33:29 +09:00
Yukihiro "Matz" Matsumoto 84a4d340a6 mruby-io/file.c (_mtime): return nil instead of false
As a Ruby convention, a method should return nil (not false) for the
exceptional value, e.g. String#index. File#_mtime should follow the
convention too.
2023-03-03 13:33:29 +09:00
Yukihiro "Matz" Matsumoto d86c4a795d mruby-io does not provide to_path method for implicit conversion
mruby does not use implicit type conversion by `to_xxx` (e.g. to_int,
to_str, etc.)
2023-03-03 13:33:29 +09:00
Yukihiro "Matz" Matsumoto d7f4af04ca Merge pull request #5939 from jbampton/appveyor-add-visual-studio-2022
appveyor: add job for Visual Studio 2022
2023-03-02 15:08:50 +09:00
Yukihiro "Matz" Matsumoto bdf39fe4af Merge pull request #5940 from jbampton/remove-misspell
Remove `misspell` and update `CONTRIBUTING.md`
2023-03-01 23:47:41 +09:00
Yukihiro "Matz" Matsumoto 0d35fe072e Merge pull request #5941 from jbampton/simplify-the-editorconfig-file 2023-03-01 23:42:08 +09:00
John Bampton a874b80dae Simplify the .editorconfig file
We already have `trailing-whitespace` set globally in the `pre-commit` config
and we are also using `spaces` instead of `tabs` except for "Makefiles" which have `tab_width = 8`

Perhaps in future we can enforce line lengths.

https://github.com/mruby/mruby/blob/92ca93c885a6e6d2facd8e9ca3dbf85ac3dce8c9/.pre-commit-config.yaml#L29

https://github.com/mruby/mruby/blob/92ca93c885a6e6d2facd8e9ca3dbf85ac3dce8c9/.pre-commit-config.yaml#L33
2023-03-01 21:34:23 +10:00
John Bampton 2559c93b2b Remove misspell and update CONTRIBUTING.md
It looks like `misspell` is no longer maintained and
the last commit was on `Mar 9, 2018`.

We already run `codespell` and it is an active project
with the last commit 5 days ago.

Also updated the CONTRIBUTING guide with more
information on `pre-commit` as well as listed `codespell`
as the spell checker.

https://github.com/codespell-project/codespell
https://github.com/client9/misspell
https://github.com/client9/misspell/issues/197
2023-03-01 17:49:39 +10:00
John Bampton 47dcb393ca appveyor: add job for Visual Studio 2022
Visual Studio 2022 on Windows is now a 64-bit application.

https://www.appveyor.com/docs/build-environment/#build-worker-images

https://learn.microsoft.com/en-us/visualstudio/ide/whats-new-visual-studio-2022?view=vs-2022#visual-studio-2022-is-64-bit
2023-03-01 03:21:46 +10:00
Yukihiro "Matz" Matsumoto 92ca93c885 Merge pull request #5936 from jbampton/remove-duplicate-method-calls
benchmark: remove duplicate method calls
2023-02-25 22:10:28 +09:00
Yukihiro "Matz" Matsumoto b59832ed26 Merge pull request #5935 from jbampton/upgrade-doxyfile
Upgrade the `Doxyfile`
2023-02-25 22:09:36 +09:00
John Bampton d86f4d220f benchmark: remove duplicate method calls
DuplicateMethodCall: Scene#render calls 'nsf * nsf' 3 times
2023-02-25 15:22:49 +10:00
John Bampton 5dd0f74ecf Upgrade the Doxyfile
```
mruby % doxygen -u
warning: Tag 'CLANG_ASSISTED_PARSING' at line 50 of file 'Doxyfile' belongs to an option that was not enabled at compile time.
         This tag has been removed.
warning: Tag 'CLANG_OPTIONS' at line 51 of file 'Doxyfile' belongs to an option that was not enabled at compile time.
         This tag has been removed.
warning: Tag 'TCL_SUBST' at line 238 of file 'Doxyfile' has become obsolete.
         This tag has been removed.
warning: Tag 'COLS_IN_ALPHA_INDEX' at line 1075 of file 'Doxyfile' has become obsolete.
         This tag has been removed.
warning: Tag 'FORMULA_TRANSPARENT' at line 1481 of file 'Doxyfile' has become obsolete.
         This tag has been removed.
warning: Tag 'LATEX_SOURCE_CODE' at line 1769 of file 'Doxyfile' has become obsolete.
         This tag has been removed.
warning: Tag 'RTF_SOURCE_CODE' at line 1851 of file 'Doxyfile' has become obsolete.
         This tag has been removed.
warning: Tag 'DOCBOOK_PROGRAMLISTING' at line 1949 of file 'Doxyfile' has become obsolete.
         This tag has been removed.
warning: Tag 'PERL_PATH' at line 2094 of file 'Doxyfile' has become obsolete.
         This tag has been removed.
warning: Tag 'CLASS_DIAGRAMS' at line 2107 of file 'Doxyfile' has become obsolete.
         This tag has been removed.
warning: Tag 'MSCGEN_PATH' at line 2116 of file 'Doxyfile' has become obsolete.
         This tag has been removed.
warning: Tag 'DOT_FONTNAME' at line 2158 of file 'Doxyfile' has become obsolete.
         This tag has been removed.
warning: Tag 'DOT_FONTSIZE' at line 2165 of file 'Doxyfile' has become obsolete.
         This tag has been removed.
warning: Tag 'DOT_TRANSPARENT' at line 2391 of file 'Doxyfile' has become obsolete.
         This tag has been removed.

Configuration file 'Doxyfile' updated.
```
2023-02-25 12:55:53 +10:00
Yukihiro "Matz" Matsumoto ee599b25c1 Merge pull request #5934 from jbampton/rake-checkupdate
Run `rake checkupdate`
2023-02-25 09:26:26 +09:00
Yukihiro "Matz" Matsumoto f8a66c88b8 Merge pull request #5933 from jbampton/update-mruby-version-numbers
docs: update mruby version to `3.2.0`
2023-02-25 09:26:03 +09:00
John Bampton d4dd75b82c Run rake checkupdate
`pre-commit autoupdate`
2023-02-25 08:12:50 +10:00
John Bampton 46e42b38f0 docs: update mruby version to 3.2.0 2023-02-25 08:02:45 +10:00
Yukihiro "Matz" Matsumoto 82c67d52fc Merge pull request #5931 from mruby/stable
Merge mruby 3.2.0
2023-02-24 23:19:09 +09:00
mimaki 87260e7bb1 Update version and release date. (mruby 3.2.0 (2023-02-24)) 3.2.0 2023-02-24 19:51:12 +09:00
Yukihiro "Matz" Matsumoto 1ab3da6f08 vm.c (ci_env_set): inline ci_env_set()
Along with making preparing mrb_vm_ci_env_clar() as a replacement of
mrb_vm_ci_env_set(mrb, NULL).
2023-02-23 17:16:10 +09:00
Yukihiro "Matz" Matsumoto 2c046eb512 mruby.h: replace frequently used inline functions with macros
- mrb_gc_arena_save()
- mrb_gc_arena_restore()
2023-02-22 16:35:14 +09:00
Yukihiro "Matz" Matsumoto d8d1fe27f6 vm.c (stack_extend): inline mrb_stack_extend() in vm.c 2023-02-22 12:05:46 +09:00
Yukihiro "Matz" Matsumoto 43922a5bf9 vm.c (mrb_gc_arena_shrink): use local variable 2023-02-21 21:59:42 +09:00
Yukihiro "Matz" Matsumoto a21edf75ad Use mrb_get_arg1() instead of mrb_get_args() for single argument 2023-02-21 16:33:15 +09:00
Yukihiro "Matz" Matsumoto aecbdf72bf vm.c (mrb_env_unshare): remove unnecessary mrb_write_barrier() call
Since this function does not modify references from env, we don't need
to put write barrier here.
2023-02-21 09:45:17 +09:00
Yukihiro "Matz" Matsumoto d4cb136deb kernel.c (mrb_obj_ceqq): skip unnecessary mrb_ary_entry()
We have checked the boundary before the call.
2023-02-20 17:33:52 +09:00