ruby-changes:67634
From: Kenta <ko1@a...>
Date: Mon, 6 Sep 2021 16:02:08 +0900 (JST)
Subject: [ruby-changes:67634] f8bb2d9b27 (master): memory_view.c: Rename private to private_data for C++ (#4812)
https://git.ruby-lang.org/ruby.git/commit/?id=f8bb2d9b27 From f8bb2d9b2724b4a74322ac82d27c32a61153e8dd Mon Sep 17 00:00:00 2001 From: Kenta Murata <mrkn@u...> Date: Mon, 6 Sep 2021 16:01:52 +0900 Subject: memory_view.c: Rename private to private_data for C++ (#4812) * memory_view.c: Rename private to private_data for C++ * doc/memory_view.md: Update document * Fix doc/memory_view.md Co-authored-by: Sutou Kouhei <kou@c...> Co-authored-by: Sutou Kouhei <kou@c...> --- doc/memory_view.md | 2 +- include/ruby/memory_view.h | 2 +- memory_view.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/memory_view.md b/doc/memory_view.md index 646a354..a24700d 100644 --- a/doc/memory_view.md +++ b/doc/memory_view.md @@ -89,7 +89,7 @@ The MemoryView structure consists of the following members. https://github.com/ruby/ruby/blob/trunk/doc/memory_view.md#L89 A `ndim` size array consisting of the offsets in each dimension when the MemoryView exposes a nested array. This can be `NULL` when the MemoryView exposes a flat array. -- `void *const private` +- `void *private_data` The private data that MemoryView provider uses internally. This can be `NULL` when any private data is unnecessary. diff --git a/include/ruby/memory_view.h b/include/ruby/memory_view.h index 4492c06..a67c1c0 100644 --- a/include/ruby/memory_view.h +++ b/include/ruby/memory_view.h @@ -100,7 +100,7 @@ typedef struct { https://github.com/ruby/ruby/blob/trunk/include/ruby/memory_view.h#L100 const ssize_t *sub_offsets; /* the private data for managing this exported memory */ - void *const private; + void *private_data; } rb_memory_view_t; typedef bool (* rb_memory_view_get_func_t)(VALUE obj, rb_memory_view_t *view, int flags); diff --git a/memory_view.c b/memory_view.c index 4c6c122..b08f13e 100644 --- a/memory_view.c +++ b/memory_view.c @@ -210,7 +210,7 @@ rb_memory_view_init_as_byte_array(rb_memory_view_t *view, VALUE obj, void *data, https://github.com/ruby/ruby/blob/trunk/memory_view.c#L210 view->shape = NULL; view->strides = NULL; view->sub_offsets = NULL; - *((void **)&view->private) = NULL; + view->private_data = NULL; return true; } -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/