mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
include/mruby/array.h: ARY_LEN() should return mrb_int.
It used to return `mrb_ssize` but its size may differ from `mrb_int`, e.g. `MRB_INT64` on `MRB_32BIT` architecture.
This commit is contained in:
@@ -65,7 +65,7 @@ struct RArray {
|
||||
#define ARY_EMBED_PTR(a) ((a)->as.ary)
|
||||
#endif
|
||||
|
||||
#define ARY_LEN(a) (ARY_EMBED_P(a)?ARY_EMBED_LEN(a):(a)->as.heap.len)
|
||||
#define ARY_LEN(a) (ARY_EMBED_P(a)?ARY_EMBED_LEN(a):(mrb_int)(a)->as.heap.len)
|
||||
#define ARY_PTR(a) (ARY_EMBED_P(a)?ARY_EMBED_PTR(a):(a)->as.heap.ptr)
|
||||
#define RARRAY_LEN(a) ARY_LEN(RARRAY(a))
|
||||
#define RARRAY_PTR(a) ARY_PTR(RARRAY(a))
|
||||
|
||||
Reference in New Issue
Block a user