Browse Source

frontend/variable.c, used `isalnum()' instead of homegrown `isalphanum()'

pre-master-46
rlar 10 years ago
parent
commit
07aba2e2ae
  1. 4
      src/frontend/variable.c
  2. 1
      src/include/ngspice/macros.h

4
src/frontend/variable.c

@ -678,7 +678,7 @@ span_var_expr(char *t)
int parenthesis = 0; int parenthesis = 0;
int brackets = 0; int brackets = 0;
while (*t && (isalphanum(*t) || strchr(VALIDCHARS, *t)))
while (*t && (isalnum(*t) || strchr(VALIDCHARS, *t)))
switch (*t++) switch (*t++)
{ {
case '[': case '[':
@ -879,7 +879,7 @@ vareval(char *string)
char *t = ++range; char *t = ++range;
if (*t == '&') if (*t == '&')
t++; t++;
while (isalphanum(*t))
while (isalnum(*t))
t++; t++;
*t = '\0'; *t = '\0';
r = vareval(range); r = vareval(range);

1
src/include/ngspice/macros.h

@ -24,7 +24,6 @@
#define eq(a,b) (!strcmp((a), (b))) #define eq(a,b) (!strcmp((a), (b)))
#define eqc(a,b) (cieq((a), (b))) #define eqc(a,b) (cieq((a), (b)))
#define isalphanum(c) (isalpha(c) || isdigit(c))
#define hexnum(c) ((((c) >= '0') && ((c) <= '9')) ? ((c) - '0') : ((((c) >= \ #define hexnum(c) ((((c) >= '0') && ((c) <= '9')) ? ((c) - '0') : ((((c) >= \
'a') && ((c) <= 'f')) ? ((c) - 'a' + 10) : ((((c) >= 'A') && \ 'a') && ((c) <= 'f')) ? ((c) - 'a' + 10) : ((((c) >= 'A') && \
((c) <= 'F')) ? ((c) - 'A' + 10) : 0))) ((c) <= 'F')) ? ((c) - 'A' + 10) : 0)))

Loading…
Cancel
Save