summaryrefslogtreecommitdiff
path: root/ext/-test-
diff options
context:
space:
mode:
authorKenta Murata <mrkn@mrkn.jp>2020-12-22 17:33:14 +0900
committerKenta Murata <mrkn@mrkn.jp>2020-12-23 09:05:07 +0900
commit05014dcb887681d986105653ab527da2c4ff7774 (patch)
treeb965bd8c9d5b02704492830166bde8faf95adcb0 /ext/-test-
parent74a3569b597f28780958dc3001b41120b54a8a48 (diff)
[memory_view][fiddle] Use bool for boolean return value
Diffstat (limited to 'ext/-test-')
-rw-r--r--ext/-test-/memory_view/memory_view.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/-test-/memory_view/memory_view.c b/ext/-test-/memory_view/memory_view.c
index c85ba6fbfad..00572b91091 100644
--- a/ext/-test-/memory_view/memory_view.c
+++ b/ext/-test-/memory_view/memory_view.c
@@ -24,15 +24,15 @@ static VALUE sym_endianness;
static VALUE sym_little_endian;
static VALUE sym_big_endian;
-static int
+static bool
exportable_string_get_memory_view(VALUE obj, rb_memory_view_t *view, int flags)
{
VALUE str = rb_ivar_get(obj, id_str);
rb_memory_view_init_as_byte_array(view, obj, RSTRING_PTR(str), RSTRING_LEN(str), true);
- return 1;
+ return true;
}
-static int
+static bool
exportable_string_memory_view_available_p(VALUE obj)
{
VALUE str = rb_ivar_get(obj, id_str);
@@ -260,7 +260,7 @@ expstr_initialize(VALUE obj, VALUE s)
return Qnil;
}
-static int
+static bool
mdview_get_memory_view(VALUE obj, rb_memory_view_t *view, int flags)
{
VALUE buf_v = rb_ivar_get(obj, id_str);
@@ -272,7 +272,7 @@ mdview_get_memory_view(VALUE obj, rb_memory_view_t *view, int flags)
const char *err;
const ssize_t item_size = rb_memory_view_item_size_from_format(format, &err);
if (item_size < 0) {
- return 0;
+ return false;
}
ssize_t ndim = RARRAY_LEN(shape_v);
@@ -308,10 +308,10 @@ mdview_get_memory_view(VALUE obj, rb_memory_view_t *view, int flags)
view->shape = shape;
view->strides = strides;
- return 1;
+ return true;
}
-static int
+static bool
mdview_memory_view_available_p(VALUE obj)
{
return true;