Yukihiro Matz Matsumoto
7cea9d7b94
int and mrb_int should not be mixed under -DMRB_INT64; may fix #557
2012-11-17 02:16:35 +09:00
Yukihiro Matz Matsumoto
902dd63803
remove FL_XXX macros
2012-11-04 05:15:22 +09:00
Yukihiro Matz Matsumoto
d2d2e9f5f9
add new predicates mrb_string_p(),mrb_array_p(),mrb_hash_p()
2012-11-04 05:02:39 +09:00
Yukihiro Matz Matsumoto
3ba521ae9e
replace FIXNUM_P() by mrb_fixnum_p()
2012-11-04 04:49:43 +09:00
Masaki Muranaka
6069a33089
mrb_raisef(): new function. Same as previou version of mrb_raise().
...
mrb_raise(): API modified. It cannot treat variable arguments.
2012-10-23 09:42:22 +09:00
Masaki Muranaka
d5c4439013
Avoid memcpy() on copying structures.
2012-10-21 00:49:39 +09:00
Yukihiro Matsumoto
5adbbe66d8
should adjust array size
2012-09-27 17:17:14 +09:00
Yukihiro Matsumoto
54101eec43
typo fixed
2012-09-12 07:41:28 +09:00
Yukihiro Matsumoto
2edee29e68
Array#reverse! should call ary_modify
2012-09-10 23:47:08 +09:00
Yukihiro Matsumoto
1a816db854
eagerly reduce allocated array memory
2012-09-10 21:54:42 +09:00
Yukihiro Matsumoto
22f22cc2e2
use mrb_malloc instead of clearing mrb_calloc
2012-09-10 20:46:24 +09:00
Yukihiro Matsumoto
fd252fecf4
check special_const before calling respond_to?
2012-09-10 20:35:42 +09:00
Yukihiro Matsumoto
e5dde46c7c
reduce mrb_funcall invocations
2012-08-18 19:29:07 +09:00
Masaki Muranaka
cc1fc5332a
Remove redundant code in mrb_array_aget().
2012-07-31 14:52:44 +09:00
Max Anselm
5a4beeed2d
Make all(?) void casts explicit for C++
2012-07-29 19:48:48 -04:00
Akira Kuroda
a2aa7e7f52
fix segmentation fault in Array#first
2012-07-29 00:21:40 +09:00
Akira Kuroda
f114e3e252
fix segmentation fault in Array#last
2012-07-25 00:05:51 +09:00
Yukihiro Matsumoto
50f56a2436
Array#join to accept only strings as sep
2012-07-15 16:22:54 +09:00
Masamitsu MURASE
b9215a01f9
Add ary_modify to prevent corrupting shared array.
2012-07-10 01:23:26 +09:00
Masaki Muranaka
611cf71a10
Use mrb_calloc if you want zero cleard buffers.
2012-07-08 11:33:49 +09:00
Masaki Muranaka
312b2c7b16
Optimize range check.
2012-07-07 16:30:52 +09:00
Masaki Muranaka
21f2e5364b
Use mrb_str_new() instead of mrb_str_new2() as possible.
2012-06-22 17:02:08 +09:00
Masaki Muranaka
0c5b704de3
Remove strlen(). We can use sizeof() of char array because sizeof(char) is always 1 (ISO C99).
2012-06-21 11:45:55 +09:00
Yukihiro Matsumoto
3b1b9b050b
optimize Array#unshift using shared body object
2012-06-13 02:29:13 +09:00
Yukihiro Matsumoto
d39a355af3
wrong ary->capa size was set in ary_modify()
2012-06-13 02:27:51 +09:00
Yukihiro Matsumoto
4c01f002fd
mruby/array.h: rename buf to ptr
2012-06-05 23:20:36 +09:00
Yukihiro Matsumoto
e4529c065d
make arrays to share bodies
2012-06-03 23:05:31 +09:00
Yukihiro Matsumoto
34c049c63e
remove unused mrb_mem_clear
2012-06-02 21:34:10 +09:00
Yukihiro Matsumoto
54808d1df5
clean appendix comments from array.c
2012-06-02 21:31:03 +09:00
Yukihiro Matsumoto
92ee53146f
unify long,size_t to int in array.[ch]
2012-06-02 21:30:04 +09:00
Yukihiro Matsumoto
0e46f49aaa
changed prototype mrb_ary_replace to (mrb_state*,mrb_value,mrb_value)
2012-06-02 21:26:30 +09:00
Yukihiro Matsumoto
c0c712d33b
small refactoring around Array#concat
2012-06-02 21:17:14 +09:00
Yukihiro Matsumoto
687ec8e65c
remove ary_reverse that no longer used
2012-06-02 21:08:25 +09:00
Yukihiro Matsumoto
3e9fc0b013
add proper type check (using mrb_get_args) in Array#replace
2012-06-02 21:07:50 +09:00
Yukihiro Matsumoto
ca4de06e60
avoid using mrb_value in Array#+
2012-06-02 21:05:33 +09:00
Yukihiro Matsumoto
231cb59566
Array#reverse revisited
2012-06-02 19:01:00 +09:00
Yukihiro Matsumoto
f56abcbb5a
reorder mrb_ary_new_from_values() args to (argc, argv)
2012-06-01 02:18:30 +09:00
Yukihiro Matsumoto
62f4270571
remove prototype for mrb_exec_recursive_paired()
2012-06-01 01:54:11 +09:00
Yukihiro Matsumoto
7a7c1cf128
stop using mrb_exec_recursive_paired() from Array comparison
2012-06-01 01:52:57 +09:00
Yukihiro Matsumoto
cd713836aa
simplify Array#join
2012-05-24 01:20:33 +09:00
Yukihiro Matsumoto
ad9e841c53
made mrb_get_args() better (optinal args, type checks); close #173 #176
2012-05-24 01:09:36 +09:00
Yukihiro Matsumoto
4523bee953
cast style consistency
2012-05-23 03:31:55 +09:00
Mitchell Blank Jr
9e336b00e5
More C++ compilability work: mrb_obj_alloc void* conversions
...
One of the biggest set of changes needed to make C++ compile, is that you
can't autoconvert "void*" to a different pointer type without a cast (you
can of course, convert pointers *to* "void*"!)
For the first part, convert the users of "mrb_obj_alloc". Since it has
to return something, make it RBasic* (that's what mrb_obj_alloc() is
operating on anyway). This way, even in C you'll get a warning if you
don't cast it.
For places where there are a lot of similar calls to mrb_obj_alloc(),
this can be easily hidden through a macro. I did this in string.c:
#define mrb_obj_alloc_string(mrb) ((struct RString *) mrb_obj_alloc((mrb), MRB_TT_STRING, (mrb)->string_class))
I also updated the mrb_object() macro to also return a RBasic* -- my
previous commit changed that from "void*" -> "RObject*", but I figure
it should be consistent with mrb_obj_alloc()
2012-05-20 09:43:14 -07:00
Yukihiro Matsumoto
8268f95e0e
remove code moved to mrblib/array.rb
2012-05-10 16:37:38 +09:00
Yukihiro Matsumoto
73e92e2579
remove INCLUDE_REGEXP dependency from array.c
2012-05-10 16:33:58 +09:00
Kazuki Tsujimoto
93f7924639
Fix SEGV caused by using the splat operator for non arrays
2012-05-03 21:16:51 +09:00
roco
4ec6d41f16
rm whitespace
2012-04-30 14:29:19 -07:00
Patrick Hogan
db20b5142b
mrb_ary_dup is only used by mrb_ary_sort which is removed by #if 0
...
Signed-off-by: Patrick Hogan <pbhogan@gmail.com >
2012-04-26 08:36:32 -05:00
Yukihiro Matsumoto
d4ef3baca8
remove code for unsupported taint-mode
2012-04-23 18:30:49 +09:00
mimaki
c80487561f
Merge branch 'master' of github.com:mruby/mruby
...
Conflicts:
src/variable.c
2012-04-23 11:51:47 +09:00