char *p = optarg + 1;
if (*optarg == '#') x_mode = BY_INDEX;
else x_mode = BY_SIZE;
- if (isdigit(*p)) {
+ if (isdigit((int)*p)) {
x_index = (int)strtol (p, &endp, 10);
printMode = EXTRACT;
if (*endp == '-') {
p = endp + 1;
- if (isdigit(*p)) {
+ if (isdigit((int)*p)) {
x_final = atoi (p);
if (x_final < x_index) {
printMode = INTERNAL;
sizeof(fake), colorcmpf);
}
if (last == NULL) {
- if (!isdigit(canon[0])) {
+ if (!isdigit((int)canon[0])) {
fprintf(stderr, "warning: %s is not a known color\n", str);
strcpy(buf, str);
} else
{
if (*name++ != '%')
return 0;
- while (isdigit(*name))
+ while (isdigit((int)*name))
name++; /* skip over digits */
return (*name == '\0');
}
char* ep = s;
strtod(s, &ep);
if (s != ep) {
- while (*ep && isspace(*ep)) ep++;
+ while (*ep && isspace((int)*ep)) ep++;
if (*ep) return 0;
else return 1;
}
static char*
skipWS (char* s)
{
- while (isspace(*s)) s++;
+ while (isspace((int)*s)) s++;
return s;
}
{
if (*name++ != '%')
return 0;
- while (isdigit(*name))
+ while (isdigit((int)*name))
name++; /* skip over digits */
return (*name == '\0');
}
(isspace(c) ||
(((flags & FMT_SHELL) || shell) &&
(strchr("\";~&|()<>[]*?", c) ||
- (c == '#' && (b == f || isspace(*(b - 1)))
+ (c == '#' && (b == f || isspace((int)*(b - 1)))
)
)
)
(void)mbgetchar(p);
range = oldp;
} else
- if ((isalpha(*oldp) && isalpha(*olds)
+ if ((isalpha((int)*oldp) && isalpha((int)*olds)
&& tolower(*oldp) == tolower(*olds))
|| sc == mbgetchar(oldp))
ok = 1;
char* s;
int len;
Level = 0; /* re-initialize tab level */
- if ((s = agget(g, "linelength")) && isdigit(*s)) {
+ if ((s = agget(g, "linelength")) && isdigit((int)*s)) {
len = (int)strtol(s, (char **)NULL, 10);
if (len == 0 || len >= MIN_OUTPUTLINE)
Max_outputline = len;
switch (arg[1]) {
case 'v':
gvc->common.verbose = 1;
- if (isdigit(arg[2]))
+ if (isdigit((int)arg[2]))
gvc->common.verbose = atoi(&arg[2]);
break;
case 'O' :
const char *str = sstr;
while (*str)
- if (!isdigit(*str++))
+ if (!isdigit((int)*str++))
return false;
return true;
}
const char *s;
for (s = lp->text; *s; s++) {
- if (!isspace(*s))
+ if (!isspace((int)*s))
break;
}
if (*s == '\0')
int token;
char c;
- while (*p && (isspace(*p) || *p == ','))
+ while (*p && (isspace((int)*p) || *p == ','))
p++;
switch (*p) {
case '\0':
return TRUE;
if (!strcasecmp(p, "yes"))
return TRUE;
- if (isdigit(*p))
+ if (isdigit((int)*p))
return atoi(p);
else
return dflt;
s++;
if (*s == 'x' || *s == 'X') {
s++;
- while (isxdigit(*s))
+ while (isxdigit((int)*s))
s++;
} else {
- while (isdigit(*s))
+ while (isdigit((int)*s))
s++;
}
} else {
if (p->linewrap)
{
t = p->linep + 1;
- while (t < &p->line[sizeof(p->line)] && isspace(*t))
+ while (t < &p->line[sizeof(p->line)] && isspace((int)*t))
t++;
if ((n = (sizeof(p->line) - (t - (p->linep + 1))) - (e - s)) > 0)
{
t = p->line;
if (p->linewrap)
p->linewrap = 0;
- else while (t < p->linep && isspace(*t))
+ else while (t < p->linep && isspace((int)*t))
t++;
if ((n = (p->linep - t) - (e - s)) > 0)
t += n;
{
if (streqn(txt, "identifier", txt_len))
{
- if (*s && !isalpha(*s))
+ if (*s && !isalpha((int)*s))
*s++ = '_';
for (; *s; s++)
- if (!isalnum(*s))
+ if (!isalnum((int)*s))
*s = '_';
}
else if (streqn(txt, "invert", txt_len))
{
for (; *s; s++)
- if (isupper(*s))
+ if (isupper((int)*s))
*s = (char)tolower(*s);
- else if (islower(*s))
+ else if (islower((int)*s))
*s = (char)toupper(*s);
}
else if (streqn(txt, "lower", txt_len))
{
for (; *s; s++)
- if (isupper(*s))
+ if (isupper((int)*s))
*s = (char)tolower(*s);
}
else if (streqn(txt, "upper", txt_len))
{
for (; *s; s++)
- if (islower(*s))
+ if (islower((int)*s))
*s = (char)toupper(*s);
}
else if (streqn(txt, "variable", txt_len))
{
for (; *s; s++)
- if (!isalnum(*s) && *s != '_')
+ if (!isalnum((int)*s) && *s != '_')
*s = '.';
}
}
{
size_t k;
for (k = 0; yytname[i][k] != '\0'; ++k) {
- if (yytname[i][k] != '_' && !isalnum(yytname[i][k])) {
+ if (yytname[i][k] != '_' && !isalnum((int)yytname[i][k])) {
break;
}
}
if (!ex->linewrap && !(ex->disc->flags & EX_PURE))
{
s = ex->linep - 1;
- while (s > ex->line && isspace(*(s - 1)))
+ while (s > ex->line && isspace((int)*(s - 1)))
s--;
if (s == ex->line)
{
ovlp = DFLT_overlap;
}
/* look for optional ":" or "number:" */
- if ((cp = strchr(ovlp, ':')) && (cp == ovlp || isdigit(*ovlp))) {
+ if ((cp = strchr(ovlp, ':')) && (cp == ovlp || isdigit((int)*ovlp))) {
cp++;
rest = cp;
tries = atoi (ovlp);
#else
// does this filename have a version?
- if (len == 0 || !isdigit(filepath[len - 1])) {
+ if (len == 0 || !isdigit((int)filepath[len - 1])) {
return false;
}
- while (len > 0 && isdigit(filepath[len - 1])) {
+ while (len > 0 && isdigit((int)filepath[len - 1])) {
--len;
}
return false;
}
#elif defined(__MINGW32__) || defined(__CYGWIN__)
- if (len < 2 || isdigit(filepath[len - 2]) || filepath[len - 1] != '-') {
+ if (len < 2 || isdigit((int)filepath[len - 2]) || filepath[len - 1] != '-') {
return false;
}
#elif defined(_WIN32)
- if (len < 1 || isdigit(filepath[len - 1])) {
+ if (len < 1 || isdigit((int)filepath[len - 1])) {
return false;
}
#elif ((defined(__hpux__) || defined(__hpux)) && !(defined(__ia64)))
}
// check this really is the result of %.02f printing
- assert(isdigit(dotp[1]) && isdigit(dotp[2]) && dotp[3] == '\0');
+ assert(isdigit((int)dotp[1]) && isdigit((int)dotp[2]) && dotp[3] == '\0');
if (dotp[2] == '0') {
if (dotp[1] == '0') {
char c;
char q = '\0'; /* if non-0, in quote mode with quote char q */
- while (isspace(*rs))
+ while (isspace((int)*rs))
rs++;
if ((c = *rs) == '\0')
return NULL;
int i;
float x, y;
- while (isspace(*s)) s++;
+ while (isspace((int)*s)) s++;
if (*s == '+') {
s++;
pp->doAdd = 1;
pp++;
n--;
}
- while (isspace(*pos)) pos++;
+ while (isspace((int)*pos)) pos++;
if (*pos == '\0')
more = 0;
else
if (!sym) return dflt;
s = agxget (g, sym);
- if (isdigit(*s)) {
+ if (isdigit((int)*s)) {
#if (defined(HAVE_GTS) || defined(HAVE_TRIANGLE))
if ((v = atoi (s)) <= SMOOTHING_RNG)
#else
else
rv = dflt;
}
- else if (isalpha(*s)) {
+ else if (isalpha((int)*s)) {
if (!strcasecmp(s, "avg_dist"))
rv = SMOOTHING_STRESS_MAJORIZATION_AVG_DIST;
else if (!strcasecmp(s, "graph_dist"))
if (!sym) return dflt;
s = agxget (g, sym);
- if (isdigit(*s)) {
+ if (isdigit((int)*s)) {
if ((v = atoi (s)) <= QUAD_TREE_FAST && v >= QUAD_TREE_NONE){
rv = v;
} else {
rv = dflt;
}
- } else if (isalpha(*s)) {
+ } else if (isalpha((int)*s)) {
if (!strcasecmp(s, "none") || !strcasecmp(s, "false") ){
rv = QUAD_TREE_NONE;
} else if (!strcasecmp(s, "normal") || !strcasecmp(s, "true") || !strcasecmp(s, "yes")){
static char *sffmtint(const char *str, int *v)
{
- for (*v = 0; isdigit(*str); ++str)
+ for (*v = 0; isdigit((int)*str); ++str)
*v = *v * 10 + (*str - '0');
*v -= 1;
return (char *) str;
case '.':
if ((dot += 1) == 2)
base = 0; /* for %s,%c */
- if (isdigit(*form)) {
+ if (isdigit((int)*form)) {
fmt = *form++;
goto dot_size;
} else if (*form != '*')
case 'I': /* object length */
size = 0;
flags = (flags & ~SFFMT_TYPES) | SFFMT_IFLAG;
- if (isdigit(*form)) {
+ if (isdigit((int)*form)) {
for (n = *form; isdigit(n); n = *++form)
size = size * 10 + (n - '0');
} else if (*form == '*') {
base = 0; /* for %s,%c */
if (*form == 'c' || *form == 's')
goto loop_flags;
- if (*form && !isalnum(*form) &&
+ if (*form && !isalnum((int)*form) &&
(form[1] == 'c' || form[1] == 's')) {
if (*form == '*')
goto do_star;
}
}
- if (isdigit(*form)) {
+ if (isdigit((int)*form)) {
fmt = *form++;
goto dot_size;
} else if (*form != '*')
case '8':
case '9':
dot_size:
- for (v = fmt - '0'; isdigit(*form); ++form)
+ for (v = fmt - '0'; isdigit((int)*form); ++form)
v = v * 10 + (*form - '0');
if (*form == '$') {
form += 1;
case 'I': /* object length */
size = 0;
flags = (flags & ~SFFMT_TYPES) | SFFMT_IFLAG;
- if (isdigit(*form)) {
+ if (isdigit((int)*form)) {
for (n = *form; isdigit(n); n = *++form)
size = size * 10 + (n - '0');
} else if (*form == '*') {
}
e_format: /* build the x.yyyy string */
- if (isalpha(*ep))
+ if (isalpha((int)*ep))
goto infinite;
sp = endsp = buf + 1; /* reserve space for sign */
*endsp++ = *ep ? *ep++ : '0';
goto end_efg;
f_format: /* data before the decimal point */
- if (isalpha(*ep)) {
+ if (isalpha((int)*ep)) {
infinite:
endsp = (sp = ep) + sfslen();
ep = endep;
case '.': /* width & base */
dot += 1;
- if (isdigit(*form)) {
+ if (isdigit((int)*form)) {
fmt = *form++;
goto dot_size;
} else if (*form == '*') {
case '8':
case '9':
dot_size:
- for (v = fmt - '0'; isdigit(*form); ++form)
+ for (v = fmt - '0'; isdigit((int)*form); ++form)
v = v * 10 + (*form - '0');
if (*form == '$') {
case 'I': /* object size */
size = 0;
flags = (flags & ~SFFMT_TYPES) | SFFMT_IFLAG;
- if (isdigit(*form)) {
+ if (isdigit((int)*form)) {
for (n = *form; isdigit(n); n = *++form)
size = size * 10 + (n - '0');
} else if (*form == '*') {
xdot_color clr;
*error = 0;
- while (isspace(*s))
+ while (isspace((int)*s))
s++;
switch (*s++) {
case 'E':