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
d958aa2c
Commit
d958aa2c
authored
Aug 28, 2014
by
Tatsuhiko Kubo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unify duplicated functions (noregexp() and regexp_check()).
parent
c457aa21
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
18 deletions
+5
-18
include/mruby/string.h
include/mruby/string.h
+3
-0
mrbgems/mruby-string-utf8/src/string.c
mrbgems/mruby-string-utf8/src/string.c
+0
-15
src/string.c
src/string.c
+2
-3
No files found.
include/mruby/string.h
View file @
d958aa2c
...
@@ -107,6 +107,9 @@ mrb_int mrb_str_hash(mrb_state *mrb, mrb_value str);
...
@@ -107,6 +107,9 @@ mrb_int mrb_str_hash(mrb_state *mrb, mrb_value str);
mrb_value
mrb_str_dump
(
mrb_state
*
mrb
,
mrb_value
str
);
mrb_value
mrb_str_dump
(
mrb_state
*
mrb
,
mrb_value
str
);
mrb_value
mrb_str_inspect
(
mrb_state
*
mrb
,
mrb_value
str
);
mrb_value
mrb_str_inspect
(
mrb_state
*
mrb
,
mrb_value
str
);
void
noregexp
(
mrb_state
*
mrb
,
mrb_value
self
);
void
regexp_check
(
mrb_state
*
mrb
,
mrb_value
obj
);
/* For backward compatibility */
/* For backward compatibility */
#define mrb_str_cat2(mrb, str, ptr) mrb_str_cat_cstr(mrb, str, ptr)
#define mrb_str_cat2(mrb, str, ptr) mrb_str_cat_cstr(mrb, str, ptr)
#define mrb_str_buf_cat(mrb, str, ptr, len) mrb_str_cat(mrb, str, ptr, len)
#define mrb_str_buf_cat(mrb, str, ptr, len) mrb_str_cat(mrb, str, ptr, len)
...
...
mrbgems/mruby-string-utf8/src/string.c
View file @
d958aa2c
...
@@ -106,21 +106,6 @@ mrb_str_size(mrb_state *mrb, mrb_value str)
...
@@ -106,21 +106,6 @@ mrb_str_size(mrb_state *mrb, mrb_value str)
#define RSTRING_LEN_UTF8(s) mrb_utf8_strlen(s, -1)
#define RSTRING_LEN_UTF8(s) mrb_utf8_strlen(s, -1)
static
mrb_value
noregexp
(
mrb_state
*
mrb
,
mrb_value
self
)
{
mrb_raise
(
mrb
,
E_NOTIMP_ERROR
,
"Regexp class not implemented"
);
return
mrb_nil_value
();
}
static
void
regexp_check
(
mrb_state
*
mrb
,
mrb_value
obj
)
{
if
(
mrb_regexp_p
(
mrb
,
obj
))
{
noregexp
(
mrb
,
obj
);
}
}
static
inline
mrb_int
static
inline
mrb_int
mrb_memsearch_qs
(
const
unsigned
char
*
xs
,
mrb_int
m
,
const
unsigned
char
*
ys
,
mrb_int
n
)
mrb_memsearch_qs
(
const
unsigned
char
*
xs
,
mrb_int
m
,
const
unsigned
char
*
ys
,
mrb_int
n
)
{
{
...
...
src/string.c
View file @
d958aa2c
...
@@ -637,14 +637,13 @@ mrb_string_value_ptr(mrb_state *mrb, mrb_value ptr)
...
@@ -637,14 +637,13 @@ mrb_string_value_ptr(mrb_state *mrb, mrb_value ptr)
return
RSTRING_PTR
(
str
);
return
RSTRING_PTR
(
str
);
}
}
static
mrb_value
void
noregexp
(
mrb_state
*
mrb
,
mrb_value
self
)
noregexp
(
mrb_state
*
mrb
,
mrb_value
self
)
{
{
mrb_raise
(
mrb
,
E_NOTIMP_ERROR
,
"Regexp class not implemented"
);
mrb_raise
(
mrb
,
E_NOTIMP_ERROR
,
"Regexp class not implemented"
);
return
mrb_nil_value
();
}
}
static
void
void
regexp_check
(
mrb_state
*
mrb
,
mrb_value
obj
)
regexp_check
(
mrb_state
*
mrb
,
mrb_value
obj
)
{
{
if
(
mrb_regexp_p
(
mrb
,
obj
))
{
if
(
mrb_regexp_p
(
mrb
,
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