Changeset: aa37e37ca914 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=aa37e37ca914
Modified Files:
clients/mapiclient/ReadlineTools.c
clients/mapiclient/eventparser.c
clients/mapiclient/mhelp.c
clients/mapiclient/tomograph.c
clients/mapilib/mapi.c
clients/odbc/driver/ODBCConvert.c
clients/odbc/driver/ODBCUtil.c
common/options/monet_options.c
common/utils/mutils.c
common/utils/strptime.c
gdk/gdk.h
monetdb5/mal/mal_client.c
monetdb5/mal/mal_debugger.c
monetdb5/mal/mal_parser.c
monetdb5/mal/mal_profiler.c
monetdb5/mal/mal_readline.c
monetdb5/mal/mal_type.c
monetdb5/modules/atoms/url.c
monetdb5/modules/mal/inspect.c
monetdb5/modules/mal/remote.c
monetdb5/modules/mal/txtsim.c
sql/backends/monet5/sql.c
sql/backends/monet5/sql_execute.c
sql/backends/monet5/sql_gencode.c
sql/backends/monet5/sql_result.c
sql/backends/monet5/sql_statistics.c
sql/backends/monet5/vaults/bam/bam_export.c
sql/common/sql_string.c
sql/server/rel_dump.c
sql/server/sql_decimal.c
testing/difflib.c
testing/helpers.h
Branch: default
Log Message:
Use correct cast for ctype functions.
A single cast to (unsigned char) suffices, but is also usually
required.
diffs (truncated from 1144 to 300 lines):
diff --git a/clients/mapiclient/ReadlineTools.c
b/clients/mapiclient/ReadlineTools.c
--- a/clients/mapiclient/ReadlineTools.c
+++ b/clients/mapiclient/ReadlineTools.c
@@ -177,9 +177,9 @@ mal_help(int cnt, int key)
(void) key;
c = rl_line_buffer + strlen(rl_line_buffer) - 1;
- while (c > rl_line_buffer && isspace(*c))
+ while (c > rl_line_buffer && isspace((unsigned char) *c))
c--;
- while (c > rl_line_buffer && !isspace(*c))
+ while (c > rl_line_buffer && !isspace((unsigned char) *c))
c--;
if ((buf = malloc(strlen(c) + 20)) == NULL)
return 0;
@@ -221,7 +221,7 @@ mal_command_generator(const char *text,
/* we pick our own portion of the linebuffer */
text = rl_line_buffer + strlen(rl_line_buffer) - 1;
- while (text > rl_line_buffer && !isspace((int) *text))
+ while (text > rl_line_buffer && !isspace((unsigned char) *text))
text--;
if (!state) {
idx = 0;
@@ -245,7 +245,7 @@ mal_command_generator(const char *text,
c = strstr(text, ":=");
if (c)
text = c + 2;
- while (isspace((int) *text))
+ while (isspace((unsigned char) *text))
text++;
if ((buf = malloc(strlen(text) + 32)) == NULL)
return NULL;
diff --git a/clients/mapiclient/eventparser.c b/clients/mapiclient/eventparser.c
--- a/clients/mapiclient/eventparser.c
+++ b/clients/mapiclient/eventparser.c
@@ -202,7 +202,7 @@ keyvalueparser(char *txt, EventRecord *e
*c++ = 0;
skipto(':');
c++;
- while( *c && isspace((int)*c)) c++;
+ while( *c && isspace((unsigned char) *c)) c++;
if( *c == '"'){
val = ++c;
skipstr();
@@ -508,7 +508,7 @@ lineparser(char *row, EventRecord *ev)
*c=':';
ev->fcn = c + 2;
/* find genuine function calls */
- while (isspace((int) *ev->fcn) && *ev->fcn)
+ while (isspace((unsigned char) *ev->fcn) && *ev->fcn)
ev->fcn++;
if (strchr(ev->fcn, '.') == 0)
ev->fcn = 0;
diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c
--- a/clients/mapiclient/mhelp.c
+++ b/clients/mapiclient/mhelp.c
@@ -761,7 +761,7 @@ sql_grammar_rule(const char *word, strea
{
char buf[65], *s = buf;
int i;
- while (s < buf + 64 && *word != ',' && *word && !isspace((int) *word))
+ while (s < buf + 64 && *word != ',' && *word && !isspace((unsigned
char) *word))
*s++ = *word++;
*s = 0;
@@ -770,9 +770,9 @@ sql_grammar_rule(const char *word, strea
mnstr_printf(toConsole, "%s : %s\n", buf,
sqlhelp[i].syntax);
}
}
- while (*word && (isalnum((int) *word || *word == '_')))
+ while (*word && (isalnum((unsigned char) *word || *word == '_')))
word++;
- while (*word && isspace((int) *word))
+ while (*word && isspace((unsigned char) *word))
word++;
return *word == ',' ? word + 1 : NULL;
}
@@ -828,10 +828,10 @@ sql_help(char *pattern, stream *toConsol
if (*pattern == '\\')
pattern++;
- while (*pattern && !isspace((int) *pattern)) {
+ while (*pattern && !isspace((unsigned char) *pattern)) {
pattern++;
}
- while (*pattern && isspace((int) *pattern)) {
+ while (*pattern && isspace((unsigned char) *pattern)) {
pattern++;
}
@@ -851,7 +851,7 @@ sql_help(char *pattern, stream *toConsol
}
// collect the major topics
for (i = 0; sqlhelp[i].command; i++) {
- if (islower((int) sqlhelp[i].command[0]) && *pattern != '*')
+ if (islower((unsigned char) sqlhelp[i].command[0]) && *pattern
!= '*')
break;
total++;
if ((len = strlen(sqlhelp[i].command)) > maxlen)
diff --git a/clients/mapiclient/tomograph.c b/clients/mapiclient/tomograph.c
--- a/clients/mapiclient/tomograph.c
+++ b/clients/mapiclient/tomograph.c
@@ -856,7 +856,7 @@ showcpu(void)
s = box[i].stmt +1;
while (s) {
s = strchr(s + 1, ' ');
- while (s && isspace((int) *s))
+ while (s && isspace((unsigned char) *s))
s++;
if( s){
cpuload[j++] = atof(s);
@@ -1423,11 +1423,11 @@ update(char *line, EventRecord *ev)
if( (s= ev->stmt,'['))
s++;
else s = ev->stmt;
- while (s && isspace((int) *s))
+ while (s && isspace((unsigned char) *s))
s++;
while (s) {
s = strchr(s + 1, ' ');
- while (s && isspace((int) *s))
+ while (s && isspace((unsigned char) *s))
s++;
if (s)
cpus++;
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -3591,7 +3591,7 @@ slice_row(const char *reply, char *null,
}
lens[i] = len;
anchors[i++] = start;
- while (reply && *reply && isspace((int) (unsigned char) *reply))
+ while (reply && *reply && isspace((unsigned char) *reply))
reply++;
} while (reply && *reply && *reply != endchar);
*anchorsp = anchors;
@@ -3814,7 +3814,7 @@ parse_header_line(MapiHdl hdl, char *lin
result->commentonly = 0;
tag = etag + 1;
- while (*tag && isspace((int) (unsigned char) *tag))
+ while (*tag && isspace((unsigned char) *tag))
tag++;
if (n > result->fieldcnt) {
@@ -4568,7 +4568,7 @@ unquote(const char *msg, char **str, con
char quote;
/* first skip over leading white space */
- while (*p && isspace((int) (unsigned char) *p))
+ while (*p && isspace((unsigned char) *p))
p++;
quote = *p;
if (quote == '\'' || quote == '"') {
@@ -4676,9 +4676,9 @@ unquote(const char *msg, char **str, con
while (*p && *p != ',' && *p != '\t' && *p != endchar)
p++;
/* search back over trailing white space */
- for (s = p - 1; s > msg && isspace((int) (unsigned char) *s);
s--)
+ for (s = p - 1; s > msg && isspace((unsigned char) *s); s--)
;
- if (s < msg || !isspace((int) (unsigned char) *s)) /* gone
one too far */
+ if (s < msg || !isspace((unsigned char) *s)) /* gone one too
far */
s++;
if (*p == ',' || *p == '\t') {
/* there is more to come; skip over separator */
@@ -4882,7 +4882,7 @@ store_field(struct MapiResultSet *result
unsigned int fac = 1000000000;
unsigned int nsec = 0;
- for (n++; isdigit((int) (unsigned char) val[n]); n++) {
+ for (n++; isdigit((unsigned char) val[n]); n++) {
fac /= 10;
nsec += (val[n] - '0') * fac;
}
diff --git a/clients/odbc/driver/ODBCConvert.c
b/clients/odbc/driver/ODBCConvert.c
--- a/clients/odbc/driver/ODBCConvert.c
+++ b/clients/odbc/driver/ODBCConvert.c
@@ -461,7 +461,7 @@ parseoptionalbracketednumber(char **sval
char *eptr;
long val;
- while (slen > 0 && isspace((int) *sval)) {
+ while (slen > 0 && isspace((unsigned char) *sval)) {
slen--;
sval++;
}
@@ -471,7 +471,7 @@ parseoptionalbracketednumber(char **sval
}
slen--;
sval++;
- while (slen > 0 && isspace((int) *sval)) {
+ while (slen > 0 && isspace((unsigned char) *sval)) {
slen--;
sval++;
}
@@ -493,14 +493,14 @@ parseoptionalbracketednumber(char **sval
slen -= (int) (eptr - sval);
sval = eptr;
*val1p = (int) val;
- while (slen > 0 && isspace((int) *sval)) {
+ while (slen > 0 && isspace((unsigned char) *sval)) {
slen--;
sval++;
}
if (val2p != NULL && slen > 0 && *sval == ',') {
slen--;
sval++;
- while (slen > 0 && isspace((int) *sval)) {
+ while (slen > 0 && isspace((unsigned char) *sval)) {
slen--;
sval++;
}
@@ -539,9 +539,9 @@ parsemonthintervalstring(char **svalp,
return SQL_ERROR;
sval += 8;
slen -= 8;
- if (slen == 0 || !isspace((int) *sval))
+ if (slen == 0 || !isspace((unsigned char) *sval))
return SQL_ERROR;
- while (slen > 0 && isspace((int) *sval)) {
+ while (slen > 0 && isspace((unsigned char) *sval)) {
slen--;
sval++;
}
@@ -571,14 +571,14 @@ parsemonthintervalstring(char **svalp,
leadingprecision = (SQLLEN) (eptr - sval);
slen -= leadingprecision;
sval = eptr;
- while (isspace((int) *sval)) {
+ while (isspace((unsigned char) *sval)) {
slen--;
sval++;
}
if (*sval == '-') {
slen--;
sval++;
- while (isspace((int) *sval)) {
+ while (isspace((unsigned char) *sval)) {
slen--;
sval++;
}
@@ -591,7 +591,7 @@ parsemonthintervalstring(char **svalp,
return SQL_ERROR;
slen -= (int) (eptr - sval);
sval = eptr;
- while (isspace((int) *sval)) {
+ while (isspace((unsigned char) *sval)) {
slen--;
sval++;
}
@@ -605,9 +605,9 @@ parsemonthintervalstring(char **svalp,
return SQL_ERROR;
slen--;
sval++;
- if (slen == 0 || !isspace((int) *sval))
+ if (slen == 0 || !isspace((unsigned char) *sval))
return SQL_ERROR;
- while (slen > 0 && isspace((int) *sval)) {
+ while (slen > 0 && isspace((unsigned char) *sval)) {
slen--;
sval++;
}
@@ -625,8 +625,8 @@ parsemonthintervalstring(char **svalp,
ival->intval.year_month.year = val1;
ival->intval.year_month.month = 0;
}
- if (slen > 0 && isspace((int) *sval)) {
- while (slen > 0 && isspace((int) *sval)) {
+ if (slen > 0 && isspace((unsigned char) *sval)) {
+ while (slen > 0 && isspace((unsigned char) *sval)) {
slen--;
sval++;
}
@@ -635,16 +635,16 @@ parsemonthintervalstring(char **svalp,
sval += 2;
if (val2 == -1)
return SQL_ERROR;
- if (slen == 0 || !isspace((int) *sval))
+ if (slen == 0 || !isspace((unsigned char)
*sval))
return SQL_ERROR;
- while (slen > 0 && isspace((int) *sval)) {
+ while (slen > 0 && isspace((unsigned char)
*sval)) {
slen--;
sval++;
}
if (slen >= 5 && strncasecmp(sval, "month", 5)
== 0) {
slen -= 5;
sval += 5;
- while (slen > 0 && isspace((int)
*sval)) {
+ while (slen > 0 && isspace((unsigned
char) *sval)) {
slen--;
sval++;
}
@@ -663,7 +663,7 @@ parsemonthintervalstring(char **svalp,
return SQL_ERROR;
if (leadingprecision > p)
return SQL_ERROR;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list