diff options
| author | John Bampton <[email protected]> | 2020-12-15 19:34:01 +1000 |
|---|---|---|
| committer | John Bampton <[email protected]> | 2020-12-15 19:44:02 +1000 |
| commit | 4fa3359d44471cf301fe6755dd281a87304d5d01 (patch) | |
| tree | 5161a88ea84758ea3dca9b5271745207964015e0 /mrbgems | |
| parent | e9fe337b952731226449027a4c34471af27b23e6 (diff) | |
| download | mruby-4fa3359d44471cf301fe6755dd281a87304d5d01.tar.gz mruby-4fa3359d44471cf301fe6755dd281a87304d5d01.zip | |
refactor: remove trailing whitespace from C, Header, Ruby and YAML files
Lint
Diffstat (limited to 'mrbgems')
| -rw-r--r-- | mrbgems/mruby-compiler/core/codegen.c | 2 | ||||
| -rw-r--r-- | mrbgems/mruby-enumerator/test/enumerator.rb | 2 | ||||
| -rw-r--r-- | mrbgems/mruby-io/src/file.c | 10 | ||||
| -rw-r--r-- | mrbgems/mruby-range-ext/mrblib/range.rb | 2 | ||||
| -rw-r--r-- | mrbgems/mruby-range-ext/test/range.rb | 2 | ||||
| -rw-r--r-- | mrbgems/mruby-rational/src/rational.c | 4 | ||||
| -rw-r--r-- | mrbgems/mruby-test/vformat.c | 4 |
7 files changed, 13 insertions, 13 deletions
diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c index 28a484133..66763b953 100644 --- a/mrbgems/mruby-compiler/core/codegen.c +++ b/mrbgems/mruby-compiler/core/codegen.c @@ -2498,7 +2498,7 @@ codegen(codegen_scope *s, node *tree, int val) else { if (i < 0) { if (i == -1) genop_1(s, OP_LOADI__1, cursp()); - else if (i >= -0xff) genop_2(s, OP_LOADINEG, cursp(), (uint16_t)-i); + else if (i >= -0xff) genop_2(s, OP_LOADINEG, cursp(), (uint16_t)-i); else if (i >= INT16_MIN) genop_2S(s, OP_LOADI16, cursp(), (uint16_t)i); else if (i >= INT32_MIN) genop_2SS(s, OP_LOADI32, cursp(), (uint32_t)i); else goto lit_int; diff --git a/mrbgems/mruby-enumerator/test/enumerator.rb b/mrbgems/mruby-enumerator/test/enumerator.rb index 26d5766fc..fa70f9eea 100644 --- a/mrbgems/mruby-enumerator/test/enumerator.rb +++ b/mrbgems/mruby-enumerator/test/enumerator.rb @@ -567,7 +567,7 @@ assert 'Enumerator.produce' do # Without initial object passed_args = [] enum = Enumerator.produce {|obj| passed_args << obj; (obj || 0).succ } - assert_equal Enumerator, enum.class + assert_equal Enumerator, enum.class assert_take [1, 2, 3], enum assert_equal [nil, 1, 2], passed_args diff --git a/mrbgems/mruby-io/src/file.c b/mrbgems/mruby-io/src/file.c index d6db8140c..1704579cf 100644 --- a/mrbgems/mruby-io/src/file.c +++ b/mrbgems/mruby-io/src/file.c @@ -290,20 +290,20 @@ mrb_file__getwd(mrb_state *mrb, mrb_value klass) #define IS_DEVICEID(x) (x == '.' || x == '?') #define CHECK_UNCDEV_PATH (IS_FILESEP(path[0]) && IS_FILESEP(path[1])) -static int +static int is_absolute_traditional_path(const char *path, size_t len) { if (len < 3) return 0; return (ISALPHA(path[0]) && IS_VOLSEP(path[1]) && IS_FILESEP(path[2])); } -static int +static int is_aboslute_unc_path(const char *path, size_t len) { if (len < 2) return 0; return (CHECK_UNCDEV_PATH && !IS_DEVICEID(path[2])); } -static int +static int is_absolute_device_path(const char *path, size_t len) { if (len < 4) return 0; return (CHECK_UNCDEV_PATH && IS_DEVICEID(path[2]) && IS_FILESEP(path[3])); @@ -316,8 +316,8 @@ mrb_file_is_absolute_path(const char *path) if (IS_FILESEP(path[0])) return 1; if (len > 0) return ( - is_absolute_traditional_path(path, len) || - is_aboslute_unc_path(path, len) || + is_absolute_traditional_path(path, len) || + is_aboslute_unc_path(path, len) || is_absolute_device_path(path, len) ); else diff --git a/mrbgems/mruby-range-ext/mrblib/range.rb b/mrbgems/mruby-range-ext/mrblib/range.rb index de443e881..7fe502c9d 100644 --- a/mrbgems/mruby-range-ext/mrblib/range.rb +++ b/mrbgems/mruby-range-ext/mrblib/range.rb @@ -80,7 +80,7 @@ class Range last = self.end if block raise RangeError, "cannot get the minimum of endless range with custom comparison method" if last.nil? - return super + return super end return val if last.nil? diff --git a/mrbgems/mruby-range-ext/test/range.rb b/mrbgems/mruby-range-ext/test/range.rb index 6bb7890b8..863c619c8 100644 --- a/mrbgems/mruby-range-ext/test/range.rb +++ b/mrbgems/mruby-range-ext/test/range.rb @@ -35,7 +35,7 @@ assert('Range#size') do assert_equal 41, (1...42).size assert_nil ('a'..'z').size assert_nil ('a'..).size - + assert_nil (1..).size unless Object.const_defined?(:Float) skip unless Object.const_defined?(:Float) diff --git a/mrbgems/mruby-rational/src/rational.c b/mrbgems/mruby-rational/src/rational.c index 23d70fc04..6d94cb21f 100644 --- a/mrbgems/mruby-rational/src/rational.c +++ b/mrbgems/mruby-rational/src/rational.c @@ -96,7 +96,7 @@ rational_new(mrb_state *mrb, mrb_int numerator, mrb_int denominator) * md: max denominator value. Note that machine floating point number * has a finite resolution (10e-16 ish for 64 bit double), so specifying * a "best match with minimal error" is often wrong, because one can - * always just retrieve the significand and return that divided by + * always just retrieve the significand and return that divided by * 2**52, which is in a sense accurate, but generally not very useful: * 1.0/7.0 would be "2573485501354569/18014398509481984", for example. */ @@ -122,7 +122,7 @@ rational_new_f(mrb_state *mrb, mrb_float f0) mrb_raise(mrb, E_RANGE_ERROR, "integer overflow in rational"); } d = (mrb_int)f; - + /* continued fraction and check denominator each step */ for (i = 0; i < 64; i++) { a = (mrb_int)(n ? d / n : 0); diff --git a/mrbgems/mruby-test/vformat.c b/mrbgems/mruby-test/vformat.c index d73e52311..571d96b19 100644 --- a/mrbgems/mruby-test/vformat.c +++ b/mrbgems/mruby-test/vformat.c @@ -24,7 +24,7 @@ vf_s_format_c(mrb_state *mrb, mrb_value klass) mrb_value fmt_str, arg_str; const char *fmt; char c; - + mrb_get_args(mrb, "SS", &fmt_str, &arg_str); fmt = RSTRING_CSTR(mrb, fmt_str); c = RSTRING_CSTR(mrb, arg_str)[0]; @@ -164,7 +164,7 @@ mrb_init_test_vformat(mrb_state *mrb) #define VF_DEFINE_FORMAT_METHOD(t) VF_DEFINE_FORMAT_METHOD_n(t,2) #define VF_DEFINE_FORMAT_METHOD_n(t,n) mrb_define_class_method(mrb, vf, #t, vf_s_format_##t, MRB_ARGS_REQ(n)); - + VF_DEFINE_FORMAT_METHOD(c); VF_DEFINE_FORMAT_METHOD(d); #ifndef MRB_NO_FLOAT |
