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:
Yukihiro "Matz" Matsumoto
2021-02-12 16:57:33 +09:00
parent 31051fd656
commit 2af8e16cc6
+1 -1
View File
@@ -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))