Browse Source

numparam, entry_type, #3/5, drop unused 'NUPA_POINTER'

'NUPA_POINTER' is nowhere assigned to storage
  thus 'nupa_type' variables can never have this value
pre-master-46
rlar 9 years ago
parent
commit
b7b6d9ace3
  1. 3
      src/frontend/numparam/numparam.h
  2. 10
      src/frontend/numparam/xpressn.c

3
src/frontend/numparam/numparam.h

@ -23,7 +23,6 @@ struct nupa_type;
extern const struct nupa_type S_nupa_real;
extern const struct nupa_type S_nupa_string;
extern const struct nupa_type S_nupa_pointer;
extern const struct nupa_type S_nupa_subckt;
extern const struct nupa_type S_nupa_space;
extern const struct nupa_type S_nupa_unknown;
@ -31,7 +30,6 @@ extern const struct nupa_type S_nupa_model;
#define NUPA_REAL (&S_nupa_real)
#define NUPA_STRING (&S_nupa_string)
#define NUPA_POINTER (&S_nupa_pointer)
#define NUPA_SUBCKT (&S_nupa_subckt)
#define NUPA_SPACE (&S_nupa_space)
#define NUPA_UNKNOWN (&S_nupa_unknown)
@ -47,7 +45,6 @@ typedef struct entry_s {
double vl; /* float value if defined */
int ivl; /* int value or string buffer index */
char *sbbase; /* string buffer base address if any */
struct entry_s *pointer; /* pointer chain */
} entry_t;

10
src/frontend/numparam/xpressn.c

@ -407,9 +407,6 @@ fetchnumentry(dico_t *dico, char *s, bool *perr)
{
entry_t *entry = entrynb(dico, s);
while (entry && (entry->tp == NUPA_POINTER))
entry = entry->pointer;
if (entry && (entry->tp == NUPA_REAL))
return entry->vl;
@ -496,9 +493,6 @@ nupa_define(dico_t *dico,
if (!entry)
return message(dico, " Symbol table overflow\n");
if (entry->tp == NUPA_POINTER)
entry = entry->pointer; /* pointer indirection */
if (entry)
c = entry->tp;
else
@ -1129,9 +1123,6 @@ evaluate(dico_t *dico, SPICE_DSTRINGPTR qstr_p, char *t, unsigned char mode)
entry = entrynb(dico, t);
nolookup = !entry;
while (entry && (entry->tp == NUPA_POINTER))
entry = entry->pointer; /* follow pointer chain */
if (!entry)
return message(dico,
"\"%s\" not evaluated.%s\n", t,
@ -1787,7 +1778,6 @@ struct nupa_type { /* used as a type-checked enum */
const struct nupa_type S_nupa_real = { "NUPA_REAL" };
const struct nupa_type S_nupa_string = { "NUPA_STRING" };
const struct nupa_type S_nupa_pointer = { "NUPA_POINTER" };
const struct nupa_type S_nupa_subckt = { "NUPA_SUBCKT" };
const struct nupa_type S_nupa_unknown = { "NUPA_UNKNOWN" };
const struct nupa_type S_nupa_model = { "NUPA_MODEL" };

Loading…
Cancel
Save