diff --git a/ext2spice/ext2hier.c b/ext2spice/ext2hier.c index e2204ae8..7b817c7c 100644 --- a/ext2spice/ext2hier.c +++ b/ext2spice/ext2hier.c @@ -1325,12 +1325,16 @@ spccapHierVisit( * * ---------------------------------------------------------------------------- */ + +/*ARGUSED*/ +/* @typedef cb_extflat_hiervisitresists_t (UNUSED) */ int spcresistHierVisit( HierContext *hc, - HierName *hierName1, - HierName *hierName2, - float res) + const HierName *hierName1, + const HierName *hierName2, + float res, + ClientData cdata) // UNUSED { HashEntry *he; EFNodeName *nn; @@ -2213,7 +2217,7 @@ esHierVisit( EFHierVisitDevs(hcf, spcdevHierVisit, PTR2CD(NULL)); /* Output lumped parasitic resistors */ - EFHierVisitResists(hcf, spcresistHierVisit, (ClientData)NULL); + EFHierVisitResists(hcf, spcresistHierVisit, PTR2CD(NULL)); /* Output coupling capacitances */ EFHierVisitCaps(hcf, spccapHierVisit, (ClientData)NULL); diff --git a/extflat/EFhier.c b/extflat/EFhier.c index 25e1abea..380ec3dc 100644 --- a/extflat/EFhier.c +++ b/extflat/EFhier.c @@ -559,13 +559,15 @@ efHierVisitSingleResist(hc, name1, name2, res, ca) * Visit all the resistors in the circuit. * For each resistor in the circuit, call the user-supplied procedure * (*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_hiervisitresists_t: * - * (*resProc)(hc, hn1, hn2, resistance, cdata) - * HierContext *hc; - * HierName *hn1, *hn2; - * int resistance; - * ClientData cdata; + * int (*resProc)( + * HierContext *hc, + * const HierName *hierName1, + * const HierName *hierName2, + * float resistance, + * ClientData cdata) * { * } * @@ -586,15 +588,15 @@ efHierVisitSingleResist(hc, name1, name2, res, ca) */ int -EFHierVisitResists(hc, resProc, cdata) - HierContext *hc; - int (*resProc)(); - ClientData cdata; +EFHierVisitResists( + HierContext *hc, + const cb_extflat_hiervisitresists_t resProc, + ClientData cdata) { CallArg ca; int efHierVisitResists(); /* Forward reference */ - ca.ca_proc = resProc; + ca.ca_proc = (int (*)()) resProc; ca.ca_cdata = cdata; return efHierVisitResists(hc, (ClientData) &ca); } @@ -630,7 +632,7 @@ efHierVisitResists(hc, ca) res, ca)) return 1; } - else if (efHierSrArray(hc, res, efHierVisitSingleResist, (ClientData) ca)) + else if (efHierSrArray(hc, res, efHierVisitSingleResist, PTR2CD(ca))) return 1; } return 0; diff --git a/extflat/extflat.h b/extflat/extflat.h index 6fd3ac81..a940ad48 100644 --- a/extflat/extflat.h +++ b/extflat/extflat.h @@ -130,7 +130,8 @@ extern int EFVisitSubcircuits(); extern int EFHierVisitSubcircuits(); typedef int (*cb_extflat_hiervisitdevs_t)(HierContext *hc, Dev *dev, float scale, ClientData cdata); extern int EFHierVisitDevs(HierContext *hc, const cb_extflat_hiervisitdevs_t devProc, ClientData cdata); -extern int EFHierVisitResists(); +typedef int (*cb_extflat_hiervisitresists_t)(HierContext *hc, const HierName *hierName1, const HierName *hierName2, float resistance, ClientData cdata); +extern int EFHierVisitResists(HierContext *hc, const cb_extflat_hiervisitresists_t resProc, ClientData cdata); extern int EFHierVisitCaps(); extern int EFHierVisitNodes();