two more wrapper macros for ctype.h

we need them on the platform where 'char' is signed.
This commit is contained in:
Tomoyuki Sahara
2012-09-12 13:44:40 +09:00
parent 54101eec43
commit 32b88c72af
2 changed files with 6 additions and 4 deletions
+4 -4
View File
@@ -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++;