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
0e46f49a
Commit
0e46f49a
authored
Jun 02, 2012
by
Yukihiro Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed prototype mrb_ary_replace to (mrb_state*,mrb_value,mrb_value)
parent
c0c712d3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
include/mruby/array.h
include/mruby/array.h
+1
-2
src/array.c
src/array.c
+13
-6
No files found.
include/mruby/array.h
View file @
0e46f49a
...
...
@@ -37,8 +37,7 @@ mrb_value mrb_ary_aget(mrb_state *mrb, mrb_value self);
mrb_value
mrb_ary_ref
(
mrb_state
*
mrb
,
mrb_value
ary
,
mrb_int
n
);
void
mrb_ary_set
(
mrb_state
*
mrb
,
mrb_value
ary
,
mrb_int
n
,
mrb_value
val
);
int
mrb_ary_len
(
mrb_state
*
mrb
,
mrb_value
ary
);
mrb_value
mrb_ary_replace_m
(
mrb_state
*
mrb
,
mrb_value
self
);
void
mrb_ary_replace
(
mrb_state
*
mrb
,
struct
RArray
*
a
,
mrb_value
*
argv
,
size_t
len
);
void
mrb_ary_replace
(
mrb_state
*
mrb
,
mrb_value
a
,
mrb_value
b
);
mrb_value
mrb_check_array_type
(
mrb_state
*
mrb
,
mrb_value
self
);
mrb_value
mrb_ary_unshift
(
mrb_state
*
mrb
,
mrb_value
self
,
mrb_value
item
);
mrb_value
mrb_ary_new4
(
mrb_state
*
mrb
,
long
n
,
const
mrb_value
*
elts
);
...
...
src/array.c
View file @
0e46f49a
...
...
@@ -256,8 +256,8 @@ mrb_ary_cmp(mrb_state *mrb, mrb_value ary1)
return
mrb_fixnum_value
((
len
==
0
)
?
0
:
(
len
>
0
)
?
1
:
-
1
);
}
void
mrb_
ary_replace
(
mrb_state
*
mrb
,
struct
RArray
*
a
,
mrb_value
*
argv
,
size_t
len
)
static
void
ary_replace
(
mrb_state
*
mrb
,
struct
RArray
*
a
,
mrb_value
*
argv
,
size_t
len
)
{
if
(
a
->
capa
<
len
)
mrb_ary_expand_capa
(
mrb
,
a
,
len
);
memcpy
(
a
->
buf
,
argv
,
sizeof
(
mrb_value
)
*
len
);
...
...
@@ -265,14 +265,21 @@ mrb_ary_replace(mrb_state *mrb, struct RArray *a, mrb_value *argv, size_t len)
a
->
len
=
len
;
}
void
mrb_ary_replace
(
mrb_state
*
mrb
,
mrb_value
self
,
mrb_value
other
)
{
struct
RArray
*
a2
=
mrb_ary_ptr
(
other
);
ary_replace
(
mrb
,
mrb_ary_ptr
(
self
),
a2
->
buf
,
a2
->
len
);
}
mrb_value
mrb_ary_replace_m
(
mrb_state
*
mrb
,
mrb_value
self
)
{
mrb_value
*
buf
;
int
blen
;
mrb_value
other
;
mrb_get_args
(
mrb
,
"
a"
,
&
buf
,
&
blen
);
mrb_ary_replace
(
mrb
,
mrb_ary_ptr
(
self
),
buf
,
blen
);
mrb_get_args
(
mrb
,
"
A"
,
&
other
);
mrb_ary_replace
(
mrb
,
self
,
other
);
return
self
;
}
...
...
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