diff options
| -rw-r--r-- | .editorconfig | 43 | ||||
| -rw-r--r-- | .github/dependabot.yml | 10 | ||||
| -rw-r--r-- | .github/workflows/build.yml | 2 | ||||
| -rw-r--r-- | .github/workflows/lint.yml | 4 | ||||
| -rw-r--r-- | .github/workflows/oss-fuzz.yml | 2 | ||||
| -rw-r--r-- | build_config/clang-asan.rb | 2 | ||||
| -rw-r--r-- | build_config/dreamcast_shelf.rb | 2 | ||||
| -rw-r--r-- | src/array.c | 7 | ||||
| -rw-r--r-- | src/vm.c | 2 | ||||
| -rwxr-xr-x | test/check-for-trailing-whitespace.sh | 13 |
10 files changed, 62 insertions, 25 deletions
diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..705b1f022 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,43 @@ +# About this file, see: +# Website: https://editorconfig.org/ +# For Emacs users: https://github.com/editorconfig/editorconfig-emacs +# For Vim users: https://github.com/editorconfig/editorconfig-vim + +root = true + +[*] +indent_style = tab +indent_size = 8 +tab_width = 8 +end_of_line = lf +charset = utf-8 +insert_final_newline = true + +[{Makefile,Makefile.*,makefile,*.mk}] +trim_trailing_whitespace = true +#max_line_length = 80 + +[*.{c,cc,C,cxx,cpp,h,hh,H,hxx,hpp,inc,y}] +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true +#max_line_length = 120 + +[{*.rb,Rakefile,rakefile,*.rake,*.gemspec,*.gembox}] +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true +#max_line_length = 120 + +[*.bat] +end_of_line = crlf +charset = latin1 +#max_line_length = 80 + +[*.{yaml,yml}] +indent_style = space +indent_size = 2 + +[*.md] +indent_style = space +indent_size = 2 diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..dac4cac33 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +# Basic set up + +version: 2 +updates: + + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 57c9c05be..435118e37 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -99,7 +99,7 @@ jobs: cache-version: v1 steps: - uses: actions/checkout@v2 - - uses: actions/cache@v2 + - uses: actions/[email protected] with: path: ${{ env.package-dir }} key: ${{ runner.os }}-cygwin-${{ env.cache-version }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e8db09bfb..474890010 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -32,9 +32,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: 🧹 Check for trailing whitespace - run: | - cd test || exit - sh ./check-for-trailing-whitespace.sh || exit 1 + run: "! git grep -EIn $'[ \t]+$'" yamllint: name: 🍶 YAML runs-on: ubuntu-latest diff --git a/.github/workflows/oss-fuzz.yml b/.github/workflows/oss-fuzz.yml index 60414e7dc..0fd505624 100644 --- a/.github/workflows/oss-fuzz.yml +++ b/.github/workflows/oss-fuzz.yml @@ -16,7 +16,7 @@ jobs: fuzz-seconds: 600 dry-run: false - name: Upload Crash - uses: actions/upload-artifact@v1 + uses: actions/[email protected] if: failure() with: name: artifacts diff --git a/build_config/clang-asan.rb b/build_config/clang-asan.rb index 5ee0d9129..19cc53bf0 100644 --- a/build_config/clang-asan.rb +++ b/build_config/clang-asan.rb @@ -1,7 +1,7 @@ MRuby::Build.new do |conf| conf.toolchain :clang # include the GEM box - conf.gembox 'default' + conf.gembox 'full-core' # Turn on `enable_debug` for better debugging conf.enable_sanitizer "address,undefined" diff --git a/build_config/dreamcast_shelf.rb b/build_config/dreamcast_shelf.rb index a92770070..7e7d6a52e 100644 --- a/build_config/dreamcast_shelf.rb +++ b/build_config/dreamcast_shelf.rb @@ -20,7 +20,7 @@ MRuby::CrossBuild.new("dreamcast") do |conf| # C compiler # Flags were extracted from KallistiOS environment files conf.cc do |cc| - cc.command = "#{BIN_PATH}/sh-elf-gcc" + cc.command = "#{BIN_PATH}/sh-elf-gcc" cc.include_paths << ["#{KOS_PATH}/include", "#{KOS_PATH}/kernel/arch/dreamcast/include", "#{KOS_PATH}/addons/include", "#{KOS_PATH}/../kos-ports/include"] cc.flags << ["-O2", "-fomit-frame-pointer", "-ml", "-m4-single-only", "-ffunction-sections", "-fdata-sections", "-Wall", "-g", "-fno-builtin", "-ml", "-m4-single-only", "-Wl,-Ttext=0x8c010000", "-Wl,--gc-sections", "-T#{KOS_PATH}/utils/ldscripts/shlelf.xc", "-nodefaultlibs"] cc.compile_options = %Q[%{flags} -o "%{outfile}" -c "%{infile}"] diff --git a/src/array.c b/src/array.c index ab6adf52c..8ab30bd8e 100644 --- a/src/array.c +++ b/src/array.c @@ -56,9 +56,9 @@ mrb_ary_new(mrb_state *mrb) } /* - * to copy array, use this instead of memcpy because of portability + * To copy array, use this instead of memcpy because of portability * * gcc on ARM may fail optimization of memcpy - * http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka3934.html + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56620 * * gcc on MIPS also fail * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39755 * * memcpy doesn't exist on freestanding environment @@ -66,8 +66,7 @@ mrb_ary_new(mrb_state *mrb) * If you optimize for binary size, use memcpy instead of this at your own risk * of above portability issue. * - * see also http://togetter.com/li/462898 - * + * See also https://togetter.com/li/462898 (Japanese) */ static inline void array_copy(mrb_value *dst, const mrb_value *src, mrb_int size) @@ -1022,7 +1022,7 @@ mrb_vm_exec(mrb_state *mrb, const struct RProc *proc, const mrb_code *pc) const struct mrb_irep_catch_handler *ch; #ifdef DIRECT_THREADED - static void *optable[] = { + static const void * const optable[] = { #define OPCODE(x,_) &&L_OP_ ## x, #include "mruby/ops.h" #undef OPCODE diff --git a/test/check-for-trailing-whitespace.sh b/test/check-for-trailing-whitespace.sh deleted file mode 100755 index 00be038f3..000000000 --- a/test/check-for-trailing-whitespace.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -cd .. || exit -# print first -grep -EHInr '( +)$' ./* - -var=$(grep -EHInr '( +)$' ./*) -# then exit with fail if found -if test -z "$var"; then - exit 0 -else - exit 1 -fi |
