For UNICODE use char in comparison to ' '
only as unsigned char
This commit is contained in:
parent
531c229b0e
commit
85142709fc
|
|
@ -81,7 +81,7 @@ stripsomespace(DSTRINGPTR dstr_p, bool incontrol)
|
||||||
char *s = ds_get_buf(dstr_p);
|
char *s = ds_get_buf(dstr_p);
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (s[i] && (s[i] <= ' '))
|
while (s[i] && ((unsigned char)s[i] <= ' '))
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
if ((i > 0) && s[i] && strchr(markers, s[i]))
|
if ((i > 0) && s[i] && strchr(markers, s[i]))
|
||||||
|
|
@ -116,7 +116,7 @@ stripbraces(DSTRINGPTR dstr_p)
|
||||||
|
|
||||||
pscopy(&tstr, s, brace);
|
pscopy(&tstr, s, brace);
|
||||||
|
|
||||||
if (brace[-1] > ' ')
|
if ((unsigned char)brace[-1] > ' ')
|
||||||
cadd(&tstr, ' ');
|
cadd(&tstr, ' ');
|
||||||
|
|
||||||
cadd(&tstr, ' ');
|
cadd(&tstr, ' ');
|
||||||
|
|
@ -127,7 +127,7 @@ stripbraces(DSTRINGPTR dstr_p)
|
||||||
}
|
}
|
||||||
cadd(&tstr, ' ');
|
cadd(&tstr, ' ');
|
||||||
|
|
||||||
if (*j_ptr >= ' ')
|
if ((unsigned char)(* j_ptr) >= ' ')
|
||||||
cadd(&tstr, ' ');
|
cadd(&tstr, ' ');
|
||||||
|
|
||||||
int ilen = (int) ds_get_length(&tstr);
|
int ilen = (int) ds_get_length(&tstr);
|
||||||
|
|
|
||||||
|
|
@ -509,15 +509,15 @@ defsubckt(dico_t *dico, const struct card *card)
|
||||||
while (*s && (*s != '.'))
|
while (*s && (*s != '.'))
|
||||||
s++; /* skip 1st dotword */
|
s++; /* skip 1st dotword */
|
||||||
|
|
||||||
while (*s && (*s > ' '))
|
while (*s && ((unsigned char) (*s) > ' '))
|
||||||
s++;
|
s++;
|
||||||
|
|
||||||
while (*s && (*s <= ' '))
|
while (*s && ((unsigned char) (*s) <= ' '))
|
||||||
s++; /* skip blank */
|
s++; /* skip blank */
|
||||||
|
|
||||||
s_end = s;
|
s_end = s;
|
||||||
|
|
||||||
while (*s_end && (*s_end > ' '))
|
while (*s_end && ((unsigned char) (*s_end) > ' '))
|
||||||
s_end++;
|
s_end++;
|
||||||
|
|
||||||
if (s_end > s) {
|
if (s_end > s) {
|
||||||
|
|
@ -574,7 +574,7 @@ keyword(const char *keys, const char *s, const char *s_end)
|
||||||
const char *p = s;
|
const char *p = s;
|
||||||
while ((p < s_end) && (*p == *keys))
|
while ((p < s_end) && (*p == *keys))
|
||||||
p++, keys++;
|
p++, keys++;
|
||||||
if ((p >= s_end) && (*keys <= ' '))
|
if ((p >= s_end) && ((unsigned char) (*keys) <= ' '))
|
||||||
return j;
|
return j;
|
||||||
keys = strchr(keys, ' ');
|
keys = strchr(keys, ' ');
|
||||||
if (!keys)
|
if (!keys)
|
||||||
|
|
@ -723,7 +723,7 @@ fetchoperator(dico_t *dico,
|
||||||
level = 8;
|
level = 8;
|
||||||
} else {
|
} else {
|
||||||
state = S_init;
|
state = S_init;
|
||||||
if (c > ' ')
|
if ((unsigned char) c > ' ')
|
||||||
error = message(dico, "Syntax error: letter [%c]\n", c);
|
error = message(dico, "Syntax error: letter [%c]\n", c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -859,7 +859,7 @@ formula(dico_t *dico, const char *s, const char *s_end, bool *perror)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* trim trailing whitespace */
|
/* trim trailing whitespace */
|
||||||
while ((s_end > s) && (s_end[-1] <= ' '))
|
while ((s_end > s) && ((unsigned char) (s_end[-1]) <= ' '))
|
||||||
s_end--;
|
s_end--;
|
||||||
|
|
||||||
state = S_init;
|
state = S_init;
|
||||||
|
|
@ -1222,7 +1222,7 @@ getexpress(nupa_type *type, DSTRINGPTR tstr_p, const char *s)
|
||||||
const char *p;
|
const char *p;
|
||||||
nupa_type tpe;
|
nupa_type tpe;
|
||||||
|
|
||||||
while ((s < s_end - 1) && (*s <= ' '))
|
while ((s < s_end - 1) && ((unsigned char)(* s) <= ' '))
|
||||||
s++; /*white space ? */
|
s++; /*white space ? */
|
||||||
|
|
||||||
if (*s == '"') { /* string constant */
|
if (*s == '"') { /* string constant */
|
||||||
|
|
@ -1235,7 +1235,7 @@ getexpress(nupa_type *type, DSTRINGPTR tstr_p, const char *s)
|
||||||
|
|
||||||
do
|
do
|
||||||
p++;
|
p++;
|
||||||
while ((p < s_end) && (*p <= ' '));
|
while ((p < s_end) && ((unsigned char)(*p) <= ' '));
|
||||||
|
|
||||||
tpe = NUPA_STRING;
|
tpe = NUPA_STRING;
|
||||||
|
|
||||||
|
|
@ -1309,11 +1309,11 @@ nupa_assignment(dico_t *dico, const char *s, char mode)
|
||||||
DS_CREATE(tstr, 200); /* temporary dstrings */
|
DS_CREATE(tstr, 200); /* temporary dstrings */
|
||||||
DS_CREATE(ustr, 200);
|
DS_CREATE(ustr, 200);
|
||||||
|
|
||||||
while ((p < s_end) && (*p <= ' '))
|
while ((p < s_end) && ((unsigned char) (*p) <= ' '))
|
||||||
p++;
|
p++;
|
||||||
|
|
||||||
if (*p == '.') /* skip any dot keyword */
|
if (*p == '.') /* skip any dot keyword */
|
||||||
while (*p > ' ')
|
while ((unsigned char) (*p) > ' ')
|
||||||
p++;
|
p++;
|
||||||
|
|
||||||
while (p < s_end) {
|
while (p < s_end) {
|
||||||
|
|
@ -1509,7 +1509,7 @@ nupa_subcktcall(dico_t *dico, const char *s, const char *x,
|
||||||
jp = getexpress(NULL, &ustr, jp);
|
jp = getexpress(NULL, &ustr, jp);
|
||||||
} else {
|
} else {
|
||||||
jp++;
|
jp++;
|
||||||
if (*kp > ' ')
|
if ((unsigned char) (*kp) > ' ')
|
||||||
message(dico, "Subckt call, symbol %c not understood\n", *kp);
|
message(dico, "Subckt call, symbol %c not understood\n", *kp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue