1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/date] Suppress -Wchar-subscripts warnings by Cygwin gcc 9.3.0

https://github.com/ruby/date/commit/9968eb69f0
This commit is contained in:
Nobuyoshi Nakada 2020-04-14 14:49:48 +09:00
parent e667750364
commit 7a85d31c29
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -70,7 +70,7 @@ static size_t
digit_span(const char *s, const char *e)
{
size_t i = 0;
while (s + i < e && isdigit(s[i])) i++;
while (s + i < e && isdigit((unsigned char)s[i])) i++;
return i;
}
@ -110,7 +110,7 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
s = RSTRING_PTR(y);
ep = RSTRING_END(y);
while (s < ep && !issign(*s) && !isdigit(*s))
while (s < ep && !issign(*s) && !isdigit((unsigned char)*s))
s++;
if (s >= ep) goto no_date;
bp = s;
@ -162,7 +162,7 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
s = RSTRING_PTR(y);
ep = RSTRING_END(y);
while (s < ep && !issign(*s) && !isdigit(*s))
while (s < ep && !issign(*s) && !isdigit((unsigned char)*s))
s++;
if (s >= ep) goto no_year;
bp = s;
@ -199,7 +199,7 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
s = RSTRING_PTR(m);
ep = RSTRING_END(m);
while (s < ep && !isdigit(*s))
while (s < ep && !isdigit((unsigned char)*s))
s++;
if (s >= ep) goto no_month;
bp = s;
@ -225,7 +225,7 @@ s3e(VALUE hash, VALUE y, VALUE m, VALUE d, int bc)
s = RSTRING_PTR(d);
ep = RSTRING_END(d);
while (s < ep && !isdigit(*s))
while (s < ep && !isdigit((unsigned char)*s))
s++;
if (s >= ep) goto no_mday;
bp = s;
@ -364,9 +364,9 @@ static int
str_end_with_word(const char *s, long l, const char *w)
{
int n = (int)strlen(w);
if (l <= n || !isspace(s[l - n - 1])) return 0;
if (l <= n || !isspace((unsigned char)s[l - n - 1])) return 0;
if (strncasecmp(&s[l - n], w, n)) return 0;
do ++n; while (l > n && isspace(s[l - n - 1]));
do ++n; while (l > n && isspace((unsigned char)s[l - n - 1]));
return n;
}
@ -376,7 +376,7 @@ shrunk_size(const char *s, long l)
long i, ni;
int sp = 0;
for (i = ni = 0; i < l; ++i) {
if (!isspace(s[i])) {
if (!isspace((unsigned char)s[i])) {
if (sp) ni++;
sp = 0;
ni++;
@ -394,7 +394,7 @@ shrink_space(char *d, const char *s, long l)
long i, ni;
int sp = 0;
for (i = ni = 0; i < l; ++i) {
if (!isspace(s[i])) {
if (!isspace((unsigned char)s[i])) {
if (sp) d[ni++] = ' ';
sp = 0;
d[ni++] = s[i];
@ -754,8 +754,8 @@ check_year_width(VALUE y)
l = RSTRING_LEN(y);
if (l < 2) return 0;
s = RSTRING_PTR(y);
if (!isdigit(s[1])) return 0;
return (l == 2 || !isdigit(s[2]));
if (!isdigit((unsigned char)s[1])) return 0;
return (l == 2 || !isdigit((unsigned char)s[2]));
}
static int