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
b43e790b
Commit
b43e790b
authored
Jun 14, 2012
by
Masaki Muranaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused functions.
parent
73d7000b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
49 deletions
+0
-49
src/compar.c
src/compar.c
+0
-35
src/range.c
src/range.c
+0
-14
No files found.
src/compar.c
View file @
b43e790b
...
@@ -5,41 +5,6 @@
...
@@ -5,41 +5,6 @@
*/
*/
#include "mruby.h"
#include "mruby.h"
#include "mruby/string.h"
#include "mruby/numeric.h"
void
mrb_cmperr
(
mrb_state
*
mrb
,
mrb_value
x
,
mrb_value
y
)
{
const
char
*
classname
;
if
(
SPECIAL_CONST_P
(
y
))
{
y
=
mrb_inspect
(
mrb
,
y
);
classname
=
mrb_string_value_ptr
(
mrb
,
y
);
}
else
{
classname
=
mrb_obj_classname
(
mrb
,
y
);
}
mrb_raise
(
mrb
,
E_ARGUMENT_ERROR
,
"comparison of %s with %s failed"
,
mrb_obj_classname
(
mrb
,
x
),
classname
);
}
int
mrb_cmpint
(
mrb_state
*
mrb
,
mrb_value
val
,
mrb_value
a
,
mrb_value
b
)
{
if
(
mrb_nil_p
(
val
))
{
mrb_cmperr
(
mrb
,
a
,
b
);
}
if
(
FIXNUM_P
(
val
))
{
long
l
=
mrb_fixnum
(
val
);
if
(
l
>
0
)
return
1
;
if
(
l
<
0
)
return
-
1
;
return
0
;
}
if
(
mrb_test
(
mrb_funcall
(
mrb
,
val
,
">"
,
1
,
mrb_fixnum_value
(
0
))))
return
1
;
if
(
mrb_test
(
mrb_funcall
(
mrb
,
val
,
"<"
,
1
,
mrb_fixnum_value
(
0
))))
return
-
1
;
return
0
;
}
void
void
mrb_init_comparable
(
mrb_state
*
mrb
)
mrb_init_comparable
(
mrb_state
*
mrb
)
...
...
src/range.c
View file @
b43e790b
...
@@ -201,11 +201,6 @@ r_le(mrb_state *mrb, mrb_value a, mrb_value b)
...
@@ -201,11 +201,6 @@ r_le(mrb_state *mrb, mrb_value a, mrb_value b)
if
(
mrb_nil_p
(
r
))
return
FALSE
;
if
(
mrb_nil_p
(
r
))
return
FALSE
;
/* mrb_value -> int */
//c = mrb_cmpint(mrb, r, a, b);
//if (c == 0) return TRUE;
//if (c < 0) return TRUE;
//return FALSE;
if
(
mrb_obj_equal
(
mrb
,
r
,
mrb_fixnum_value
(
0
)))
return
TRUE
;
if
(
mrb_obj_equal
(
mrb
,
r
,
mrb_fixnum_value
(
0
)))
return
TRUE
;
if
(
mrb_obj_equal
(
mrb
,
r
,
mrb_fixnum_value
(
-
1
)))
return
TRUE
;
if
(
mrb_obj_equal
(
mrb
,
r
,
mrb_fixnum_value
(
-
1
)))
return
TRUE
;
return
FALSE
;
return
FALSE
;
...
@@ -220,10 +215,6 @@ r_gt(mrb_state *mrb, mrb_value a, mrb_value b)
...
@@ -220,10 +215,6 @@ r_gt(mrb_state *mrb, mrb_value a, mrb_value b)
if
(
mrb_nil_p
(
r
))
return
FALSE
;
if
(
mrb_nil_p
(
r
))
return
FALSE
;
/* mrb_value -> int */
//c = mrb_cmpint(mrb, r);
//if (c > 0) return TRUE;
//return FALSE;
if
(
mrb_obj_equal
(
mrb
,
r
,
mrb_fixnum_value
(
1
)))
return
TRUE
;
if
(
mrb_obj_equal
(
mrb
,
r
,
mrb_fixnum_value
(
1
)))
return
TRUE
;
return
FALSE
;
return
FALSE
;
}
}
...
@@ -237,11 +228,6 @@ r_ge(mrb_state *mrb, mrb_value a, mrb_value b)
...
@@ -237,11 +228,6 @@ r_ge(mrb_state *mrb, mrb_value a, mrb_value b)
if
(
mrb_nil_p
(
r
))
return
FALSE
;
if
(
mrb_nil_p
(
r
))
return
FALSE
;
/* mrb_value -> int */
//c = mrb_cmpint(mrb, r);
//if (c == 0) return TRUE;
//if (c > 0) return TRUE;
//return FALSE;
if
(
mrb_obj_equal
(
mrb
,
r
,
mrb_fixnum_value
(
0
)))
return
TRUE
;
if
(
mrb_obj_equal
(
mrb
,
r
,
mrb_fixnum_value
(
0
)))
return
TRUE
;
if
(
mrb_obj_equal
(
mrb
,
r
,
mrb_fixnum_value
(
1
)))
return
TRUE
;
if
(
mrb_obj_equal
(
mrb
,
r
,
mrb_fixnum_value
(
1
)))
return
TRUE
;
return
FALSE
;
return
FALSE
;
...
...
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