From bcb8e297fce6d4d1543db0c8f922ef982dd562ff Mon Sep 17 00:00:00 2001 From: Tomas Pollak Date: Tue, 16 Apr 2019 12:34:09 -0400 Subject: Fix compilation on gcc 4.9.x --- mrbgems/mruby-test/driver.c | 4 ++-- src/numeric.c | 3 ++- src/variable.c | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mrbgems/mruby-test/driver.c b/mrbgems/mruby-test/driver.c index fd180b1bb..1ef3c1a74 100644 --- a/mrbgems/mruby-test/driver.c +++ b/mrbgems/mruby-test/driver.c @@ -50,10 +50,10 @@ static mrb_value t_print(mrb_state *mrb, mrb_value self) { mrb_value *argv; - mrb_int argc; + mrb_int argc, i; mrb_get_args(mrb, "*!", &argv, &argc); - for (mrb_int i = 0; i < argc; ++i) { + for (i = 0; i < argc; ++i) { mrb_value s = mrb_obj_as_string(mrb, argv[i]); fwrite(RSTRING_PTR(s), RSTRING_LEN(s), 1, stdout); } diff --git a/src/numeric.c b/src/numeric.c index 4128ea3a6..eebb41eba 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -212,7 +212,8 @@ flo_to_s(mrb_state *mrb, mrb_value flt) insert_dot_zero: begp = RSTRING_PTR(str); len = RSTRING_LEN(str); - for (char *p = begp, *endp = p + len; p < endp; ++p) { + char *p, *endp; + for (p = begp, endp = p + len; p < endp; ++p) { if (*p == '.') { return str; } diff --git a/src/variable.c b/src/variable.c index 724b153fe..348d1e3e3 100644 --- a/src/variable.c +++ b/src/variable.c @@ -1115,7 +1115,8 @@ mrb_class_find_path(mrb_state *mrb, struct RClass *c) mrb_bool mrb_ident_p(const char *s, mrb_int len) { - for (mrb_int i = 0; i < len; i++) { + mrb_int i; + for (i = 0; i < len; i++) { if (!identchar(s[i])) return FALSE; } return TRUE; -- cgit v1.2.3 From ef3b539125049b7c16bae883bdc5cee03ee378a4 Mon Sep 17 00:00:00 2001 From: Tomás Pollak Date: Tue, 16 Apr 2019 18:02:30 -0400 Subject: Prevent 'mixed declarations and code' C90 warning --- src/numeric.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/numeric.c b/src/numeric.c index eebb41eba..b6a38dace 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -207,12 +207,13 @@ flo_to_s(mrb_state *mrb, mrb_value flt) char fmt[] = "%." MRB_STRINGIZE(FLO_TO_STR_PREC) "g"; mrb_value str = mrb_float_to_str(mrb, flt, fmt); mrb_int len; + char *p; char *begp; + char *endp; insert_dot_zero: begp = RSTRING_PTR(str); len = RSTRING_LEN(str); - char *p, *endp; for (p = begp, endp = p + len; p < endp; ++p) { if (*p == '.') { return str; -- cgit v1.2.3 From 4c91adc4b209163f4609e308bf773c6833513b55 Mon Sep 17 00:00:00 2001 From: Hiroshi Mimaki Date: Fri, 18 Oct 2019 14:59:27 +0900 Subject: Update version to `2.1.0`. (mruby 2.1.0 RC) --- Doxyfile | 2 +- README.md | 2 +- doc/guides/debugger.md | 2 +- doc/limitations.md | 20 ++++++++++---------- include/mruby/version.h | 8 ++++---- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Doxyfile b/Doxyfile index 8724fe1ac..8e465afad 100644 --- a/Doxyfile +++ b/Doxyfile @@ -6,7 +6,7 @@ DOXYFILE_ENCODING = UTF-8 PROJECT_NAME = "mruby" -PROJECT_NUMBER = 2.0.1 +PROJECT_NUMBER = 2.1.0 PROJECT_BRIEF = "mruby is the lightweight implementation of the Ruby language" diff --git a/README.md b/README.md index ec3492530..18ac2a491 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ of the Ministry of Economy, Trade and Industry of Japan. ## How to get mruby -The stable version 2.0.1 of mruby can be downloaded via the following URL: [https://github.com/mruby/mruby/archive/2.0.1.zip](https://github.com/mruby/mruby/archive/2.0.1.zip) +The stable version 2.1.0 of mruby can be downloaded via the following URL: [https://github.com/mruby/mruby/archive/2.1.0.zip](https://github.com/mruby/mruby/archive/2.1.0.zip) The latest development version of mruby can be downloaded via the following URL: [https://github.com/mruby/mruby/zipball/master](https://github.com/mruby/mruby/zipball/master) diff --git a/doc/guides/debugger.md b/doc/guides/debugger.md index 81c0e9d63..783ac4937 100644 --- a/doc/guides/debugger.md +++ b/doc/guides/debugger.md @@ -38,7 +38,7 @@ To confirm mrdb was installed properly, run mrdb with the `--version` option: ```bash $ mrdb --version -mruby 2.0.1 (2019-4-4) +mruby 2.1.0 (2019-10-18) ``` ## 2.2 Basic Operation diff --git a/doc/limitations.md b/doc/limitations.md index 6958d396f..f37a71cf0 100644 --- a/doc/limitations.md +++ b/doc/limitations.md @@ -38,7 +38,7 @@ puts [1,2,3] 3 ``` -#### mruby [2.0.1 (2019-4-4)] +#### mruby [2.1.0 (2019-10-18)] ``` [1, 2, 3] @@ -61,7 +61,7 @@ end `ZeroDivisionError` is raised. -#### mruby [2.0.1 (2019-4-4)] +#### mruby [2.1.0 (2019-10-18)] No exception is raised. @@ -89,7 +89,7 @@ p Liste.new "foobar" ` [] ` -#### mruby [2.0.1 (2019-4-4)] +#### mruby [2.1.0 (2019-10-18)] `ArgumentError` is raised. @@ -119,7 +119,7 @@ false true ``` -#### mruby [2.0.1 (2019-4-4)] +#### mruby [2.1.0 (2019-10-18)] ``` true @@ -156,7 +156,7 @@ p 'ok' ok ``` -#### mruby [2.0.1 (2019-4-4)] +#### mruby [2.1.0 (2019-10-18)] ``` test.rb:8: undefined method 'test_func' (NoMethodError) @@ -178,7 +178,7 @@ defined?(Foo) nil ``` -#### mruby [2.0.1 (2019-4-4)] +#### mruby [2.1.0 (2019-10-18)] `NameError` is raised. @@ -195,7 +195,7 @@ alias $a $__a__ ` nil ` -#### mruby [2.0.1 (2019-4-4)] +#### mruby [2.1.0 (2019-10-18)] Syntax error @@ -217,7 +217,7 @@ end `ArgumentError` is raised. The re-defined `+` operator does not accept any arguments. -#### mruby [2.0.1 (2019-4-4)] +#### mruby [2.1.0 (2019-10-18)] ` 'ab' ` Behavior of the operator wasn't changed. @@ -233,7 +233,7 @@ $ ruby -e 'puts Proc.new {}.binding' # ``` -#### mruby [2.0.1 (2019-4-4)] +#### mruby [2.1.0 (2019-10-18)] ``` $ ./bin/mruby -e 'puts Proc.new {}.binding' @@ -255,7 +255,7 @@ $ ruby -e 'def m(*r,**k) p [r,k] end; m("a"=>1,:b=>2)' [[{"a"=>1}], {:b=>2}] ``` -#### mruby [mruby 2.0.1] +#### mruby [mruby 2.1.0] ``` $ ./bin/mruby -e 'def m(*r,**k) p [r,k] end; m("a"=>1,:b=>2)' diff --git a/include/mruby/version.h b/include/mruby/version.h index 1c7655a47..a82b0c00c 100644 --- a/include/mruby/version.h +++ b/include/mruby/version.h @@ -42,12 +42,12 @@ MRB_BEGIN_DECL /* * Minor release version number. */ -#define MRUBY_RELEASE_MINOR 0 +#define MRUBY_RELEASE_MINOR 1 /* * Tiny release version number. */ -#define MRUBY_RELEASE_TEENY 1 +#define MRUBY_RELEASE_TEENY 0 /* * The mruby version. @@ -67,12 +67,12 @@ MRB_BEGIN_DECL /* * Release month. */ -#define MRUBY_RELEASE_MONTH 4 +#define MRUBY_RELEASE_MONTH 10 /* * Release day. */ -#define MRUBY_RELEASE_DAY 4 +#define MRUBY_RELEASE_DAY 18 /* * Release date as a string. -- cgit v1.2.3 From a9e27933a99c372bfd6f257c671e80cc053a9b18 Mon Sep 17 00:00:00 2001 From: mimaki Date: Tue, 29 Oct 2019 20:56:12 +0900 Subject: Fix file/directory name parameter for `git` command. --- lib/mruby/build/command.rb | 18 +++++++++++++----- lib/mruby/lockfile.rb | 10 +++++++++- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/lib/mruby/build/command.rb b/lib/mruby/build/command.rb index 6e41e3db2..0a6d6b818 100644 --- a/lib/mruby/build/command.rb +++ b/lib/mruby/build/command.rb @@ -24,6 +24,14 @@ module MRuby target end + def shellquote(s) + if ENV['OS'] == 'Windows_NT' + "\"#{s}\"" + else + "#{s}" + end + end + NotFoundCommands = {} private @@ -278,9 +286,9 @@ module MRuby @command = 'git' @flags = %w[] @clone_options = "clone %{flags} %{url} %{dir}" - @pull_options = "--git-dir '%{repo_dir}/.git' --work-tree '%{repo_dir}' pull" - @checkout_options = "--git-dir '%{repo_dir}/.git' --work-tree '%{repo_dir}' checkout %{checksum_hash}" - @reset_options = "--git-dir '%{repo_dir}/.git' --work-tree '%{repo_dir}' reset %{checksum_hash}" + @pull_options = "--git-dir #{shellquote("%{repo_dir}/.git")} --work-tree #{shellquote("%{repo_dir}")} pull" + @checkout_options = "--git-dir #{shellquote("%{repo_dir}/.git")} --work-tree #{shellquote("%{repo_dir}")} checkout %{checksum_hash}" + @reset_options = "--git-dir #{shellquote("%{repo_dir}/.git")} --work-tree #{shellquote("%{repo_dir}")} reset %{checksum_hash}" end def run_clone(dir, url, _flags = []) @@ -304,11 +312,11 @@ module MRuby end def commit_hash(dir) - `#{@command} --git-dir '#{dir}/.git' --work-tree '#{dir}' rev-parse --verify HEAD`.strip + `#{@command} --git-dir #{shellquote(dir +'/.git')} --work-tree #{shellquote(dir)} rev-parse --verify HEAD`.strip end def current_branch(dir) - `#{@command} --git-dir '#{dir}/.git' --work-tree '#{dir}' rev-parse --abbrev-ref HEAD`.strip + `#{@command} --git-dir #{shellquote(dir + '/.git')} --work-tree #{shellquote(dir)} rev-parse --abbrev-ref HEAD`.strip end end diff --git a/lib/mruby/lockfile.rb b/lib/mruby/lockfile.rb index ce1442a89..0d2455b4c 100644 --- a/lib/mruby/lockfile.rb +++ b/lib/mruby/lockfile.rb @@ -54,6 +54,14 @@ module MRuby end end + def shellquote(s) + if ENV['OS'] == 'Windows_NT' + "\"#{s}\"" + else + "'#{s}'" + end + end + def mruby mruby = { 'version' => MRuby::Source::MRUBY_VERSION, @@ -62,7 +70,7 @@ module MRuby git_dir = "#{MRUBY_ROOT}/.git" if File.directory?(git_dir) - mruby['git_commit'] = `git --git-dir '#{git_dir}' --work-tree '#{MRUBY_ROOT}' rev-parse --verify HEAD`.strip + mruby['git_commit'] = `git --git-dir #{shellquote(git_dir)} --work-tree #{shellquote(MRUBY_ROOT)} rev-parse --verify HEAD`.strip end mruby -- cgit v1.2.3 From 57a56ddaa26d1bb7d67c8dde435b2e08dc17290f Mon Sep 17 00:00:00 2001 From: Hiroshi Mimaki Date: Tue, 19 Nov 2019 18:58:11 +0900 Subject: Release `mruby 2.1.0`. --- doc/guides/debugger.md | 2 +- doc/limitations.md | 18 +++++++++--------- include/mruby/version.h | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/doc/guides/debugger.md b/doc/guides/debugger.md index 783ac4937..a94ef1802 100644 --- a/doc/guides/debugger.md +++ b/doc/guides/debugger.md @@ -38,7 +38,7 @@ To confirm mrdb was installed properly, run mrdb with the `--version` option: ```bash $ mrdb --version -mruby 2.1.0 (2019-10-18) +mruby 2.1.0 (2019-11-19) ``` ## 2.2 Basic Operation diff --git a/doc/limitations.md b/doc/limitations.md index f37a71cf0..9ad2019f7 100644 --- a/doc/limitations.md +++ b/doc/limitations.md @@ -38,7 +38,7 @@ puts [1,2,3] 3 ``` -#### mruby [2.1.0 (2019-10-18)] +#### mruby [2.1.0 (2019-11-19)] ``` [1, 2, 3] @@ -61,7 +61,7 @@ end `ZeroDivisionError` is raised. -#### mruby [2.1.0 (2019-10-18)] +#### mruby [2.1.0 (2019-11-19)] No exception is raised. @@ -89,7 +89,7 @@ p Liste.new "foobar" ` [] ` -#### mruby [2.1.0 (2019-10-18)] +#### mruby [2.1.0 (2019-11-19)] `ArgumentError` is raised. @@ -119,7 +119,7 @@ false true ``` -#### mruby [2.1.0 (2019-10-18)] +#### mruby [2.1.0 (2019-11-19)] ``` true @@ -156,7 +156,7 @@ p 'ok' ok ``` -#### mruby [2.1.0 (2019-10-18)] +#### mruby [2.1.0 (2019-11-19)] ``` test.rb:8: undefined method 'test_func' (NoMethodError) @@ -178,7 +178,7 @@ defined?(Foo) nil ``` -#### mruby [2.1.0 (2019-10-18)] +#### mruby [2.1.0 (2019-11-19)] `NameError` is raised. @@ -195,7 +195,7 @@ alias $a $__a__ ` nil ` -#### mruby [2.1.0 (2019-10-18)] +#### mruby [2.1.0 (2019-11-19)] Syntax error @@ -217,7 +217,7 @@ end `ArgumentError` is raised. The re-defined `+` operator does not accept any arguments. -#### mruby [2.1.0 (2019-10-18)] +#### mruby [2.1.0 (2019-11-19)] ` 'ab' ` Behavior of the operator wasn't changed. @@ -233,7 +233,7 @@ $ ruby -e 'puts Proc.new {}.binding' # ``` -#### mruby [2.1.0 (2019-10-18)] +#### mruby [2.1.0 (2019-11-19)] ``` $ ./bin/mruby -e 'puts Proc.new {}.binding' diff --git a/include/mruby/version.h b/include/mruby/version.h index a82b0c00c..f4ef21021 100644 --- a/include/mruby/version.h +++ b/include/mruby/version.h @@ -67,12 +67,12 @@ MRB_BEGIN_DECL /* * Release month. */ -#define MRUBY_RELEASE_MONTH 10 +#define MRUBY_RELEASE_MONTH 11 /* * Release day. */ -#define MRUBY_RELEASE_DAY 18 +#define MRUBY_RELEASE_DAY 19 /* * Release date as a string. -- cgit v1.2.3