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
e6a582a6
Commit
e6a582a6
authored
Sep 12, 2012
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #466 from iij/pr-signed-char
two more wrapper macros for ctype.h
parents
54101eec
32b88c72
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
include/mruby.h
include/mruby.h
+2
-0
src/string.c
src/string.c
+4
-4
No files found.
include/mruby.h
View file @
e6a582a6
...
...
@@ -274,6 +274,8 @@ mrb_value mrb_check_funcall(mrb_state *mrb, mrb_value recv, mrb_sym mid, int arg
#define ISALPHA(c) (ISASCII(c) && isalpha((int)(unsigned char)(c)))
#define ISDIGIT(c) (ISASCII(c) && isdigit((int)(unsigned char)(c)))
#define ISXDIGIT(c) (ISASCII(c) && isxdigit((int)(unsigned char)(c)))
#define TOUPPER(c) (ISASCII(c) ? toupper((int)(unsigned char)(c)) : (c))
#define TOLOWER(c) (ISASCII(c) ? tolower((int)(unsigned char)(c)) : (c))
#endif
mrb_value
mrb_exc_new
(
mrb_state
*
mrb
,
struct
RClass
*
c
,
const
char
*
ptr
,
long
len
);
...
...
src/string.c
View file @
e6a582a6
...
...
@@ -866,12 +866,12 @@ mrb_str_capitalize_bang(mrb_state *mrb, mrb_value str)
if
(
s
->
len
==
0
||
!
s
->
ptr
)
return
mrb_nil_value
();
p
=
s
->
ptr
;
pend
=
s
->
ptr
+
s
->
len
;
if
(
ISLOWER
(
*
p
))
{
*
p
=
toupper
(
*
p
);
*
p
=
TOUPPER
(
*
p
);
modify
=
1
;
}
while
(
++
p
<
pend
)
{
if
(
ISUPPER
(
*
p
))
{
*
p
=
tolower
(
*
p
);
*
p
=
TOLOWER
(
*
p
);
modify
=
1
;
}
}
...
...
@@ -1079,7 +1079,7 @@ mrb_str_downcase_bang(mrb_state *mrb, mrb_value str)
pend
=
s
->
ptr
+
s
->
len
;
while
(
p
<
pend
)
{
if
(
ISUPPER
(
*
p
))
{
*
p
=
tolower
(
*
p
);
*
p
=
TOLOWER
(
*
p
);
modify
=
1
;
}
p
++
;
...
...
@@ -2744,7 +2744,7 @@ mrb_str_upcase_bang(mrb_state *mrb, mrb_value str)
pend
=
RSTRING_END
(
str
);
while
(
p
<
pend
)
{
if
(
ISLOWER
(
*
p
))
{
*
p
=
toupper
(
*
p
);
*
p
=
TOUPPER
(
*
p
);
modify
=
1
;
}
p
++
;
...
...
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