Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
d8c70167
Commit
d8c70167
authored
Dec 15, 2018
by
Takashi Sawanaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make mrb_ary_clear() function callable from C again
parent
ec812c64
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
src/array.c
src/array.c
+8
-2
No files found.
src/array.c
View file @
d8c70167
...
@@ -1089,7 +1089,6 @@ mrb_ary_clear(mrb_state *mrb, mrb_value self)
...
@@ -1089,7 +1089,6 @@ mrb_ary_clear(mrb_state *mrb, mrb_value self)
{
{
struct
RArray
*
a
=
mrb_ary_ptr
(
self
);
struct
RArray
*
a
=
mrb_ary_ptr
(
self
);
mrb_get_args
(
mrb
,
""
);
ary_modify
(
mrb
,
a
);
ary_modify
(
mrb
,
a
);
if
(
ARY_SHARED_P
(
a
))
{
if
(
ARY_SHARED_P
(
a
))
{
mrb_ary_decref
(
mrb
,
a
->
as
.
heap
.
aux
.
shared
);
mrb_ary_decref
(
mrb
,
a
->
as
.
heap
.
aux
.
shared
);
...
@@ -1103,6 +1102,13 @@ mrb_ary_clear(mrb_state *mrb, mrb_value self)
...
@@ -1103,6 +1102,13 @@ mrb_ary_clear(mrb_state *mrb, mrb_value self)
return
self
;
return
self
;
}
}
static
mrb_value
mrb_ary_clear_m
(
mrb_state
*
mrb
,
mrb_value
self
)
{
mrb_get_args
(
mrb
,
""
);
return
mrb_ary_clear
(
mrb
,
self
);
}
static
mrb_value
static
mrb_value
mrb_ary_empty_p
(
mrb_state
*
mrb
,
mrb_value
self
)
mrb_ary_empty_p
(
mrb_state
*
mrb
,
mrb_value
self
)
{
{
...
@@ -1268,7 +1274,7 @@ mrb_init_array(mrb_state *mrb)
...
@@ -1268,7 +1274,7 @@ mrb_init_array(mrb_state *mrb)
mrb_define_method
(
mrb
,
a
,
"<<"
,
mrb_ary_push_m
,
MRB_ARGS_REQ
(
1
));
/* 15.2.12.5.3 */
mrb_define_method
(
mrb
,
a
,
"<<"
,
mrb_ary_push_m
,
MRB_ARGS_REQ
(
1
));
/* 15.2.12.5.3 */
mrb_define_method
(
mrb
,
a
,
"[]"
,
mrb_ary_aget
,
MRB_ARGS_ANY
());
/* 15.2.12.5.4 */
mrb_define_method
(
mrb
,
a
,
"[]"
,
mrb_ary_aget
,
MRB_ARGS_ANY
());
/* 15.2.12.5.4 */
mrb_define_method
(
mrb
,
a
,
"[]="
,
mrb_ary_aset
,
MRB_ARGS_ANY
());
/* 15.2.12.5.5 */
mrb_define_method
(
mrb
,
a
,
"[]="
,
mrb_ary_aset
,
MRB_ARGS_ANY
());
/* 15.2.12.5.5 */
mrb_define_method
(
mrb
,
a
,
"clear"
,
mrb_ary_clear
,
MRB_ARGS_NONE
());
/* 15.2.12.5.6 */
mrb_define_method
(
mrb
,
a
,
"clear"
,
mrb_ary_clear
_m
,
MRB_ARGS_NONE
());
/* 15.2.12.5.6 */
mrb_define_method
(
mrb
,
a
,
"concat"
,
mrb_ary_concat_m
,
MRB_ARGS_REQ
(
1
));
/* 15.2.12.5.8 */
mrb_define_method
(
mrb
,
a
,
"concat"
,
mrb_ary_concat_m
,
MRB_ARGS_REQ
(
1
));
/* 15.2.12.5.8 */
mrb_define_method
(
mrb
,
a
,
"delete_at"
,
mrb_ary_delete_at
,
MRB_ARGS_REQ
(
1
));
/* 15.2.12.5.9 */
mrb_define_method
(
mrb
,
a
,
"delete_at"
,
mrb_ary_delete_at
,
MRB_ARGS_REQ
(
1
));
/* 15.2.12.5.9 */
mrb_define_method
(
mrb
,
a
,
"empty?"
,
mrb_ary_empty_p
,
MRB_ARGS_NONE
());
/* 15.2.12.5.12 */
mrb_define_method
(
mrb
,
a
,
"empty?"
,
mrb_ary_empty_p
,
MRB_ARGS_NONE
());
/* 15.2.12.5.12 */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment