extflat: integrate cb_extflat_visitresists_t for EFVisitResists()
Additionally the HierName's hierName1 and hierName2 arguments have been made 'const' to help convey the receiver can not modify the referenced data passed.
This commit is contained in:
parent
0bb29ae5f8
commit
0141a99af5
|
|
@ -1122,7 +1122,7 @@ runexttospice:
|
||||||
if (flatFlags & EF_FLATCAPS)
|
if (flatFlags & EF_FLATCAPS)
|
||||||
EFVisitCaps(spccapVisit, (ClientData) NULL);
|
EFVisitCaps(spccapVisit, (ClientData) NULL);
|
||||||
|
|
||||||
EFVisitResists(spcresistVisit, (ClientData) NULL);
|
EFVisitResists(spcresistVisit, PTR2CD(NULL));
|
||||||
EFVisitSubcircuits(subcktVisit, (ClientData) NULL);
|
EFVisitSubcircuits(subcktVisit, (ClientData) NULL);
|
||||||
|
|
||||||
/* Visit nodes to find the substrate node */
|
/* Visit nodes to find the substrate node */
|
||||||
|
|
@ -1298,7 +1298,7 @@ main(
|
||||||
if (flatFlags & EF_FLATCAPS)
|
if (flatFlags & EF_FLATCAPS)
|
||||||
EFVisitCaps(spccapVisit, (ClientData) NULL);
|
EFVisitCaps(spccapVisit, (ClientData) NULL);
|
||||||
|
|
||||||
EFVisitResists(spcresistVisit, (ClientData) NULL);
|
EFVisitResists(spcresistVisit, PTR2CD(NULL));
|
||||||
EFVisitSubcircuits(subcktVisit, (ClientData) NULL);
|
EFVisitSubcircuits(subcktVisit, (ClientData) NULL);
|
||||||
esSpiceCapNode = StrDup((char **)NULL, esSpiceDefaultGnd);
|
esSpiceCapNode = StrDup((char **)NULL, esSpiceDefaultGnd);
|
||||||
EFVisitNodes(spcnodeVisit, (ClientData) NULL);
|
EFVisitNodes(spcnodeVisit, (ClientData) NULL);
|
||||||
|
|
@ -3653,11 +3653,12 @@ spccapVisit(
|
||||||
* ----------------------------------------------------------------------------
|
* ----------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* ARGSUSED */
|
||||||
/* @typedef cb_extflat_visitresists_t (UNUSED) */
|
/* @typedef cb_extflat_visitresists_t (UNUSED) */
|
||||||
int
|
int
|
||||||
spcresistVisit(
|
spcresistVisit(
|
||||||
HierName *hierName1,
|
const HierName *hierName1,
|
||||||
HierName *hierName2,
|
const HierName *hierName2,
|
||||||
float res,
|
float res,
|
||||||
ClientData cdata) /* unused */
|
ClientData cdata) /* unused */
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ extern int spccapVisit(HierName *hierName1, HierName *hierName2, double cap, Cli
|
||||||
extern int spcdevVisit(Dev *dev, HierContext *hc, float scale, Transform *trans, ClientData cdata); /* @typedef cb_extflat_visitdevs_t (UNUSED) */
|
extern int spcdevVisit(Dev *dev, HierContext *hc, float scale, Transform *trans, ClientData cdata); /* @typedef cb_extflat_visitdevs_t (UNUSED) */
|
||||||
extern int spcnodeVisit(EFNode *node, int res, double cap, ClientData cdata); /* @typedef cb_extflat_visitnodes_t (UNUSED) */
|
extern int spcnodeVisit(EFNode *node, int res, double cap, ClientData cdata); /* @typedef cb_extflat_visitnodes_t (UNUSED) */
|
||||||
extern int subcktVisit(Use *use, HierName *hierName, bool is_top); /* @typedef cb_extflat_visitsubcircuits_t */
|
extern int subcktVisit(Use *use, HierName *hierName, bool is_top); /* @typedef cb_extflat_visitsubcircuits_t */
|
||||||
extern int spcresistVisit(HierName *hierName1, HierName *hierName2, float res, ClientData cdata); /* @typedef cb_extflat_visitresists_t (UNUSED) */
|
extern int spcresistVisit(const HierName *hierName1, const HierName *hierName2, float res, ClientData cdata); /* @typedef cb_extflat_visitresists_t (UNUSED) */
|
||||||
extern int devMergeVisit(Dev *dev, HierContext *hc, float scale, Transform *trans, ClientData cdata); /* @typedef cb_extflat_visitdevs_t (UNUSED) */
|
extern int devMergeVisit(Dev *dev, HierContext *hc, float scale, Transform *trans, ClientData cdata); /* @typedef cb_extflat_visitdevs_t (UNUSED) */
|
||||||
extern int devDistJunctVisit(Dev *dev, HierContext *hc, float scale, Transform *trans, ClientData cdata); /* @typedef cb_extflat_visitdevs_t (UNUSED) */
|
extern int devDistJunctVisit(Dev *dev, HierContext *hc, float scale, Transform *trans, ClientData cdata); /* @typedef cb_extflat_visitdevs_t (UNUSED) */
|
||||||
extern int spcsubVisit(EFNode *node, int res, double cap, ClientData cdata); /* @typedef cb_extflat_visitnodes_t (char** resstr) */
|
extern int spcsubVisit(EFNode *node, int res, double cap, ClientData cdata); /* @typedef cb_extflat_visitnodes_t (char** resstr) */
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ int ecNumNodeResists;
|
||||||
int nodeVisit(EFNode *node, int res, double cap, ClientData cdata); /* @typedef cb_extflat_visitnodes_t (UNUSED) */
|
int nodeVisit(EFNode *node, int res, double cap, ClientData cdata); /* @typedef cb_extflat_visitnodes_t (UNUSED) */
|
||||||
int devVisit(Dev *dev, HierContext *hc, float scale, Transform *trans, ClientData cdata); /* @typedef cb_extflat_visitdevs_t (UNUSED) */
|
int devVisit(Dev *dev, HierContext *hc, float scale, Transform *trans, ClientData cdata); /* @typedef cb_extflat_visitdevs_t (UNUSED) */
|
||||||
int capVisit(HierName *hn1, HierName *hn2, double cap, ClientData cdata); /* @typedef cb_extflat_visitcaps_t (UNUSED) */
|
int capVisit(HierName *hn1, HierName *hn2, double cap, ClientData cdata); /* @typedef cb_extflat_visitcaps_t (UNUSED) */
|
||||||
int resistVisit(HierName *hn1, HierName *hn2, float res, ClientData cdata); /* @typedef cb_extflat_visitresists_t (UNUSED) */
|
int resistVisit(const HierName *hn1, const HierName *hn2, float res, ClientData cdata); /* @typedef cb_extflat_visitresists_t (UNUSED) */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ----------------------------------------------------------------------------
|
* ----------------------------------------------------------------------------
|
||||||
|
|
@ -89,7 +89,7 @@ main(int argc, char *argv[])
|
||||||
if (IS_FINITE_F(EFCapThreshold))
|
if (IS_FINITE_F(EFCapThreshold))
|
||||||
EFVisitCaps(capVisit, (ClientData) NULL);
|
EFVisitCaps(capVisit, (ClientData) NULL);
|
||||||
if (EFResistThreshold != INFINITE_THRESHOLD)
|
if (EFResistThreshold != INFINITE_THRESHOLD)
|
||||||
EFVisitResists(resistVisit, (ClientData) NULL);
|
EFVisitResists(resistVisit, PTR2CD(NULL));
|
||||||
EFVisitNodes(nodeVisit, (ClientData) NULL);
|
EFVisitNodes(nodeVisit, (ClientData) NULL);
|
||||||
|
|
||||||
#ifdef free_all_mem
|
#ifdef free_all_mem
|
||||||
|
|
@ -181,8 +181,8 @@ capVisit(
|
||||||
/* @typedef cb_extflat_visitresists_t (UNUSED) */
|
/* @typedef cb_extflat_visitresists_t (UNUSED) */
|
||||||
int
|
int
|
||||||
resistVisit(
|
resistVisit(
|
||||||
HierName *hn1,
|
const HierName *hn1,
|
||||||
HierName *hn2, /* UNUSED */
|
const HierName *hn2,/* UNUSED */
|
||||||
float res,
|
float res,
|
||||||
ClientData cdata) /* UNUSED */
|
ClientData cdata) /* UNUSED */
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -456,12 +456,14 @@ skip:
|
||||||
* Must be called after EFFlatBuild().
|
* Must be called after EFFlatBuild().
|
||||||
* For each resistor in the circuit, call the user-supplied procedure
|
* For each resistor in the circuit, call the user-supplied procedure
|
||||||
* (*resProc)(), which should be of the following form, where hn1 and
|
* (*resProc)(), which should be of the following form, where hn1 and
|
||||||
* hn2 are the HierNames of the two nodes connected by the resistor.
|
* hn2 are the HierNames of the two nodes connected by the resistor
|
||||||
|
* see also typedef cb_extflat_visitresists_t:
|
||||||
*
|
*
|
||||||
* (*resProc)(hn1, hn2, resistance, cdata)
|
* int (*resProc)(
|
||||||
* HierName *hn1, *hn2;
|
* const HierName *hn1,
|
||||||
* int resistance;
|
* const HierName *hn2,
|
||||||
* ClientData cdata;
|
* float resistance,
|
||||||
|
* ClientData cdata)
|
||||||
* {
|
* {
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
|
|
@ -482,15 +484,15 @@ skip:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
EFVisitResists(resProc, cdata)
|
EFVisitResists(
|
||||||
int (*resProc)();
|
const cb_extflat_visitresists_t resProc,
|
||||||
ClientData cdata;
|
ClientData cdata)
|
||||||
{
|
{
|
||||||
CallArg ca;
|
CallArg ca;
|
||||||
|
|
||||||
ca.ca_proc = resProc;
|
ca.ca_proc = (int (*)()) resProc;
|
||||||
ca.ca_cdata = cdata;
|
ca.ca_cdata = cdata;
|
||||||
return efVisitResists(&efFlatContext, (ClientData) &ca);
|
return efVisitResists(&efFlatContext, &ca);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -585,7 +587,7 @@ efVisitSingleResist(hc, name1, name2, res, ca)
|
||||||
|
|
||||||
return (*ca->ca_proc)(n1->efnode_name->efnn_hier,
|
return (*ca->ca_proc)(n1->efnode_name->efnn_hier,
|
||||||
n2->efnode_name->efnn_hier,
|
n2->efnode_name->efnn_hier,
|
||||||
res->conn_res, ca->ca_cdata);
|
res->conn_res, ca->ca_cdata); /* @invoke cb_extflat_visitresists_t */
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -118,8 +118,9 @@ typedef int (*cb_extflat_visitdevs_t)(Dev *dev, HierContext *hc, float scale, Tr
|
||||||
extern int EFVisitDevs(const cb_extflat_visitdevs_t devProc, ClientData cdata);
|
extern int EFVisitDevs(const cb_extflat_visitdevs_t devProc, ClientData cdata);
|
||||||
extern int efVisitDevs(HierContext *hc, CallArg *ca);
|
extern int efVisitDevs(HierContext *hc, CallArg *ca);
|
||||||
extern bool efSymLook();
|
extern bool efSymLook();
|
||||||
extern int efVisitResists();
|
extern int efVisitResists(HierContext *hc, CallArg *ca);
|
||||||
extern int EFVisitResists();
|
typedef int (*cb_extflat_visitresists_t)(const HierName *hn1, const HierName *hn2, float resistance, ClientData cdata);
|
||||||
|
extern int EFVisitResists(const cb_extflat_visitresists_t resProc, ClientData cdata);
|
||||||
extern int EFVisitNodes();
|
extern int EFVisitNodes();
|
||||||
extern int EFVisitCaps();
|
extern int EFVisitCaps();
|
||||||
extern void EFGetLengthAndWidth();
|
extern void EFGetLengthAndWidth();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue