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
d94469ac
Commit
d94469ac
authored
Aug 21, 2014
by
kkkkkt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed to call check_cv_name_str in check_cv_name_sym and adjust indent
parent
4d72d65d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
35 deletions
+29
-35
mrbgems/mruby-object-ext/src/object.c
mrbgems/mruby-object-ext/src/object.c
+3
-3
src/class.c
src/class.c
+6
-12
src/etc.c
src/etc.c
+20
-20
No files found.
mrbgems/mruby-object-ext/src/object.c
View file @
d94469ac
...
...
@@ -12,7 +12,7 @@
static
mrb_value
nil_to_a
(
mrb_state
*
mrb
,
mrb_value
obj
)
{
return
mrb_ary_new
(
mrb
);
return
mrb_ary_new
(
mrb
);
}
/*
...
...
@@ -25,7 +25,7 @@ nil_to_a(mrb_state *mrb, mrb_value obj)
static
mrb_value
nil_to_f
(
mrb_state
*
mrb
,
mrb_value
obj
)
{
return
mrb_float_value
(
mrb
,
0
.
0
);
return
mrb_float_value
(
mrb
,
0
.
0
);
}
/*
...
...
@@ -38,7 +38,7 @@ nil_to_f(mrb_state *mrb, mrb_value obj)
static
mrb_value
nil_to_i
(
mrb_state
*
mrb
,
mrb_value
obj
)
{
return
mrb_fixnum_value
(
0
);
return
mrb_fixnum_value
(
0
);
}
/*
...
...
src/class.c
View file @
d94469ac
...
...
@@ -1549,18 +1549,6 @@ mod_define_method(mrb_state *mrb, mrb_value self)
return
mrb_symbol_value
(
mid
);
}
static
void
check_cv_name_sym
(
mrb_state
*
mrb
,
mrb_sym
id
)
{
const
char
*
s
;
mrb_int
len
;
s
=
mrb_sym2name_len
(
mrb
,
id
,
&
len
);
if
(
len
<
3
||
!
(
s
[
0
]
==
'@'
&&
s
[
1
]
==
'@'
))
{
mrb_name_error
(
mrb
,
id
,
"`%S' is not allowed as a class variable name"
,
mrb_sym2str
(
mrb
,
id
));
}
}
static
void
check_cv_name_str
(
mrb_state
*
mrb
,
mrb_value
str
)
{
...
...
@@ -1572,6 +1560,12 @@ check_cv_name_str(mrb_state *mrb, mrb_value str)
}
}
static
void
check_cv_name_sym
(
mrb_state
*
mrb
,
mrb_sym
id
)
{
check_cv_name_str
(
mrb
,
mrb_sym2str
(
mrb
,
id
));
}
static
mrb_value
get_sym_or_str_arg
(
mrb_state
*
mrb
)
{
...
...
src/etc.c
View file @
d94469ac
...
...
@@ -113,34 +113,34 @@ mrb_obj_id(mrb_value obj)
#define MakeID(p) MakeID2(p,tt)
switch
(
tt
)
{
case
MRB_TT_FREE
:
case
MRB_TT_UNDEF
:
case
MRB_TT_FREE
:
case
MRB_TT_UNDEF
:
return
MakeID
(
0
);
/* not define */
case
MRB_TT_FALSE
:
case
MRB_TT_FALSE
:
if
(
mrb_nil_p
(
obj
))
return
MakeID
(
1
);
return
MakeID
(
0
);
case
MRB_TT_TRUE
:
case
MRB_TT_TRUE
:
return
MakeID
(
1
);
case
MRB_TT_SYMBOL
:
case
MRB_TT_SYMBOL
:
return
MakeID
(
mrb_symbol
(
obj
));
case
MRB_TT_FIXNUM
:
case
MRB_TT_FIXNUM
:
return
MakeID2
(
mrb_float_id
((
mrb_float
)
mrb_fixnum
(
obj
)),
MRB_TT_FLOAT
);
case
MRB_TT_FLOAT
:
case
MRB_TT_FLOAT
:
return
MakeID
(
mrb_float_id
(
mrb_float
(
obj
)));
case
MRB_TT_STRING
:
case
MRB_TT_OBJECT
:
case
MRB_TT_CLASS
:
case
MRB_TT_MODULE
:
case
MRB_TT_ICLASS
:
case
MRB_TT_SCLASS
:
case
MRB_TT_PROC
:
case
MRB_TT_ARRAY
:
case
MRB_TT_HASH
:
case
MRB_TT_RANGE
:
case
MRB_TT_EXCEPTION
:
case
MRB_TT_FILE
:
case
MRB_TT_DATA
:
case
MRB_TT_STRING
:
case
MRB_TT_OBJECT
:
case
MRB_TT_CLASS
:
case
MRB_TT_MODULE
:
case
MRB_TT_ICLASS
:
case
MRB_TT_SCLASS
:
case
MRB_TT_PROC
:
case
MRB_TT_ARRAY
:
case
MRB_TT_HASH
:
case
MRB_TT_RANGE
:
case
MRB_TT_EXCEPTION
:
case
MRB_TT_FILE
:
case
MRB_TT_DATA
:
default:
return
MakeID
(
mrb_ptr
(
obj
));
}
...
...
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