From b7b6d9ace304178f713d6d079f9205664f66e3c7 Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 4 Nov 2017 11:00:54 +0100 Subject: [PATCH] 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 --- src/frontend/numparam/numparam.h | 3 --- src/frontend/numparam/xpressn.c | 10 ---------- 2 files changed, 13 deletions(-) diff --git a/src/frontend/numparam/numparam.h b/src/frontend/numparam/numparam.h index 618e210d8..ad62af74f 100644 --- a/src/frontend/numparam/numparam.h +++ b/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; diff --git a/src/frontend/numparam/xpressn.c b/src/frontend/numparam/xpressn.c index 20430e022..14a902504 100644 --- a/src/frontend/numparam/xpressn.c +++ b/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" };