diff options
| author | Yuichiro MASUI <[email protected]> | 2012-12-16 01:58:51 +0900 |
|---|---|---|
| committer | Yuichiro MASUI <[email protected]> | 2012-12-16 01:58:51 +0900 |
| commit | 4b8959daff04feabbcb3b2302f5171561ca1f194 (patch) | |
| tree | 2f75446c91d3da292fbbb69477dd57ea8f9bb0af | |
| parent | 06d242ae430ad37fd88fe6490980121ee26a1283 (diff) | |
| parent | 404ad702db6b421eed9e5245edcb7c57eff9b359 (diff) | |
| download | mruby-4b8959daff04feabbcb3b2302f5171561ca1f194.tar.gz mruby-4b8959daff04feabbcb3b2302f5171561ca1f194.zip | |
Merge branch 'master' into use_ruby_for_building
| -rw-r--r-- | include/mruby/proc.h | 1 | ||||
| -rw-r--r-- | mrbgems/generator.c | 4 | ||||
| -rw-r--r-- | src/class.c | 1 | ||||
| -rw-r--r-- | src/vm.c | 4 | ||||
| -rw-r--r-- | test/Makefile | 2 | ||||
| -rw-r--r-- | tools/mirb/Makefile | 2 | ||||
| -rw-r--r-- | tools/mruby/Makefile | 2 |
7 files changed, 9 insertions, 7 deletions
diff --git a/include/mruby/proc.h b/include/mruby/proc.h index 96f7ddbd7..745d56b6b 100644 --- a/include/mruby/proc.h +++ b/include/mruby/proc.h @@ -49,6 +49,7 @@ struct RProc { struct RProc *mrb_proc_new(mrb_state*, mrb_irep*); struct RProc *mrb_proc_new_cfunc(mrb_state*, mrb_func_t); struct RProc *mrb_closure_new(mrb_state*, mrb_irep*); +struct RProc *mrb_closure_new_cfunc(mrb_state *mrb, mrb_func_t func, int nlocals); void mrb_proc_copy(struct RProc *a, struct RProc *b); #include "mruby/khash.h" diff --git a/mrbgems/generator.c b/mrbgems/generator.c index f5b1304fa..542ba0ade 100644 --- a/mrbgems/generator.c +++ b/mrbgems/generator.c @@ -145,7 +145,7 @@ for_each_gem (char before[1024], char after[1024], { /* active GEM check */ FILE *active_gem_file; - char gem_char; + int gem_char; char gem_name[1024] = { 0 }; int char_index; char gem_list[1024][1024] = { { 0 }, { 0 } }; @@ -166,7 +166,7 @@ for_each_gem (char before[1024], char after[1024], char_index = 0; gem_index = 0; skip = FALSE; - while((gem_char = fgetc(active_gem_file)) != EOF) { + while ((gem_char = fgetc(active_gem_file)) != EOF) { if (gem_char == '\n') { /* Every line contains one active GEM */ gem_name[char_index++] = '\0'; diff --git a/src/class.c b/src/class.c index dcd0ae492..339920b6e 100644 --- a/src/class.c +++ b/src/class.c @@ -888,6 +888,7 @@ mrb_singleton_class(mrb_state *mrb, mrb_value v) case MRB_TT_TRUE: return mrb_obj_value(mrb->true_class); case MRB_TT_MAIN: + case MRB_TT_VOIDP: return mrb_obj_value(mrb->object_class); case MRB_TT_SYMBOL: case MRB_TT_FIXNUM: @@ -1390,7 +1390,7 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self) x = mrb_fixnum(regs[a]); y = mrb_fixnum(regs[a+1]); z = x - y; - if (((x < 0) ^ (y < 0)) == 0 && (x < 0) != (z < 0)) { + if (((x < 0) ^ (y < 0)) != 0 && (x < 0) != (z < 0)) { /* integer overflow */ SET_FLT_VALUE(regs[a], (mrb_float)x - (mrb_float)y); break; @@ -1532,7 +1532,7 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self) mrb_int y = GETARG_C(i); mrb_int z = x - y; - if (((x < 0) ^ (y < 0)) == 0 && (x < 0) != (z < 0)) { + if (((x < 0) ^ (y < 0)) != 0 && (x < 0) != (z < 0)) { /* integer overflow */ SET_FLT_VALUE(regs[a], (mrb_float)x - (mrb_float)y); break; diff --git a/test/Makefile b/test/Makefile index 4a205999b..7f6607e95 100644 --- a/test/Makefile +++ b/test/Makefile @@ -96,7 +96,7 @@ all : $(EXE) $(MRUBY) $(TESTRB) $(TESTMRB) @echo # executable constructed using linker from object files -$(EXE) : $(OBJS) $(LIBR) +$(EXE) : $(OBJS) $(LIBR) $(GEM_ARCHIVE_FILES) $(LL) -o $@ $(LDFLAGS) $(OBJS) $(LIBR) $(GEM_ARCHIVE_FILES) $(LIBS) -include $(OBJS:.o=.d) diff --git a/tools/mirb/Makefile b/tools/mirb/Makefile index 8e26feaf3..b953038a8 100644 --- a/tools/mirb/Makefile +++ b/tools/mirb/Makefile @@ -66,7 +66,7 @@ endif all : $(LIBR) $(EXE) # executable constructed using linker from object files -$(EXE) : $(LIBR) $(OBJS) $(EXTS) +$(EXE) : $(LIBR) $(OBJS) $(GEM_ARCHIVE_FILES) $(EXTS) $(LL) -o $@ $(LDFLAGS) $(OBJS) $(LIBR) $(GEM_ARCHIVE_FILES) $(EXTS) $(LIBS) -include $(OBJS:.o=.d) diff --git a/tools/mruby/Makefile b/tools/mruby/Makefile index 0316bfb8f..55e37aafa 100644 --- a/tools/mruby/Makefile +++ b/tools/mruby/Makefile @@ -71,7 +71,7 @@ endif all : $(LIBR) $(EXE) # executable constructed using linker from object files -$(EXE) : $(LIBR) $(OBJS) $(EXTS) +$(EXE) : $(LIBR) $(OBJS) $(GEM_ARCHIVE_FILES) $(EXTS) $(LL) -o $@ $(LDFLAGS) $(OBJS) $(LIBR) $(GEM_ARCHIVE_FILES) $(EXTS) $(LIBS) -include $(OBJS:.o=.d) |
