diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-12-15 22:30:38 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-12-15 22:30:38 +0900 |
| commit | 2f177dcd7232f8b8d1d1dd2c4ed3d71583139afe (patch) | |
| tree | 5161a88ea84758ea3dca9b5271745207964015e0 | |
| parent | e9fe337b952731226449027a4c34471af27b23e6 (diff) | |
| parent | 4fa3359d44471cf301fe6755dd281a87304d5d01 (diff) | |
| download | mruby-2f177dcd7232f8b8d1d1dd2c4ed3d71583139afe.tar.gz mruby-2f177dcd7232f8b8d1d1dd2c4ed3d71583139afe.zip | |
Merge pull request #5222 from jbampton/remove-trailing-whitespace
refactor: remove trailing whitespace from C, Header, Ruby and YAML files
| -rw-r--r-- | .github/workflows/codeql-analysis.yml | 2 | ||||
| -rw-r--r-- | build_config/dreamcast_shelf.rb | 10 | ||||
| -rw-r--r-- | include/mruby/array.h | 2 | ||||
| -rw-r--r-- | include/mruby/compile.h | 4 | ||||
| -rw-r--r-- | include/mruby/string.h | 2 | ||||
| -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 | ||||
| -rw-r--r-- | mrblib/array.rb | 2 | ||||
| -rw-r--r-- | src/class.c | 2 | ||||
| -rw-r--r-- | src/dump.c | 4 | ||||
| -rw-r--r-- | src/numeric.c | 2 | ||||
| -rw-r--r-- | test/t/integer.rb | 2 | ||||
| -rw-r--r-- | test/t/range.rb | 2 |
18 files changed, 30 insertions, 30 deletions
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 0e7a5591f..efbc25e93 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -23,7 +23,7 @@ jobs: # the head of the pull request instead of the merge commit. - run: git checkout HEAD^2 if: ${{ github.event_name == 'pull_request' }} - + # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v1 diff --git a/build_config/dreamcast_shelf.rb b/build_config/dreamcast_shelf.rb index 3ae53184d..a92770070 100644 --- a/build_config/dreamcast_shelf.rb +++ b/build_config/dreamcast_shelf.rb @@ -11,7 +11,7 @@ MRuby::CrossBuild.new("dreamcast") do |conf| # To compile mruby with DreamSDK, RubyInstaller for Windows should be installed DREAMSDK_HOME = ENV["DREAMSDK_HOME"] MSYS_ROOT = !(DREAMSDK_HOME.nil? || DREAMSDK_HOME.empty?) ? "#{DREAMSDK_HOME}/msys/1.0" : "" - + # Setting paths DREAMCAST_PATH = "#{MSYS_ROOT}/opt/toolchains/dc" KOS_PATH = "#{DREAMCAST_PATH}/kos" @@ -37,16 +37,16 @@ MRuby::CrossBuild.new("dreamcast") do |conf| cxx.defines = conf.cc.defines.dup cxx.compile_options = conf.cc.compile_options.dup end - + # Linker # There is an issue when making the mruby library with KallistiOS: - # 'newlib_kill.o' and 'newlib_getpid.o' aren't found so they are explicitly + # 'newlib_kill.o' and 'newlib_getpid.o' aren't found so they are explicitly # specified here at least for now. conf.linker do |linker| linker.command="#{BIN_PATH}/sh-elf-gcc" linker.flags << ["#{MSYS_ROOT}/opt/toolchains/dc/kos/kernel/build/newlib_kill.o", "#{MSYS_ROOT}/opt/toolchains/dc/kos/kernel/build/newlib_getpid.o", "-Wl,--start-group -lkallisti -lc -lgcc -Wl,--end-group"] linker.library_paths << ["#{KOS_PATH}/lib/dreamcast", "#{KOS_PATH}/addons/lib/dreamcast", "#{KOS_PATH}/../kos-ports/lib"] - end + end # Archiver conf.archiver do |archiver| @@ -62,7 +62,7 @@ MRuby::CrossBuild.new("dreamcast") do |conf| # Disable C++ exception conf.disable_cxx_exception - + # Gems from core # removing mruby-io conf.gem :core => "mruby-metaprog" diff --git a/include/mruby/array.h b/include/mruby/array.h index 0b0137d5f..da811606a 100644 --- a/include/mruby/array.h +++ b/include/mruby/array.h @@ -64,7 +64,7 @@ struct RArray { #define ARY_SET_EMBED_LEN(a,len) ((a)->flags = ((a)->flags&~MRB_ARY_EMBED_MASK) | ((uint32_t)(len) + 1)) #define ARY_EMBED_PTR(a) ((a)->as.ary) #endif - + #define ARY_LEN(a) (ARY_EMBED_P(a)?ARY_EMBED_LEN(a):(a)->as.heap.len) #define ARY_PTR(a) (ARY_EMBED_P(a)?ARY_EMBED_PTR(a):(a)->as.heap.ptr) #define RARRAY_LEN(a) ARY_LEN(RARRAY(a)) diff --git a/include/mruby/compile.h b/include/mruby/compile.h index 7b5da4f69..9b062e60b 100644 --- a/include/mruby/compile.h +++ b/include/mruby/compile.h @@ -182,8 +182,8 @@ MRB_API struct mrb_parser_state* mrb_parse_nstring(mrb_state*,const char*,size_t MRB_API struct RProc* mrb_generate_code(mrb_state*, struct mrb_parser_state*); MRB_API mrb_value mrb_load_exec(mrb_state *mrb, struct mrb_parser_state *p, mrbc_context *c); -/** program load functions -* Please note! Currently due to interactions with the GC calling these functions will +/** program load functions +* Please note! Currently due to interactions with the GC calling these functions will * leak one RProc object per function call. * To prevent this save the current memory arena before calling and restore the arena * right after, like so diff --git a/include/mruby/string.h b/include/mruby/string.h index 288f0fda0..4410accd5 100644 --- a/include/mruby/string.h +++ b/include/mruby/string.h @@ -159,7 +159,7 @@ MRB_API mrb_int mrb_str_index(mrb_state *mrb, mrb_value str, const char *p, mrb_ * * mrb_close(mrb); * return 0; - * } + * } * * Result: * 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 diff --git a/mrblib/array.rb b/mrblib/array.rb index 6708027ab..18b729128 100644 --- a/mrblib/array.rb +++ b/mrblib/array.rb @@ -12,7 +12,7 @@ class Array # ISO 15.2.12.5.10 def each(&block) return to_enum :each unless block - + idx = 0 while idx < length block.call(self[idx]) diff --git a/src/class.c b/src/class.c index 7141fe099..92b58c3ff 100644 --- a/src/class.c +++ b/src/class.c @@ -1458,7 +1458,7 @@ fix_prepend_module(mrb_state *mrb, struct RBasic *obj, void *data) if (p->tt == MRB_TT_CLASS) break; if (p->c == m[0]) { include_module_at(mrb, ins_pos, ins_pos, m[1], 0); - break; + break; } c = p; p = p->super; diff --git a/src/dump.c b/src/dump.c index 85074d5a2..40f149f5d 100644 --- a/src/dump.c +++ b/src/dump.c @@ -138,7 +138,7 @@ get_pool_block_size(mrb_state *mrb, const mrb_irep *irep) #endif break; - default: /* packed IREP_TT_STRING */ + default: /* packed IREP_TT_STRING */ { mrb_int len = irep->pool[pool_no].tt >> 2; /* unpack length */ mrb_assert_int_fit(mrb_int, len, size_t, SIZE_MAX); @@ -961,7 +961,7 @@ dump_pool(mrb_state *mrb, const mrb_pool_value *p, FILE *fp) } mrb_bool mrb_sym_static_p(mrb_state *mrb, mrb_sym sym); - + static int dump_sym(mrb_state *mrb, mrb_sym sym, FILE *fp) { diff --git a/src/numeric.c b/src/numeric.c index ab39bd463..2eb5e0ff1 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -75,7 +75,7 @@ int_pow(mrb_state *mrb, mrb_value x) #ifndef MRB_NO_FLOAT mrb_value y = mrb_get_arg1(mrb); mrb_float z; - + if (!mrb_integer_p(y)) { mrb_get_args(mrb, "f", &z); z = pow((mrb_float)base, z); diff --git a/test/t/integer.rb b/test/t/integer.rb index 1d805ff11..adc8fe828 100644 --- a/test/t/integer.rb +++ b/test/t/integer.rb @@ -28,7 +28,7 @@ assert('Integer#*', '15.2.8.3.3') do a = 1*1 assert_equal 1, a if Object.const_defined?(:Float) - b = 1*1.0 + b = 1*1.0 assert_equal 1.0, b end assert_raise(TypeError){ 0*nil } diff --git a/test/t/range.rb b/test/t/range.rb index b5196cd9a..5f29b4514 100644 --- a/test/t/range.rb +++ b/test/t/range.rb @@ -155,7 +155,7 @@ assert('Range#eql?', '15.2.14.4.14') do assert_false (1..).eql? "1.." skip unless Object.const_defined?(:Float) assert_false (1..10).eql? (Range.new(1.0, 10.0)) - assert_false (1..).eql? (Range.new(1.0, nil)) + assert_false (1..).eql? (Range.new(1.0, nil)) end assert('Range#initialize_copy', '15.2.14.4.15') do |
