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
d9dc492f
Commit
d9dc492f
authored
Mar 01, 2013
by
Yukihiro Matz Matsumoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix indent in struct.c
parent
45890fae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
193 additions
and
195 deletions
+193
-195
mrbgems/mruby-struct/src/struct.c
mrbgems/mruby-struct/src/struct.c
+193
-195
No files found.
mrbgems/mruby-struct/src/struct.c
View file @
d9dc492f
...
@@ -41,8 +41,8 @@ struct_ivar_get(mrb_state *mrb, mrb_value c, mrb_sym id)
...
@@ -41,8 +41,8 @@ struct_ivar_get(mrb_state *mrb, mrb_value c, mrb_sym id)
{
{
struct
RClass
*
kclass
;
struct
RClass
*
kclass
;
struct
RClass
*
sclass
=
struct_class
(
mrb
);
struct
RClass
*
sclass
=
struct_class
(
mrb
);
mrb_value
ans
;
mrb_value
ans
;
for
(;;)
{
for
(;;)
{
ans
=
mrb_iv_get
(
mrb
,
c
,
id
);
ans
=
mrb_iv_get
(
mrb
,
c
,
id
);
if
(
!
mrb_nil_p
(
ans
))
return
ans
;
if
(
!
mrb_nil_p
(
ans
))
return
ans
;
...
@@ -99,7 +99,6 @@ mrb_struct_s_members_m(mrb_state *mrb, mrb_value klass)
...
@@ -99,7 +99,6 @@ mrb_struct_s_members_m(mrb_state *mrb, mrb_value klass)
mrb_ary_push
(
mrb
,
ary
,
*
p
);
mrb_ary_push
(
mrb
,
ary
,
*
p
);
p
++
;
p
++
;
}
}
return
ary
;
return
ary
;
}
}
...
@@ -216,7 +215,6 @@ mrb_struct_set(mrb_state *mrb, mrb_value obj, mrb_value val)
...
@@ -216,7 +215,6 @@ mrb_struct_set(mrb_state *mrb, mrb_value obj, mrb_value val)
return
ptr
[
i
]
=
val
;
return
ptr
[
i
]
=
val
;
}
}
}
}
mrb_raisef
(
mrb
,
E_NAME_ERROR
,
"`%s' is not a struct member"
,
mrb_raisef
(
mrb
,
E_NAME_ERROR
,
"`%s' is not a struct member"
,
mrb_sym2name
(
mrb
,
mid
));
mrb_sym2name
(
mrb
,
mid
));
return
mrb_nil_value
();
/* not reached */
return
mrb_nil_value
();
/* not reached */
...
@@ -292,7 +290,6 @@ make_struct(mrb_state *mrb, mrb_value name, mrb_value members, struct RClass * k
...
@@ -292,7 +290,6 @@ make_struct(mrb_state *mrb, mrb_value name, mrb_value members, struct RClass * k
mrb_define_method_id
(
mrb
,
c
,
mrb_id_attrset
(
mrb
,
id
),
mrb_struct_set_m
,
ARGS_REQ
(
1
));
mrb_define_method_id
(
mrb
,
c
,
mrb_id_attrset
(
mrb
,
id
),
mrb_struct_set_m
,
ARGS_REQ
(
1
));
}
}
}
}
return
nstr
;
return
nstr
;
}
}
...
@@ -407,6 +404,7 @@ static int
...
@@ -407,6 +404,7 @@ static int
num_members
(
mrb_state
*
mrb
,
struct
RClass
*
klass
)
num_members
(
mrb_state
*
mrb
,
struct
RClass
*
klass
)
{
{
mrb_value
members
;
mrb_value
members
;
members
=
struct_ivar_get
(
mrb
,
mrb_obj_value
(
klass
),
mrb_intern
(
mrb
,
"__members__"
));
members
=
struct_ivar_get
(
mrb
,
mrb_obj_value
(
klass
),
mrb_intern
(
mrb
,
"__members__"
));
if
(
!
mrb_array_p
(
members
))
{
if
(
!
mrb_array_p
(
members
))
{
mrb_raise
(
mrb
,
E_TYPE_ERROR
,
"broken members"
);
mrb_raise
(
mrb
,
E_TYPE_ERROR
,
"broken members"
);
...
...
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