mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
two more wrapper macros for ctype.h
we need them on the platform where 'char' is signed.
This commit is contained in:
+4
-4
@@ -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++;
|
||||
|
||||
Reference in New Issue
Block a user