summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.editorconfig43
-rw-r--r--build_config/dreamcast_shelf.rb2
-rw-r--r--src/vm.c2
3 files changed, 45 insertions, 2 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/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/vm.c b/src/vm.c
index 390ce8aaa..0e7eb65e5 100644
--- a/src/vm.c
+++ b/src/vm.c
@@ -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