Commit Graph

4991 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto 7ba309600a Merge pull request #982 from monaka/pr-make-MRB_STR_BUF_MIN_SIZE-configurable
Rename STR_BUF_MIN_SIZE to MRB_STR_BUF_MIN_SIZE. Make it configurable.
2013-03-12 17:24:02 -07:00
Masaki Muranaka 48cc92b3c6 Use mrb_int as possible. 2013-03-12 23:54:55 +09:00
Masaki Muranaka 66c4859d6c Copy to *lenp just in case lenp != NULL. 2013-03-12 23:54:14 +09:00
Yukihiro "Matz" Matsumoto 83e70654b0 Merge pull request #988 from monaka/pr-use-suitable-types-20130312
Use suitable types for variables.
2013-03-12 07:18:28 -07:00
Yukihiro "Matz" Matsumoto d0fb6d00a2 Merge pull request #983 from monaka/pr-fix-indent-in-parse.y-20130312
Fix indents in parse.y.
2013-03-12 07:14:32 -07:00
Masaki Muranaka e7fe4ed499 Use suitable types for variables. 2013-03-12 20:50:02 +09:00
Masaki Muranaka dd29e05f8e Use int. They are no need to use unsigned/signed long. Think about 16bit architectures. 2013-03-12 20:00:48 +09:00
Masaki Muranaka 2c54cf2e59 Add comments for paradnoid (a.k.a. mission critical) engineers. 2013-03-12 19:59:12 +09:00
Masaki Muranaka e1d2f50e47 Remove a meaningless type cast. 2013-03-12 19:55:18 +09:00
Masaki Muranaka 588f51508b Remove str_alloc(). Use mrb_obj_alloc_string instead. 2013-03-12 18:21:23 +09:00
Masaki Muranaka 3af128c742 Remove mrb_str_sublen() as it is not used. 2013-03-12 18:08:40 +09:00
Masaki Muranaka be506de3fc Remove mrb_str_new2(). Use mrb_str_new_cstr() instead.
Make mrb_str_new_cstr() accept NULL pointer. It generates 0byte strings by NULL pointer.
2013-03-12 17:54:40 +09:00
Masaki Muranaka d62f497bdd Fix indents. 2013-03-12 17:23:41 +09:00
Masaki Muranaka e2d31ba3f3 Rename STR_BUF_MIN_SIZE to MRB_STR_BUF_MIN_SIZE. Make it configurable. 2013-03-12 17:10:18 +09:00
Akito Mochizuki b11b3f6e86 fix inspect method 2013-03-12 12:34:50 +09:00
Yukihiro "Matz" Matsumoto 46d8c51763 Merge pull request #976 from kano4/dev
Fix indent in string.c
2013-03-11 11:30:24 -07:00
Yukihiro Matz Matsumoto 577a88161e restore arena after mrb_define_method() 2013-03-11 23:57:30 +09:00
Yukihiro Matz Matsumoto 34fe9d0156 return value from mrb_gc_arena_save() is int 2013-03-11 23:55:41 +09:00
kano4 0751faf467 Fix indent in string.c 2013-03-11 21:16:33 +09:00
Cremno f719b0e7ff define and use print format macros for mrb_int
For portability: %ld can't be used to print a 64-bit mrb_int on
WIN(32|64) because long is 32-bit wide.
2013-03-08 18:20:54 +01:00
Yukihiro Matz Matsumoto 318ad9c802 OP_ARRAY may overflow ARG_C 2013-03-09 00:39:08 +09:00
Masaki Muranaka 065494887d Fix warnings. 2013-03-09 00:38:10 +09:00
Masaki Muranaka 5bed51e584 Don't use int. It decreases portability. Use size_t as array index and length. It avoids overflow in the extreme situations. 2013-03-09 00:35:58 +09:00
Masaki Muranaka 8a7f5360cf Sanity check. As there are implicaton SIZE_MAX >= UINT32_MAX in this code. This assumption may break on some targets which have 16bit memory space. 2013-03-09 00:30:06 +09:00
Masaki Muranaka 51de2ba1d9 Clean up code. 2013-03-09 00:24:17 +09:00
Masaki Muranaka 6ff50568e1 Store to *bin_size if bin_size != NULL. 2013-03-09 00:23:08 +09:00
Masaki Muranaka 07017a4188 Use type cast not void* but char*. Don't substiture void pointers. 2013-03-09 00:12:19 +09:00
Masaki Muranaka faa1e5670a Remove unused substitutions and calculations. 2013-03-08 23:03:40 +09:00
Masaki Muranaka 9324c2168a Don't initialize variables that store result as MRB_DUMP_OK. It possibly causes bugs on modifications in the future. 2013-03-08 22:48:32 +09:00
Yuichiro MASUI d1a4958bfc Fixed to uint8_t 2013-03-08 21:46:48 +09:00
Yuichiro MASUI 814094230c Change unsigned char to uint8_t 2013-03-08 18:55:15 +09:00
Yukihiro Matz Matsumoto cdd41a33de unify mrb_ary_new{,_elts,_from_values}; mrb_ary_from_values() is a winner 2013-03-08 05:18:33 +09:00
Yuichiro MASUI 2842583678 New mrb format. The detail is in https://github.com/mruby/mruby/issues/944 2013-03-08 03:14:21 +09:00
Yukihiro Matz Matsumoto 2e95f638cd Cut off mrb_irep_free from mrb_close; based on a patch from @matsumoto-r; close #951 2013-03-06 15:22:46 +09:00
Yukihiro "Matz" Matsumoto 9e8f254fb0 Merge pull request #957 from mattn/no_ambiguous
Remove warning for regexp
2013-03-05 22:01:35 -08:00
mattn 1d42e8caa8 Remove warning for regexp 2013-03-06 14:40:39 +09:00
Carson McDonald f792552a5e Add null check after mrb_realloc for array 2013-03-05 15:22:10 -05:00
kano4 4bc4380335 Add include guard in node.h 2013-03-05 23:09:34 +09:00
kano4 fbbe6309fc Replace tabs with spaces 2013-03-05 23:06:44 +09:00
Yukihiro "Matz" Matsumoto 83c5274a71 Merge pull request #949 from mattn/find_symbol
Skip end of loop in mrb_sym2name_len
2013-03-04 23:59:18 -08:00
Yukihiro "Matz" Matsumoto f962068d40 Merge pull request #950 from monaka/pr-remove-macro-RB_GC_GUARD
Remove RB_GC_GUARD(x) macro.
2013-03-04 23:58:09 -08:00
Yukihiro Matz Matsumoto 4433bde8b0 skip empty OP_STRCAT 2013-03-05 16:56:25 +09:00
Masaki Muranaka 95c34a90ca Remove RB_GC_GUARD(x) macro. See also mruby/mruby#948. 2013-03-05 13:00:17 +09:00
mattn 9d3a864a86 Skip end of loop in mrb_sym2name_len 2013-03-05 10:48:05 +09:00
Yukihiro "Matz" Matsumoto 5a153851c3 Merge pull request #947 from monaka/pr-cleanup-stdio-calls-20130304
Cleanup stdio related.
2013-03-04 15:49:08 -08:00
Yukihiro Matz Matsumoto 21847865b1 use mrb_str_buf_new to create a buffer to be used by mrb_str_buf_cat 2013-03-05 01:45:13 +09:00
Masaki Muranaka 0e662e3bcd Make some printf enclose in #ifdef ENABLE_STDIO. 2013-03-05 01:43:57 +09:00
Yukihiro "Matz" Matsumoto a165fce1f2 Merge pull request #937 from monaka/pr-remove-snprintf-from-localjump_error
Reduce a snprintf() call in localjump_error().
2013-03-04 08:41:46 -08:00
Masaki Muranaka 6ae3a1b83e Modify API configuration.
C API mrb_p() is always callable.
  - But it will do nothing when ENABLE_STDIO is not defined.

  Kernel#__printstr__ is always callable.
  - But it will do nothing when ENABLE_STDIO is not defined.
2013-03-05 01:38:51 +09:00
Masaki Muranaka 5a025813b5 Include stdio.h in mrbconf.h instead of C extension sources. 2013-03-05 01:38:51 +09:00