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
d599e35a
Commit
d599e35a
authored
Aug 04, 2019
by
KOBAYASHI Shuji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `mrb_int()` instead of `to_int()` in `mruby-numeric-ext`
parent
f6c41c18
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
10 deletions
+3
-10
mrbgems/mruby-numeric-ext/src/numeric_ext.c
mrbgems/mruby-numeric-ext/src/numeric_ext.c
+3
-10
No files found.
mrbgems/mruby-numeric-ext/src/numeric_ext.c
View file @
d599e35a
#include <limits.h>
#include <mruby.h>
static
inline
mrb_int
to_int
(
mrb_state
*
mrb
,
mrb_value
x
)
{
x
=
mrb_to_int
(
mrb
,
x
);
return
mrb_fixnum
(
x
);
}
/*
* call-seq:
* int.allbits?(mask) -> true or false
...
...
@@ -20,7 +13,7 @@ mrb_int_allbits(mrb_state *mrb, mrb_value self)
mrb_int
n
,
m
;
mrb_get_args
(
mrb
,
"i"
,
&
m
);
n
=
to
_int
(
mrb
,
self
);
n
=
mrb
_int
(
mrb
,
self
);
return
mrb_bool_value
((
n
&
m
)
==
m
);
}
...
...
@@ -36,7 +29,7 @@ mrb_int_anybits(mrb_state *mrb, mrb_value self)
mrb_int
n
,
m
;
mrb_get_args
(
mrb
,
"i"
,
&
m
);
n
=
to
_int
(
mrb
,
self
);
n
=
mrb
_int
(
mrb
,
self
);
return
mrb_bool_value
((
n
&
m
)
!=
0
);
}
...
...
@@ -52,7 +45,7 @@ mrb_int_nobits(mrb_state *mrb, mrb_value self)
mrb_int
n
,
m
;
mrb_get_args
(
mrb
,
"i"
,
&
m
);
n
=
to
_int
(
mrb
,
self
);
n
=
mrb
_int
(
mrb
,
self
);
return
mrb_bool_value
((
n
&
m
)
==
0
);
}
...
...
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