Ignore GCC -Wchar-subscripts

This commit is contained in:
Luke Street 2020-10-21 00:27:46 -04:00
parent 532d3dcafb
commit 3d2da99c69
1 changed files with 14 additions and 0 deletions

View File

@ -768,9 +768,16 @@ jt_read_integer (const char ** strptr, JDIMENSION * result)
const char * ptr = *strptr; const char * ptr = *strptr;
JDIMENSION val = 0; JDIMENSION val = 0;
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wchar-subscripts"
#endif
for (; isdigit(*ptr); ptr++) { for (; isdigit(*ptr); ptr++) {
val = val * 10 + (JDIMENSION) (*ptr - '0'); val = val * 10 + (JDIMENSION) (*ptr - '0');
} }
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
*result = val; *result = val;
if (ptr == *strptr) if (ptr == *strptr)
return FALSE; /* oops, no digits */ return FALSE; /* oops, no digits */
@ -801,7 +808,14 @@ jtransform_parse_crop_spec (jpeg_transform_info *info, const char *spec)
info->crop_xoffset_set = JCROP_UNSET; info->crop_xoffset_set = JCROP_UNSET;
info->crop_yoffset_set = JCROP_UNSET; info->crop_yoffset_set = JCROP_UNSET;
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wchar-subscripts"
#endif
if (isdigit(*spec)) { if (isdigit(*spec)) {
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
/* fetch width */ /* fetch width */
if (! jt_read_integer(&spec, &info->crop_width)) if (! jt_read_integer(&spec, &info->crop_width))
return FALSE; return FALSE;