diff --git a/src/ciderlib/oned/oneadmit.c b/src/ciderlib/oned/oneadmit.c index a8c7ea7b8..686e96a98 100644 --- a/src/ciderlib/oned/oneadmit.c +++ b/src/ciderlib/oned/oneadmit.c @@ -42,7 +42,7 @@ NUMDadmittance(ONEdevice *pDevice, double omega, SPcomplex *yd) double *solutionReal, *solutionImag; SPcomplex yAc_adm, cOmega; SPcomplex *y; - BOOLEAN SORFailed; + bool SORFailed; double startTime; @@ -191,7 +191,7 @@ NBJTadmittance(ONEdevice *pDevice, double omega, SPcomplex *yIeVce, int index, i; double area = pDevice->area; double *solutionReal, *solutionImag; - BOOLEAN SORFailed; + bool SORFailed; SPcomplex *y; SPcomplex cOmega, pIeVce, pIcVce, pIeVbe, pIcVbe; double startTime; @@ -425,7 +425,7 @@ NBJTadmittance(ONEdevice *pDevice, double omega, SPcomplex *yIeVce, return (AcAnalysisMethod); } -BOOLEAN +bool ONEsorSolve(ONEdevice *pDevice, double *xReal, double *xImag, double omega) { ONEnode *pNode; @@ -434,8 +434,8 @@ ONEsorSolve(ONEdevice *pDevice, double *xReal, double *xImag, double omega) double *rhsSOR = pDevice->rhsImag; int numEqns = pDevice->numEqns; int numNodes = pDevice->numNodes; - BOOLEAN SORConverged = FALSE; - BOOLEAN SORFailed = FALSE; + bool SORConverged = FALSE; + bool SORFailed = FALSE; int i, index, indexN, indexP, iterationNum; double dx; @@ -754,7 +754,7 @@ NBJTys(ONEdevice *pDevice, SPcomplex *s, SPcomplex *yIeVce, /* cOmega is the complex frequency */ SPcomplex * -computeAdmittance(ONEnode *pNode, BOOLEAN delVContact, double *xReal, +computeAdmittance(ONEnode *pNode, bool delVContact, double *xReal, double *xImag, SPcomplex *cOmega) { ONEnode *pHNode; diff --git a/src/ciderlib/oned/oneaval.c b/src/ciderlib/oned/oneaval.c index ba05eac3d..e7e3f5510 100644 --- a/src/ciderlib/oned/oneaval.c +++ b/src/ciderlib/oned/oneaval.c @@ -13,7 +13,7 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group #include "oneddefs.h" double -ONEavalanche(BOOLEAN rhsOnly, ONEdevice *pDevice, ONEnode *pNode) +ONEavalanche(bool rhsOnly, ONEdevice *pDevice, ONEnode *pNode) { ONEelem *pLElem, *pRElem; ONEedge *pLEdge, *pREdge; diff --git a/src/ciderlib/oned/onecond.c b/src/ciderlib/oned/onecond.c index bdf984f4a..4a35521d5 100644 --- a/src/ciderlib/oned/onecond.c +++ b/src/ciderlib/oned/onecond.c @@ -17,7 +17,7 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group #include "oneddefs.h" void -NUMDconductance(ONEdevice *pDevice, BOOLEAN tranAnalysis, +NUMDconductance(ONEdevice *pDevice, bool tranAnalysis, double *intCoeff, double *gd) { ONEelem *pElem = pDevice->elemArray[pDevice->numNodes - 1]; @@ -68,7 +68,7 @@ NUMDconductance(ONEdevice *pDevice, BOOLEAN tranAnalysis, } void -NBJTconductance(ONEdevice *pDevice, BOOLEAN tranAnalysis, double *intCoeff, +NBJTconductance(ONEdevice *pDevice, bool tranAnalysis, double *intCoeff, double *dIeDVce, double *dIcDVce, double *dIeDVbe, double *dIcDVbe) { ONEelem *pLastElem = pDevice->elemArray[pDevice->numNodes - 1]; @@ -180,7 +180,7 @@ NBJTconductance(ONEdevice *pDevice, BOOLEAN tranAnalysis, double *intCoeff, } void -NUMDcurrent(ONEdevice *pDevice, BOOLEAN tranAnalysis, double *intCoeff, +NUMDcurrent(ONEdevice *pDevice, bool tranAnalysis, double *intCoeff, double *id) { ONEnode *pNode; @@ -210,7 +210,7 @@ NUMDcurrent(ONEdevice *pDevice, BOOLEAN tranAnalysis, double *intCoeff, } void -NBJTcurrent(ONEdevice *pDevice, BOOLEAN tranAnalysis, double *intCoeff, +NBJTcurrent(ONEdevice *pDevice, bool tranAnalysis, double *intCoeff, double *ie, double *ic) { ONEnode *pNode; diff --git a/src/ciderlib/oned/onecont.c b/src/ciderlib/oned/onecont.c index 30e270df4..4660d8cf6 100644 --- a/src/ciderlib/oned/onecont.c +++ b/src/ciderlib/oned/onecont.c @@ -359,7 +359,7 @@ ONEbindCSC (ONEdevice *pDevice) #endif void -ONE_sysLoad(ONEdevice *pDevice, BOOLEAN tranAnalysis, +ONE_sysLoad(ONEdevice *pDevice, bool tranAnalysis, ONEtranInfo *info) { ONEelem *pElem; @@ -652,7 +652,7 @@ ONE_jacLoad(ONEdevice *pDevice) } void -ONE_rhsLoad(ONEdevice *pDevice, BOOLEAN tranAnalysis, +ONE_rhsLoad(ONEdevice *pDevice, bool tranAnalysis, ONEtranInfo *info) { ONEelem *pElem; @@ -766,8 +766,8 @@ ONE_rhsLoad(ONEdevice *pDevice, BOOLEAN tranAnalysis, } void -ONE_commonTerms(ONEdevice *pDevice, BOOLEAN currentOnly, - BOOLEAN tranAnalysis, ONEtranInfo *info) +ONE_commonTerms(ONEdevice *pDevice, bool currentOnly, + bool tranAnalysis, ONEtranInfo *info) { ONEelem *pElem; ONEedge *pEdge; diff --git a/src/ciderlib/oned/oneddefs.h b/src/ciderlib/oned/oneddefs.h index e8e93b156..1dba47811 100644 --- a/src/ciderlib/oned/oneddefs.h +++ b/src/ciderlib/oned/oneddefs.h @@ -7,10 +7,10 @@ /* Debug statements */ -extern BOOLEAN ONEacDebug; -extern BOOLEAN ONEdcDebug; -extern BOOLEAN ONEtranDebug; -extern BOOLEAN ONEjacDebug; +extern bool ONEacDebug; +extern bool ONEdcDebug; +extern bool ONEtranDebug; +extern bool ONEjacDebug; /* Now some defines for the one dimensional simulator * library. diff --git a/src/ciderlib/oned/onedext.h b/src/ciderlib/oned/onedext.h index 2edbf0e82..799d1f1cf 100644 --- a/src/ciderlib/oned/onedext.h +++ b/src/ciderlib/oned/onedext.h @@ -19,32 +19,32 @@ extern int NUMDadmittance(ONEdevice *, double, SPcomplex *); extern int NBJTadmittance(ONEdevice *, double, SPcomplex *, SPcomplex *, SPcomplex *, SPcomplex *); -extern BOOLEAN ONEsorSolve(ONEdevice *, double *, double *, double omega); +extern bool ONEsorSolve(ONEdevice *, double *, double *, double omega); extern void NUMDys(ONEdevice *, SPcomplex *, SPcomplex *); extern void NBJTys(ONEdevice *,SPcomplex *, SPcomplex *, SPcomplex *, SPcomplex *, SPcomplex *); -extern SPcomplex *computeAdmittance(ONEnode *, BOOLEAN, double *xReal, +extern SPcomplex *computeAdmittance(ONEnode *, bool, double *xReal, double *,SPcomplex *); /* oneaval.c */ -extern double ONEavalanche(BOOLEAN, ONEdevice *, ONEnode *); +extern double ONEavalanche(bool, ONEdevice *, ONEnode *); /* onecond.c */ -extern void NUMDconductance(ONEdevice *, BOOLEAN, double *, double *); -extern void NBJTconductance(ONEdevice *, BOOLEAN, double *, double *, +extern void NUMDconductance(ONEdevice *, bool, double *, double *); +extern void NBJTconductance(ONEdevice *, bool, double *, double *, double *, double *, double *); -extern void NUMDcurrent(ONEdevice *, BOOLEAN, double *, double *); -extern void NBJTcurrent(ONEdevice *, BOOLEAN, double *, double *, +extern void NUMDcurrent(ONEdevice *, bool, double *, double *); +extern void NBJTcurrent(ONEdevice *, bool, double *, double *, double *); /* onecont */ extern void ONE_jacBuild(ONEdevice *); -extern void ONE_sysLoad(ONEdevice *, BOOLEAN, ONEtranInfo *); +extern void ONE_sysLoad(ONEdevice *, bool, ONEtranInfo *); extern void ONE_jacLoad(ONEdevice *); -extern void ONE_rhsLoad(ONEdevice *, BOOLEAN, ONEtranInfo *); -extern void ONE_commonTerms(ONEdevice *, BOOLEAN, BOOLEAN, ONEtranInfo *); +extern void ONE_rhsLoad(ONEdevice *, bool, ONEtranInfo *); +extern void ONE_commonTerms(ONEdevice *, bool, bool, ONEtranInfo *); /* onedest */ @@ -76,7 +76,7 @@ extern void ONEQrhsLoad(ONEdevice *); extern void ONEQcommonTerms(ONEdevice *); /*oneprint.c */ -extern void ONEprnSolution(FILE *, ONEdevice *, OUTPcard *, BOOLEAN, char *); +extern void ONEprnSolution(FILE *, ONEdevice *, OUTPcard *, bool, char *); extern void ONEmemStats(FILE *, ONEdevice *); extern void ONEcpuStats(FILE *f, ONEdevice *); @@ -84,8 +84,8 @@ extern void ONEcpuStats(FILE *f, ONEdevice *); /* oneproj.c */ extern void NUMDproject(ONEdevice *, double); extern void NBJTproject(ONEdevice *, double, double, double); -extern void NUMDupdate(ONEdevice *,double, BOOLEAN); -extern void NBJTupdate(ONEdevice *, double, double, double, BOOLEAN); +extern void NUMDupdate(ONEdevice *,double, bool); +extern void NBJTupdate(ONEdevice *, double, double, double, bool); extern void NUMDsetBCs(ONEdevice *, double); extern void NBJTsetBCs(ONEdevice *, double, double); @@ -98,22 +98,22 @@ extern void ONEsetBCparams(ONEdevice *, BDRYcard *, CONTcard *); extern void ONEnormalize(ONEdevice *); /* onesolve.c */ -extern void ONEdcSolve(ONEdevice *, int, BOOLEAN, BOOLEAN, ONEtranInfo *); -extern BOOLEAN ONEpsiDeltaConverged(ONEdevice *, int *); -extern BOOLEAN ONEdeltaConverged(ONEdevice *); +extern void ONEdcSolve(ONEdevice *, int, bool, bool, ONEtranInfo *); +extern bool ONEpsiDeltaConverged(ONEdevice *, int *); +extern bool ONEdeltaConverged(ONEdevice *); extern void ONEresetJacobian(ONEdevice *); extern void ONEstoreNeutralGuess(ONEdevice *); extern void ONEequilSolve(ONEdevice *); -extern void ONEbiasSolve(ONEdevice *, int, BOOLEAN, ONEtranInfo *); +extern void ONEbiasSolve(ONEdevice *, int, bool, ONEtranInfo *); extern void ONEstoreEquilibGuess(ONEdevice *); extern void ONEstoreInitialGuess(ONEdevice *); -extern int ONEnewDelta(ONEdevice *, BOOLEAN, ONEtranInfo *); +extern int ONEnewDelta(ONEdevice *, bool, ONEtranInfo *); extern double ONEtrunc(ONEdevice *, ONEtranInfo *, double); extern void ONEsaveState(ONEdevice *); extern double ONEnuNorm(ONEdevice *); -extern void ONEjacCheck(ONEdevice *, BOOLEAN, ONEtranInfo *); +extern void ONEjacCheck(ONEdevice *, bool, ONEtranInfo *); extern void ONEpredict(ONEdevice *, ONEtranInfo *); -extern BOOLEAN ONEdeviceConverged(ONEdevice *); +extern bool ONEdeviceConverged(ONEdevice *); #ifdef KLU void ONEbindCSC (ONEdevice *) ; diff --git a/src/ciderlib/oned/onedopng.c b/src/ciderlib/oned/onedopng.c index ab0fc4ca9..4fc5799b9 100644 --- a/src/ciderlib/oned/onedopng.c +++ b/src/ciderlib/oned/onedopng.c @@ -113,7 +113,7 @@ ONEsetDoping(ONEdevice *pDevice, DOPprofile *pProfile, DOPtable *pTable) DOPprofile *pP; double conc; int index, eIndex; - BOOLEAN dopeMe; + bool dopeMe; /* Clear doping info for all nodes. */ diff --git a/src/ciderlib/oned/onemesh.c b/src/ciderlib/oned/onemesh.c index 45f8fc911..9df6bda6c 100644 --- a/src/ciderlib/oned/onemesh.c +++ b/src/ciderlib/oned/onemesh.c @@ -32,7 +32,7 @@ ONEbuildMesh(ONEdevice *pDevice, ONEcoord *pCoord, ONEdomain *pDomain, int poiEqn, numEqn; ONEedge *pEdge; ONEnode **nodeArray=NULL; - BOOLEAN error = FALSE; + bool error = FALSE; /* generate the work array for setting up nodes and elements */ @@ -292,8 +292,8 @@ NBJTjunctions(ONEdevice *pDevice, int *indexEB, int *indexBC) { int index; double conc1, conc2; - BOOLEAN findFirstJunction = TRUE; - BOOLEAN notFound = TRUE; + bool findFirstJunction = TRUE; + bool notFound = TRUE; for (index = 1; (index < pDevice->numNodes) && (notFound); index++) { conc1 = pDevice->elemArray[index]->pNodes[0]->netConc; diff --git a/src/ciderlib/oned/oneprint.c b/src/ciderlib/oned/oneprint.c index 7e7ae33f8..ba9cdd253 100644 --- a/src/ciderlib/oned/oneprint.c +++ b/src/ciderlib/oned/oneprint.c @@ -19,7 +19,7 @@ Author: 1992 David A. Gates, U. C. Berkeley CAD Group void -ONEprnSolution(FILE *file, ONEdevice *pDevice, OUTPcard *output, BOOLEAN asciiSave, char *extra) +ONEprnSolution(FILE *file, ONEdevice *pDevice, OUTPcard *output, bool asciiSave, char *extra) { int index, i, ii; int numVars = 0; diff --git a/src/ciderlib/oned/oneproj.c b/src/ciderlib/oned/oneproj.c index 7e21d7bf1..ef1fb89ff 100644 --- a/src/ciderlib/oned/oneproj.c +++ b/src/ciderlib/oned/oneproj.c @@ -235,7 +235,7 @@ NBJTproject(ONEdevice *pDevice, double delVce, double delVbe, /* functions to update device states for full-LU algorithm */ void -NUMDupdate(ONEdevice *pDevice, double delV, BOOLEAN updateBoundary) +NUMDupdate(ONEdevice *pDevice, double delV, bool updateBoundary) { ONEelem *pElem = pDevice->elemArray[pDevice->numNodes - 1]; ONEnode *pNode; @@ -269,7 +269,7 @@ NUMDupdate(ONEdevice *pDevice, double delV, BOOLEAN updateBoundary) void NBJTupdate(ONEdevice *pDevice, double delVce, double delVbe, - double vbe, BOOLEAN updateBoundary) + double vbe, bool updateBoundary) { ONEelem *pLastElem = pDevice->elemArray[pDevice->numNodes - 1]; ONEelem *pBaseElem = pDevice->elemArray[pDevice->baseIndex - 1]; diff --git a/src/ciderlib/oned/onesolve.c b/src/ciderlib/oned/onesolve.c index 3f082392c..8ed114793 100644 --- a/src/ciderlib/oned/onesolve.c +++ b/src/ciderlib/oned/onesolve.c @@ -31,16 +31,16 @@ extern IFfrontEnd *SPfrontEnd; /* The iteration driving loop and convergence check */ void -ONEdcSolve(ONEdevice *pDevice, int iterationLimit, BOOLEAN newSolver, - BOOLEAN tranAnalysis, ONEtranInfo *info) +ONEdcSolve(ONEdevice *pDevice, int iterationLimit, bool newSolver, + bool tranAnalysis, ONEtranInfo *info) { ONEnode *pNode; ONEelem *pElem; int index, eIndex, error; int timesConverged = 0, negConc = FALSE; int size = pDevice->numEqns; - BOOLEAN quitLoop; - BOOLEAN debug = FALSE; + bool quitLoop; + bool debug = FALSE; double *rhs = pDevice->rhs; /* double *intermediate = pDevice->copiedSolution; */ double *solution = pDevice->dcSolution; @@ -295,7 +295,7 @@ ONEdcSolve(ONEdevice *pDevice, int iterationLimit, BOOLEAN newSolver, * Fermi levels. In theory, this should work better than the one currently * being used since we are always looking at potentials: (psi, phin, phip). */ -BOOLEAN +bool ONEpsiDeltaConverged(ONEdevice *pDevice, int *pNegConc) { int index, nIndex, eIndex; @@ -304,7 +304,7 @@ ONEpsiDeltaConverged(ONEdevice *pDevice, int *pNegConc) double xOld, xNew, xDelta, tol; double psi, newPsi, nConc, pConc, newN, newP; double phiN, phiP, newPhiN, newPhiP; - BOOLEAN converged = TRUE; + bool converged = TRUE; /* Equilibrium solution. */ if (pDevice->poissonOnly) { @@ -378,11 +378,11 @@ done: /* * See if the update to the solution is small enough. Returns TRUE if it is. */ -BOOLEAN +bool ONEdeltaConverged(ONEdevice *pDevice) { int index; - BOOLEAN converged = TRUE; + bool converged = TRUE; double *solution = pDevice->dcSolution; double *delta = pDevice->dcDeltaSolution; double xOld, xNew, tol; @@ -404,11 +404,11 @@ ONEdeltaConverged(ONEdevice *pDevice) * See if the update to the solution is small enough and the solution is * physically reasonable. Returns TRUE if it is. */ -BOOLEAN +bool ONEdeviceConverged(ONEdevice *pDevice) { int index, eIndex; - BOOLEAN converged = TRUE; + bool converged = TRUE; double *solution = pDevice->dcSolution; ONEnode *pNode; ONEelem *pElem; @@ -553,7 +553,7 @@ ONEstoreNeutralGuess(ONEdevice *pDevice) void ONEequilSolve(ONEdevice *pDevice) { - BOOLEAN newSolver = FALSE; + bool newSolver = FALSE; int error; int nIndex, eIndex; ONEelem *pElem; @@ -707,9 +707,9 @@ ONEequilSolve(ONEdevice *pDevice) */ void ONEbiasSolve(ONEdevice *pDevice, int iterationLimit, - BOOLEAN tranAnalysis, ONEtranInfo *info) + bool tranAnalysis, ONEtranInfo *info) { - BOOLEAN newSolver = FALSE; + bool newSolver = FALSE; int error; int index, eIndex; double *solution; @@ -950,11 +950,11 @@ ONEstoreInitialGuess(ONEdevice *pDevice) int -ONEnewDelta(ONEdevice *pDevice, BOOLEAN tranAnalysis, ONEtranInfo *info) +ONEnewDelta(ONEdevice *pDevice, bool tranAnalysis, ONEtranInfo *info) { int index, iterNum; double newNorm, fib, lambda, fibn, fibp; - BOOLEAN acceptable = FALSE, error = FALSE; + bool acceptable = FALSE, error = FALSE; iterNum = 0; lambda = 1.0; fibn = 1.0; @@ -1172,7 +1172,7 @@ ONEnuNorm(ONEdevice *pDevice) * models are being incorporated. */ void -ONEjacCheck(ONEdevice *pDevice, BOOLEAN tranAnalysis, ONEtranInfo *info) +ONEjacCheck(ONEdevice *pDevice, bool tranAnalysis, ONEtranInfo *info) { int index, rIndex; double del, diff, tol, *dptr; diff --git a/src/ciderlib/support/misc.c b/src/ciderlib/support/misc.c index 3ef34ec17..6a4f12320 100644 --- a/src/ciderlib/support/misc.c +++ b/src/ciderlib/support/misc.c @@ -20,7 +20,7 @@ Author: 1992 David A. Gates, U. C. Berkeley CAD Group /* Used in Solution Projection Calculations */ double guessNewConc(double conc, double delta) { - BOOLEAN acceptable = FALSE; + bool acceptable = FALSE; double fib, newConc, lambda, fibn, fibp; lambda = 1.0; fibn = 1.0; @@ -64,7 +64,7 @@ double lookup(double **dataTable, double x) double lnconc, lny0, lny1; #endif int index, numPoints; - BOOLEAN done = FALSE; + bool done = FALSE; numPoints = (int)dataTable[ 0 ][ 0 ]; for( index = 2; index <= numPoints && (!done); index++ ) { @@ -104,10 +104,10 @@ double lookup(double **dataTable, double x) /* Used in admittance calculations */ /* this function returns TRUE is SOR iteration converges otherwise FALSE */ -BOOLEAN hasSORConverged(double *oldSolution, double *newSolution, +bool hasSORConverged(double *oldSolution, double *newSolution, int numEqns) { - BOOLEAN converged = TRUE; + bool converged = TRUE; int index; double xOld, xNew, tol; double absTol = 1e-12; @@ -126,10 +126,10 @@ BOOLEAN hasSORConverged(double *oldSolution, double *newSolution, } /* Used to Check Sparse Matrix Errors */ -BOOLEAN +bool foundError(int error) { - BOOLEAN matrixError; + bool matrixError; switch( error ) { /* Removed for Spice3e1 Compatibility @@ -164,7 +164,7 @@ foundError(int error) } /* Return TRUE if the filetype variable matches the string 's' */ -BOOLEAN compareFiletypeVar(char *s) +bool compareFiletypeVar(char *s) { char buf[BSIZE_SP]; diff --git a/src/ciderlib/twod/twoadmit.c b/src/ciderlib/twod/twoadmit.c index 1c2fbc193..8f3a4e1b5 100644 --- a/src/ciderlib/twod/twoadmit.c +++ b/src/ciderlib/twod/twoadmit.c @@ -38,8 +38,8 @@ NUMD2admittance(TWOdevice *pDevice, double omega, SPcomplex *yd) double *solnReal, *solnImag; double *rhsReal, *rhsImag; SPcomplex yAc, cOmega, *y; - BOOLEAN deltaVContact = FALSE; - BOOLEAN SORFailed; + bool deltaVContact = FALSE; + bool SORFailed; double startTime; /* Each time we call this counts as one AC iteration. */ @@ -186,7 +186,7 @@ NBJT2admittance(TWOdevice *pDevice, double omega, SPcomplex *yIeVce, double dxdy; double *solnReal, *solnImag; double *rhsReal, *rhsImag; - BOOLEAN SORFailed; + bool SORFailed; SPcomplex *y; SPcomplex pIeVce, pIcVce, pIeVbe, pIcVbe; SPcomplex cOmega; @@ -412,7 +412,7 @@ NUMOSadmittance(TWOdevice *pDevice, double omega, struct mosAdmittances *yAc) double dxdy; double *solnReal, *solnImag; double *rhsReal, *rhsImag; - BOOLEAN SORFailed; + bool SORFailed; SPcomplex *y, cOmega; double startTime; @@ -725,7 +725,7 @@ NUMOSadmittance(TWOdevice *pDevice, double omega, struct mosAdmittances *yAc) return (AcAnalysisMethod); } -BOOLEAN +bool TWOsorSolve(TWOdevice *pDevice, double *xReal, double *xImag, double omega) { @@ -733,8 +733,8 @@ TWOsorSolve(TWOdevice *pDevice, double *xReal, double *xImag, double wRelax = 1.0; /* SOR relaxation parameter */ double *rhsReal = pDevice->rhs; double *rhsSOR = pDevice->rhsImag; - BOOLEAN SORConverged = FALSE; - BOOLEAN SORFailed = FALSE; + bool SORConverged = FALSE; + bool SORFailed = FALSE; int numEqns = pDevice->numEqns; int iterationNum; int indexN, indexP; @@ -859,7 +859,7 @@ TWOsorSolve(TWOdevice *pDevice, double *xReal, double *xImag, SPcomplex * -contactAdmittance(TWOdevice *pDevice, TWOcontact *pContact, BOOLEAN delVContact, +contactAdmittance(TWOdevice *pDevice, TWOcontact *pContact, bool delVContact, double *xReal, double *xImag, SPcomplex *cOmega) { TWOnode *pNode, *pHNode = NULL, *pVNode = NULL; @@ -1061,7 +1061,7 @@ contactAdmittance(TWOdevice *pDevice, TWOcontact *pContact, BOOLEAN delVContact, SPcomplex * -oxideAdmittance(TWOdevice *pDevice, TWOcontact *pContact, BOOLEAN delVContact, +oxideAdmittance(TWOdevice *pDevice, TWOcontact *pContact, bool delVContact, double *xReal, double *xImag, SPcomplex *cOmega) { TWOnode *pNode, *pHNode = NULL, *pVNode = NULL; @@ -1148,7 +1148,7 @@ NUMD2ys(TWOdevice *pDevice, SPcomplex *s, SPcomplex *yIn) double *solnReal, *solnImag; double *rhsReal, *rhsImag; SPcomplex yAc, *y; - BOOLEAN deltaVContact = FALSE; + bool deltaVContact = FALSE; SPcomplex temp, cOmega; /* diff --git a/src/ciderlib/twod/twocond.c b/src/ciderlib/twod/twocond.c index a9c763d31..7ec1e6574 100644 --- a/src/ciderlib/twod/twocond.c +++ b/src/ciderlib/twod/twocond.c @@ -17,12 +17,12 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group void - NUMD2conductance(TWOdevice *pDevice, BOOLEAN tranAnalysis, + NUMD2conductance(TWOdevice *pDevice, bool tranAnalysis, double *intCoeff, double *gd) { TWOcontact *pContact = pDevice->pFirstContact; double *incVpn; - BOOLEAN deltaVContact = FALSE; + bool deltaVContact = FALSE; /* * store the new rhs for computing the incremental quantities @@ -44,7 +44,7 @@ void } void - NBJT2conductance(TWOdevice *pDevice, BOOLEAN tranAnalysis, + NBJT2conductance(TWOdevice *pDevice, bool tranAnalysis, double *intCoeff, double *dIeDVce, double *dIcDVce, double *dIeDVbe, double *dIcDVbe) { @@ -94,7 +94,7 @@ void } void - NUMOSconductance(TWOdevice *pDevice, BOOLEAN tranAnalysis, double *intCoeff, + NUMOSconductance(TWOdevice *pDevice, bool tranAnalysis, double *intCoeff, struct mosConductances *dIdV) { TWOcontact *pDContact = pDevice->pFirstContact; @@ -236,7 +236,7 @@ double double oxideCurrent(TWOdevice *pDevice, TWOcontact *pContact, - BOOLEAN tranAnalysis) + bool tranAnalysis) { /* computes the current through the contact given in pContact */ int index, i, numContactNodes; @@ -294,8 +294,8 @@ double double contactConductance(TWOdevice *pDevice, TWOcontact *pContact, - BOOLEAN delVContact, double *dxDv, - BOOLEAN tranAnalysis, double *intCoeff) + bool delVContact, double *dxDv, + bool tranAnalysis, double *intCoeff) { /* computes the conductance of the contact given in pContact */ int index, i, numContactNodes; @@ -457,8 +457,8 @@ double double oxideConductance(TWOdevice *pDevice, TWOcontact *pContact, - BOOLEAN delVContact, double *dxDv, - BOOLEAN tranAnalysis, double *intCoeff) + bool delVContact, double *dxDv, + bool tranAnalysis, double *intCoeff) { /* computes the conductance of the contact given in pContact */ int index, i, numContactNodes; @@ -528,14 +528,14 @@ double */ void - NUMD2current(TWOdevice *pDevice, BOOLEAN tranAnalysis, + NUMD2current(TWOdevice *pDevice, bool tranAnalysis, double *intCoeff, double *id) { TWOcontact *pPContact = pDevice->pFirstContact; /* TWOcontact *pNContact = pDevice->pLastContact; */ double ip, ipPrime, *solution; /* double in;*/ - BOOLEAN deltaVContact = FALSE; + bool deltaVContact = FALSE; solution = pDevice->dcDeltaSolution; ip = contactCurrent( pDevice, pPContact ); @@ -559,7 +559,7 @@ void } void - NBJT2current(TWOdevice *pDevice, BOOLEAN tranAnalysis, double *intCoeff, + NBJT2current(TWOdevice *pDevice, bool tranAnalysis, double *intCoeff, double *ie, double *ic) { TWOcontact *pEmitContact = pDevice->pLastContact; @@ -593,7 +593,7 @@ void } void - NUMOScurrent(TWOdevice *pDevice, BOOLEAN tranAnalysis, double *intCoeff, + NUMOScurrent(TWOdevice *pDevice, bool tranAnalysis, double *intCoeff, double *id, double *is, double *ig) { TWOcontact *pDContact = pDevice->pFirstContact; diff --git a/src/ciderlib/twod/twocont.c b/src/ciderlib/twod/twocont.c index 40d75add5..4e79d8415 100644 --- a/src/ciderlib/twod/twocont.c +++ b/src/ciderlib/twod/twocont.c @@ -1190,7 +1190,7 @@ TWObindCSC (TWOdevice *pDevice) */ void - TWO_sysLoad(TWOdevice *pDevice, BOOLEAN tranAnalysis, TWOtranInfo *info) + TWO_sysLoad(TWOdevice *pDevice, bool tranAnalysis, TWOtranInfo *info) { TWOelem *pElem; TWOnode *pNode; @@ -1583,7 +1583,7 @@ void /* load only the Rhs vector */ void - TWO_rhsLoad(TWOdevice *pDevice, BOOLEAN tranAnalysis, TWOtranInfo *info) + TWO_rhsLoad(TWOdevice *pDevice, bool tranAnalysis, TWOtranInfo *info) { TWOelem *pElem; TWOnode *pNode; @@ -1712,8 +1712,8 @@ void * mobilities and their derivatives */ void - TWO_commonTerms(TWOdevice *pDevice, BOOLEAN currentOnly, - BOOLEAN tranAnalysis, TWOtranInfo *info) + TWO_commonTerms(TWOdevice *pDevice, bool currentOnly, + bool tranAnalysis, TWOtranInfo *info) { TWOelem *pElem; TWOedge *pEdge; diff --git a/src/ciderlib/twod/twoddefs.h b/src/ciderlib/twod/twoddefs.h index 349940f33..8dfeccf10 100644 --- a/src/ciderlib/twod/twoddefs.h +++ b/src/ciderlib/twod/twoddefs.h @@ -7,10 +7,10 @@ /* Debug statements */ -extern BOOLEAN TWOacDebug; -extern BOOLEAN TWOdcDebug; -extern BOOLEAN TWOtranDebug; -extern BOOLEAN TWOjacDebug; +extern bool TWOacDebug; +extern bool TWOdcDebug; +extern bool TWOtranDebug; +extern bool TWOjacDebug; /* Now some defines for the two dimensional simulator * library. diff --git a/src/ciderlib/twod/twodext.h b/src/ciderlib/twod/twodext.h index 2af9e97d7..0f3573779 100644 --- a/src/ciderlib/twod/twodext.h +++ b/src/ciderlib/twod/twodext.h @@ -19,10 +19,10 @@ extern int NUMD2admittance(TWOdevice *, double, SPcomplex *); extern int NBJT2admittance(TWOdevice *, double, SPcomplex *, SPcomplex *, SPcomplex *, SPcomplex *); extern int NUMOSadmittance(TWOdevice *, double, struct mosAdmittances *); -extern BOOLEAN TWOsorSolve(TWOdevice *, double *, double *, double); -extern SPcomplex *contactAdmittance(TWOdevice *, TWOcontact *, BOOLEAN, +extern bool TWOsorSolve(TWOdevice *, double *, double *, double); +extern SPcomplex *contactAdmittance(TWOdevice *, TWOcontact *, bool, double *, double *, SPcomplex *); -extern SPcomplex *oxideAdmittance(TWOdevice *, TWOcontact *,BOOLEAN, +extern SPcomplex *oxideAdmittance(TWOdevice *, TWOcontact *,bool, double *, double *, SPcomplex *); extern void NUMD2ys(TWOdevice *, SPcomplex *, SPcomplex *); @@ -34,29 +34,29 @@ extern void NUMOSys(TWOdevice *, SPcomplex *, struct mosAdmittances *); extern double TWOavalanche(TWOelem *, TWOnode *); /* twocond.c */ -extern void NUMD2conductance(TWOdevice *, BOOLEAN, double *, double *); -extern void NBJT2conductance(TWOdevice *, BOOLEAN, double *, double *, +extern void NUMD2conductance(TWOdevice *, bool, double *, double *); +extern void NBJT2conductance(TWOdevice *, bool, double *, double *, double *, double *, double *); -extern void NUMOSconductance(TWOdevice *, BOOLEAN, double *, +extern void NUMOSconductance(TWOdevice *, bool, double *, struct mosConductances *); extern double contactCurrent(TWOdevice *, TWOcontact *); -extern double oxideCurrent(TWOdevice *, TWOcontact *, BOOLEAN); -extern double contactConductance(TWOdevice *, TWOcontact *, BOOLEAN, - double *, BOOLEAN, double *); -extern double oxideConductance(TWOdevice *, TWOcontact *, BOOLEAN, - double *, BOOLEAN, double *); -extern void NUMD2current(TWOdevice *, BOOLEAN, double *, double *); -extern void NBJT2current(TWOdevice *, BOOLEAN, double *, double *, +extern double oxideCurrent(TWOdevice *, TWOcontact *, bool); +extern double contactConductance(TWOdevice *, TWOcontact *, bool, + double *, bool, double *); +extern double oxideConductance(TWOdevice *, TWOcontact *, bool, + double *, bool, double *); +extern void NUMD2current(TWOdevice *, bool, double *, double *); +extern void NBJT2current(TWOdevice *, bool, double *, double *, double *); -extern void NUMOScurrent(TWOdevice *, BOOLEAN , double *, double *, double *, +extern void NUMOScurrent(TWOdevice *, bool , double *, double *, double *, double *); /* twocont */ extern void TWO_jacBuild(TWOdevice *); -extern void TWO_sysLoad(TWOdevice *, BOOLEAN, TWOtranInfo *); +extern void TWO_sysLoad(TWOdevice *, bool, TWOtranInfo *); extern void TWO_jacLoad(TWOdevice *); -extern void TWO_rhsLoad(TWOdevice *, BOOLEAN, TWOtranInfo *); -extern void TWO_commonTerms(TWOdevice *, BOOLEAN, BOOLEAN, TWOtranInfo *); +extern void TWO_rhsLoad(TWOdevice *, bool, TWOtranInfo *); +extern void TWO_commonTerms(TWOdevice *, bool, bool, TWOtranInfo *); /* twocurr.c */ extern void nodeCurrents(TWOelem *, TWOnode *, double *, double *, @@ -101,17 +101,17 @@ extern void TWOPmobility(TWOelem *, double); /* twoncont.c */ extern void TWONjacBuild(TWOdevice *); -extern void TWONsysLoad(TWOdevice *, BOOLEAN, TWOtranInfo *); +extern void TWONsysLoad(TWOdevice *, bool, TWOtranInfo *); extern void TWONjacLoad(TWOdevice *); -extern void TWONrhsLoad(TWOdevice *, BOOLEAN, TWOtranInfo *); -extern void TWONcommonTerms(TWOdevice *, BOOLEAN, BOOLEAN, TWOtranInfo *); +extern void TWONrhsLoad(TWOdevice *, bool, TWOtranInfo *); +extern void TWONcommonTerms(TWOdevice *, bool, bool, TWOtranInfo *); /* twopcont.c */ extern void TWOPjacBuild(TWOdevice *); -extern void TWOPsysLoad(TWOdevice *, BOOLEAN, TWOtranInfo *); +extern void TWOPsysLoad(TWOdevice *, bool, TWOtranInfo *); extern void TWOPjacLoad(TWOdevice *); -extern void TWOPrhsLoad(TWOdevice *, BOOLEAN, TWOtranInfo *); -extern void TWOPcommonTerms(TWOdevice *, BOOLEAN, BOOLEAN, TWOtranInfo *); +extern void TWOPrhsLoad(TWOdevice *, bool, TWOtranInfo *); +extern void TWOPcommonTerms(TWOdevice *, bool, bool, TWOtranInfo *); /* twopoiss.c */ extern void TWOQjacBuild(TWOdevice *); @@ -120,7 +120,7 @@ extern void TWOQrhsLoad(TWOdevice *); extern void TWOQcommonTerms(TWOdevice *); /*twoprint.c */ -extern void TWOprnSolution(FILE *, TWOdevice *, OUTPcard *, BOOLEAN, char *); +extern void TWOprnSolution(FILE *, TWOdevice *, OUTPcard *, bool, char *); extern void TWOmemStats(FILE *, TWOdevice *); extern void TWOcpuStats(FILE *, TWOdevice *); @@ -129,9 +129,9 @@ extern void TWOcpuStats(FILE *, TWOdevice *); extern void NUMD2project(TWOdevice *, double); extern void NBJT2project(TWOdevice *, double, double); extern void NUMOSproject(TWOdevice *, double, double, double); -extern void NUMD2update(TWOdevice *,double, BOOLEAN); -extern void NBJT2update(TWOdevice *, double, double, BOOLEAN); -extern void NUMOSupdate(TWOdevice *, double, double, double, BOOLEAN); +extern void NUMD2update(TWOdevice *,double, bool); +extern void NBJT2update(TWOdevice *, double, double, bool); +extern void NUMOSupdate(TWOdevice *, double, double, double, bool); extern void storeNewRhs(TWOdevice *, TWOcontact *); /* tworead.c */ @@ -148,23 +148,23 @@ extern void TWOsetBCparams(TWOdevice *, BDRYcard *); extern void TWOnormalize(TWOdevice *); /* twosolve.c */ -extern void TWOdcSolve(TWOdevice *, int, BOOLEAN, BOOLEAN, TWOtranInfo *); -extern BOOLEAN TWOdeltaConverged(TWOdevice *); -extern BOOLEAN TWOdeviceConverged(TWOdevice *); +extern void TWOdcSolve(TWOdevice *, int, bool, bool, TWOtranInfo *); +extern bool TWOdeltaConverged(TWOdevice *); +extern bool TWOdeviceConverged(TWOdevice *); extern void TWOresetJacobian(TWOdevice *); extern void TWOstoreNeutralGuess(TWOdevice *); extern int TWOequilSolve(TWOdevice *); -extern void TWObiasSolve(TWOdevice *, int, BOOLEAN, TWOtranInfo *); +extern void TWObiasSolve(TWOdevice *, int, bool, TWOtranInfo *); extern void TWOstoreEquilibGuess(TWOdevice *); extern void TWOstoreInitialGuess(TWOdevice *); -extern void oldTWOnewDelta(TWOdevice *, BOOLEAN, TWOtranInfo *); -extern int TWOnewDelta(TWOdevice *, BOOLEAN, TWOtranInfo *); +extern void oldTWOnewDelta(TWOdevice *, bool, TWOtranInfo *); +extern int TWOnewDelta(TWOdevice *, bool, TWOtranInfo *); extern void TWOpredict(TWOdevice *, TWOtranInfo *); extern double TWOtrunc(TWOdevice *, TWOtranInfo *, double); extern void TWOsaveState(TWOdevice *); -extern BOOLEAN TWOpsiDeltaConverged(TWOdevice *); +extern bool TWOpsiDeltaConverged(TWOdevice *); extern double TWOnuNorm(TWOdevice *); -extern void TWOjacCheck(TWOdevice *, BOOLEAN, TWOtranInfo *); +extern void TWOjacCheck(TWOdevice *, bool, TWOtranInfo *); #ifdef KLU void TWObindCSC (TWOdevice *) ; diff --git a/src/ciderlib/twod/twodopng.c b/src/ciderlib/twod/twodopng.c index 77d0d4d05..6c69dc03b 100644 --- a/src/ciderlib/twod/twodopng.c +++ b/src/ciderlib/twod/twodopng.c @@ -180,7 +180,7 @@ TWOsetDoping(TWOdevice *pDevice, DOPprofile *pProfile, DOPtable *pTable) DOPprofile *pP; double conc; int index, eIndex; - BOOLEAN dopeMe; + bool dopeMe; /* Clear doping info for all nodes. */ for ( eIndex = 1; eIndex <= pDevice->numElems; eIndex++ ) { diff --git a/src/ciderlib/twod/twoelect.c b/src/ciderlib/twod/twoelect.c index d3ffbbad8..b12ce9bcd 100644 --- a/src/ciderlib/twod/twoelect.c +++ b/src/ciderlib/twod/twoelect.c @@ -41,7 +41,7 @@ checkElectrodes(TWOelectrode *pElectrode, int idHigh) { TWOelectrode *pE; int id; - BOOLEAN error = FALSE; + bool error = FALSE; /* * order the electrodes diff --git a/src/ciderlib/twod/twomesh.c b/src/ciderlib/twod/twomesh.c index 4eddd4d87..080b91c26 100644 --- a/src/ciderlib/twod/twomesh.c +++ b/src/ciderlib/twod/twomesh.c @@ -35,7 +35,7 @@ TWObuildMesh(TWOdevice *pDevice, TWOdomain *pDomain, TWOdomain *pD; TWOelectrode *pE; TWOmaterial *pM; - BOOLEAN interiorNode; + bool interiorNode; int poiEqn, numEqn, numElem, numNodes, numEdges; int numXNodes = pDevice->numXNodes; int numYNodes = pDevice->numYNodes; diff --git a/src/ciderlib/twod/twomobdv.c b/src/ciderlib/twod/twomobdv.c index 7c18122df..952823c69 100644 --- a/src/ciderlib/twod/twomobdv.c +++ b/src/ciderlib/twod/twomobdv.c @@ -25,7 +25,7 @@ void { TWOnode *pNode; TWOedge *pTEdge, *pBEdge, *pLEdge, *pREdge; - BOOLEAN channel = pElem->channel; + bool channel = pElem->channel; double dx, dy, rDx, rDy; double coeffHx, coeffHy, coeffHs = 0.0; double coeffVx, coeffVy, coeffVs = 0.0; @@ -656,7 +656,7 @@ void { TWOnode *pNode; TWOedge *pTEdge, *pBEdge, *pLEdge, *pREdge; - BOOLEAN channel = pElem->channel; + bool channel = pElem->channel; double dx, dy, rDx, rDy; double coeffHx, coeffHy, coeffHs = 0.0; double coeffVx, coeffVy, coeffVs = 0.0; @@ -1033,7 +1033,7 @@ void { TWOnode *pNode; TWOedge *pTEdge, *pBEdge, *pLEdge, *pREdge; - BOOLEAN channel = pElem->channel; + bool channel = pElem->channel; double dx, dy, rDx, rDy; double coeffHx, coeffHy, coeffHs = 0.0; double coeffVx, coeffVy, coeffVs = 0.0; diff --git a/src/ciderlib/twod/twoncont.c b/src/ciderlib/twod/twoncont.c index fe78f17d8..194339dfe 100644 --- a/src/ciderlib/twod/twoncont.c +++ b/src/ciderlib/twod/twoncont.c @@ -819,7 +819,7 @@ TWONbindCSC (TWOdevice *pDevice) */ void - TWONsysLoad(TWOdevice *pDevice, BOOLEAN tranAnalysis, TWOtranInfo *info) + TWONsysLoad(TWOdevice *pDevice, bool tranAnalysis, TWOtranInfo *info) { TWOelem *pElem; TWOnode *pNode; @@ -1151,7 +1151,7 @@ void /* load only the Rhs vector */ void - TWONrhsLoad(TWOdevice *pDevice, BOOLEAN tranAnalysis, TWOtranInfo *info) + TWONrhsLoad(TWOdevice *pDevice, bool tranAnalysis, TWOtranInfo *info) { TWOelem *pElem; TWOnode *pNode; @@ -1267,8 +1267,8 @@ void * mobilities and their derivatives */ void - TWONcommonTerms(TWOdevice *pDevice, BOOLEAN currentOnly, - BOOLEAN tranAnalysis, TWOtranInfo *info) + TWONcommonTerms(TWOdevice *pDevice, bool currentOnly, + bool tranAnalysis, TWOtranInfo *info) { TWOelem *pElem; TWOedge *pEdge; diff --git a/src/ciderlib/twod/twopcont.c b/src/ciderlib/twod/twopcont.c index b8af9a399..a3b1e6dd5 100644 --- a/src/ciderlib/twod/twopcont.c +++ b/src/ciderlib/twod/twopcont.c @@ -819,7 +819,7 @@ TWOPbindCSC (TWOdevice *pDevice) */ void - TWOPsysLoad(TWOdevice *pDevice, BOOLEAN tranAnalysis, TWOtranInfo *info) + TWOPsysLoad(TWOdevice *pDevice, bool tranAnalysis, TWOtranInfo *info) { TWOelem *pElem; TWOnode *pNode; @@ -1150,7 +1150,7 @@ void /* load only the Rhs vector */ void - TWOPrhsLoad(TWOdevice *pDevice, BOOLEAN tranAnalysis, TWOtranInfo *info) + TWOPrhsLoad(TWOdevice *pDevice, bool tranAnalysis, TWOtranInfo *info) { TWOelem *pElem; TWOnode *pNode; @@ -1266,8 +1266,8 @@ void * mobilities and their derivatives */ void - TWOPcommonTerms(TWOdevice *pDevice, BOOLEAN currentOnly, - BOOLEAN tranAnalysis, TWOtranInfo *info) + TWOPcommonTerms(TWOdevice *pDevice, bool currentOnly, + bool tranAnalysis, TWOtranInfo *info) { TWOelem *pElem; TWOedge *pEdge; diff --git a/src/ciderlib/twod/twoprint.c b/src/ciderlib/twod/twoprint.c index 9b0f9a2dd..4547a8cf5 100644 --- a/src/ciderlib/twod/twoprint.c +++ b/src/ciderlib/twod/twoprint.c @@ -20,7 +20,7 @@ Author: 1992 David A. Gates, U. C. Berkeley CAD Group void -TWOprnSolution(FILE *file, TWOdevice *pDevice, OUTPcard *output, BOOLEAN asciiSave, char *extra) +TWOprnSolution(FILE *file, TWOdevice *pDevice, OUTPcard *output, bool asciiSave, char *extra) { int index, xIndex, yIndex; int numVars = 0; diff --git a/src/ciderlib/twod/twoproj.c b/src/ciderlib/twod/twoproj.c index 19c45a4a5..30d76c053 100644 --- a/src/ciderlib/twod/twoproj.c +++ b/src/ciderlib/twod/twoproj.c @@ -429,7 +429,7 @@ void NUMOSproject(TWOdevice *pDevice, double delVdb, double delVsb, modified two-level Newton methods */ -void NUMD2update(TWOdevice *pDevice, double delV, BOOLEAN updateBoundary) +void NUMD2update(TWOdevice *pDevice, double delV, bool updateBoundary) { TWOnode *pNode; TWOelem *pElem; @@ -477,7 +477,7 @@ void NUMD2update(TWOdevice *pDevice, double delV, BOOLEAN updateBoundary) void NBJT2update(TWOdevice *pDevice, double delVce, double delVbe, - BOOLEAN updateBoundary) + bool updateBoundary) { TWOnode *pNode; TWOelem *pElem; @@ -543,7 +543,7 @@ void NBJT2update(TWOdevice *pDevice, double delVce, double delVbe, void NUMOSupdate(TWOdevice *pDevice, double delVdb, double delVsb, - double delVgb, BOOLEAN updateBoundary) + double delVgb, bool updateBoundary) { TWOnode *pNode; TWOelem *pElem; diff --git a/src/ciderlib/twod/twosolve.c b/src/ciderlib/twod/twosolve.c index 8a509ef17..6ddbe7f97 100644 --- a/src/ciderlib/twod/twosolve.c +++ b/src/ciderlib/twod/twosolve.c @@ -29,17 +29,17 @@ extern IFfrontEnd *SPfrontEnd; /* the iteration driving loop and convergence check */ void -TWOdcSolve(TWOdevice *pDevice, int iterationLimit, BOOLEAN newSolver, - BOOLEAN tranAnalysis, TWOtranInfo *info) +TWOdcSolve(TWOdevice *pDevice, int iterationLimit, bool newSolver, + bool tranAnalysis, TWOtranInfo *info) { TWOnode *pNode; TWOelem *pElem; int size = pDevice->numEqns; int index, eIndex, error; int timesConverged = 0; - BOOLEAN quitLoop; - BOOLEAN debug; - BOOLEAN negConc = FALSE; + bool quitLoop; + bool debug; + bool negConc = FALSE; double *rhs = pDevice->rhs; double *solution = pDevice->dcSolution; double *delta = pDevice->dcDeltaSolution; @@ -302,12 +302,12 @@ TWOdcSolve(TWOdevice *pDevice, int iterationLimit, BOOLEAN newSolver, } } -BOOLEAN +bool TWOdeltaConverged(TWOdevice *pDevice) { /* This function returns a TRUE if converged else a FALSE. */ int index; - BOOLEAN converged = TRUE; + bool converged = TRUE; double xOld, xNew, tol; for (index = 1; index <= pDevice->numEqns; index++) { @@ -322,11 +322,11 @@ TWOdeltaConverged(TWOdevice *pDevice) return (converged); } -BOOLEAN +bool TWOdeviceConverged(TWOdevice *pDevice) { int index, eIndex; - BOOLEAN converged = TRUE; + bool converged = TRUE; double *solution = pDevice->dcSolution; TWOnode *pNode; TWOelem *pElem; @@ -457,7 +457,7 @@ TWOstoreNeutralGuess(TWOdevice *pDevice) /* the solution is used as an initial starting point for bias conditions */ int TWOequilSolve(TWOdevice *pDevice) { - BOOLEAN newSolver = FALSE; + bool newSolver = FALSE; int error; int nIndex, eIndex; TWOelem *pElem; @@ -623,10 +623,10 @@ int TWOequilSolve(TWOdevice *pDevice) /* compute the solution under an applied bias */ /* the equilibrium solution is taken as an initial guess */ void -TWObiasSolve(TWOdevice *pDevice, int iterationLimit, BOOLEAN tranAnalysis, +TWObiasSolve(TWOdevice *pDevice, int iterationLimit, bool tranAnalysis, TWOtranInfo *info) { - BOOLEAN newSolver = FALSE; + bool newSolver = FALSE; int error; int index, eIndex; TWOelem *pElem; @@ -920,11 +920,11 @@ TWOstoreInitialGuess(TWOdevice *pDevice) */ void -oldTWOnewDelta(TWOdevice *pDevice, BOOLEAN tranAnalysis, TWOtranInfo *info) +oldTWOnewDelta(TWOdevice *pDevice, bool tranAnalysis, TWOtranInfo *info) { int index; double newNorm, fib, lambda, fibn, fibp; - BOOLEAN acceptable = FALSE; + bool acceptable = FALSE; lambda = 1.0; fibn = 1.0; fibp = 1.0; @@ -992,12 +992,12 @@ oldTWOnewDelta(TWOdevice *pDevice, BOOLEAN tranAnalysis, TWOtranInfo *info) int -TWOnewDelta(TWOdevice *pDevice, BOOLEAN tranAnalysis, TWOtranInfo *info) +TWOnewDelta(TWOdevice *pDevice, bool tranAnalysis, TWOtranInfo *info) { int index, iterNum = 0; double newNorm; double fib, lambda, fibn, fibp; - BOOLEAN acceptable = FALSE, error = FALSE; + bool acceptable = FALSE, error = FALSE; lambda = 1.0; fibn = 1.0; @@ -1224,7 +1224,7 @@ TWOsaveState(TWOdevice *pDevice) * Fermi levels. This should be better since we are looking at potentials in * all (psi, phin, phip) */ -BOOLEAN +bool TWOpsiDeltaConverged(TWOdevice *pDevice) { int index, nIndex, eIndex; @@ -1233,7 +1233,7 @@ TWOpsiDeltaConverged(TWOdevice *pDevice) double xOld, xNew, xDelta, tol; double psi, newPsi, nConc, pConc, newN, newP; double phiN, phiP, newPhiN, newPhiP; - BOOLEAN converged = TRUE; + bool converged = TRUE; /* equilibrium solution */ if (pDevice->poissonOnly) { @@ -1331,7 +1331,7 @@ TWOnuNorm(TWOdevice *pDevice) * models are being incorporated. */ void -TWOjacCheck(TWOdevice *pDevice, BOOLEAN tranAnalysis, TWOtranInfo *info) +TWOjacCheck(TWOdevice *pDevice, bool tranAnalysis, TWOtranInfo *info) { int index, rIndex; double del, diff, tol, *dptr; diff --git a/src/frontend/com_sysinfo.c b/src/frontend/com_sysinfo.c index 7e92a6cd0..0e65d7966 100644 --- a/src/frontend/com_sysinfo.c +++ b/src/frontend/com_sysinfo.c @@ -13,7 +13,6 @@ #include "com_commands.h" #ifdef _WIN32 -#undef BOOLEAN #include #include #endif @@ -876,7 +875,7 @@ static void get_os_info(void) /* This funtion sets the field storing the number of physical processors * in system_info */ -typedef BOOL (WINAPI *glp_t)(LOGICAL_PROCESSOR_RELATIONSHIP, +typedef bool (WINAPI *glp_t)(LOGICAL_PROCESSOR_RELATIONSHIP, PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX, PDWORD); static void get_physical_processor_count(void) { diff --git a/src/frontend/diff.c b/src/frontend/diff.c index 4412bb7da..d803f9e55 100644 --- a/src/frontend/diff.c +++ b/src/frontend/diff.c @@ -95,7 +95,7 @@ nameeq(const char *n1, const char *n2) DS_CREATE(ds2, 100); /* Compare canonical names */ - const BOOL rc = (BOOL) cieq(canonical_name(n1, &ds1, FALSE), + const bool rc = (bool) cieq(canonical_name(n1, &ds1, FALSE), canonical_name(n2, &ds2, FALSE)); /* Free the dynamic string buffers */ diff --git a/src/frontend/get_avail_mem_size.c b/src/frontend/get_avail_mem_size.c index ebec4fd89..1148c1e91 100644 --- a/src/frontend/get_avail_mem_size.c +++ b/src/frontend/get_avail_mem_size.c @@ -8,7 +8,6 @@ #include "resource.h" #if defined(_WIN32) -#undef BOOLEAN #include #elif defined(__unix__) || defined(__unix) || defined(unix) || (defined(__APPLE__) && defined(__MACH__)) diff --git a/src/frontend/get_phys_mem_size.c b/src/frontend/get_phys_mem_size.c index c40e5a327..4150fef42 100644 --- a/src/frontend/get_phys_mem_size.c +++ b/src/frontend/get_phys_mem_size.c @@ -10,7 +10,6 @@ #include "resource.h" #if defined(_WIN32) -#undef BOOLEAN #include #elif defined(__unix__) || defined(__unix) || defined(unix) || (defined(__APPLE__) && defined(__MACH__)) diff --git a/src/frontend/get_resident_set_size.c b/src/frontend/get_resident_set_size.c index aeff60558..6325940a2 100644 --- a/src/frontend/get_resident_set_size.c +++ b/src/frontend/get_resident_set_size.c @@ -10,7 +10,6 @@ #include "resource.h" #if defined(_WIN32) -#undef BOOLEAN #include #include diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 5ce853e37..2263dcf64 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -9,9 +9,10 @@ Author: 1985 Wayne A. Christopher Central function is inp_readall() */ -/* Note: Must include shlwapi.h before ngspice header defining BOOL due +/* Note: Must include shlwapi.h before ngspice header defining bool due * to conflict */ #include +#include #ifdef _WIN32 #include /* for definition of PathIsRelativeA() */ #pragma comment(lib, "Shlwapi.lib") @@ -1857,7 +1858,6 @@ FILE *inp_pathopen(const char *name, const char *mode) /* for MultiByteToWideChar */ #if defined(__MINGW32__) || defined(_MSC_VER) #ifndef EXT_ASC -#undef BOOLEAN #include #endif #endif diff --git a/src/frontend/inpcompat.c b/src/frontend/inpcompat.c index 6c3faaa27..b92bf1fab 100644 --- a/src/frontend/inpcompat.c +++ b/src/frontend/inpcompat.c @@ -457,10 +457,10 @@ static struct card *u_instances(struct card *startcard) struct card *newcard = NULL, *last_newcard = NULL; int models_ok = 0, models_not_ok = 0; int udev_ok = 0, udev_not_ok = 0; - BOOL create_called = FALSE, repeat_pass = FALSE; - BOOL skip_next = FALSE; + bool create_called = FALSE, repeat_pass = FALSE; + bool skip_next = FALSE; struct card *c = startcard; - BOOL insub = FALSE; + bool insub = FALSE; int ps_global_tmodels = 0; /* NOTE: PSpice ref. manual Product Version 16.5 page 105. diff --git a/src/frontend/logicexp.c b/src/frontend/logicexp.c index dd9509b91..e98c42178 100644 --- a/src/frontend/logicexp.c +++ b/src/frontend/logicexp.c @@ -26,7 +26,7 @@ static char *get_pindly_instance_name(void); static char *get_inst_name(void); static char *get_logicexp_tmodel_delays( - char *out_name, int gate_op, BOOL isnot, DSTRING *mname); + char *out_name, int gate_op, bool isnot, DSTRING *mname); /* Start of btree symbol table */ #define SYM_INPUT 1 @@ -235,7 +235,7 @@ static int lex_oper(int c) return 0; } -static char *lex_gate_name(int c, BOOL not) +static char *lex_gate_name(int c, bool not) { /* returns an XSPICE gate model name */ static char buf[32]; @@ -271,7 +271,7 @@ static char *lex_gate_name(int c, BOOL not) return buf; } -static char *tmodel_gate_name(int c, BOOL not) +static char *tmodel_gate_name(int c, bool not) { /* Returns an XSPICE model name for the case where logicexp does not have a corresponding pindly @@ -353,7 +353,7 @@ static int lexer_scan(LEXER lx) return c; else if (lex_ident(c)) { size_t i = 0; - BOOL need_gt1 = FALSE; + bool need_gt1 = FALSE; if (c == '+') { // an identifier does not begin with '+' lx->lexer_buf[0] = (char) c; lx->lexer_buf[1] = '\0'; @@ -398,7 +398,7 @@ static int lex_scan(void) return lexer_scan(parse_lexer); } -static BOOL lex_all_digits(char *str) +static bool lex_all_digits(char *str) { size_t i, slen; if (!str) { return FALSE; } @@ -482,9 +482,9 @@ struct Stack { struct gate_data { int type; - BOOL finished; - BOOL is_not; - BOOL is_possible; + bool finished; + bool is_not; + bool is_possible; char *outp; NAME_ENTRY ins; NAME_ENTRY last_input; @@ -991,12 +991,12 @@ err_return: /* Start of logicexp parser */ static void aerror(char *s); -static BOOL amatch(int t); -static BOOL bparse(char *line, BOOL new_lexer, int optimize); +static bool amatch(int t); +static bool bparse(char *line, bool new_lexer, int optimize); static int lookahead = 0; static int number_of_instances = 0; -static BOOL use_tmodel_delays = FALSE; +static bool use_tmodel_delays = FALSE; static void cleanup_parser(void) { @@ -1074,7 +1074,7 @@ static void aerror(char *s) cleanup_parser(); } -static BOOL amatch(int t) +static bool amatch(int t) { if (lookahead == t) { lookahead = lex_scan(); @@ -1087,14 +1087,14 @@ static BOOL amatch(int t) return TRUE; } -static BOOL bstmt_postfix(int optimize) +static bool bstmt_postfix(int optimize) { /* A stmt is: output_name_id = '{' expr '}' */ DS_CREATE(lhs, 32); DS_CREATE(postfix, 1024); DS_CREATE(infix, 1024); char *right_bracket = NULL, *rest = NULL; - BOOL retval = TRUE; + bool retval = TRUE; if (lookahead == LEX_ID) { ds_clear(&lhs); @@ -1156,7 +1156,7 @@ bail_out: } static char *get_logicexp_tmodel_delays( - char *out_name, int gate_op, BOOL isnot, DSTRING *mname) + char *out_name, int gate_op, bool isnot, DSTRING *mname) { ds_clear(mname); if (use_tmodel_delays) { @@ -1182,9 +1182,9 @@ static char *get_logicexp_tmodel_delays( return ds_get_buf(mname); } -static BOOL bparse(char *line, BOOL new_lexer, int optimize) +static bool bparse(char *line, bool new_lexer, int optimize) { - BOOL ret_val = TRUE; + bool ret_val = TRUE; DS_CREATE(stmt, LEX_BUF_SZ); if (new_lexer) @@ -1228,8 +1228,8 @@ static BOOL bparse(char *line, BOOL new_lexer, int optimize) */ static LEXER current_lexer = NULL; -static BOOL expect_token( - int tok, int expected_tok, char *expected_str, BOOL msg, int loc) +static bool expect_token( + int tok, int expected_tok, char *expected_str, bool msg, int loc) { if (tok != expected_tok) { if (msg) { @@ -1259,12 +1259,12 @@ static BOOL expect_token( return TRUE; } -BOOL f_logicexp(char *line, int optimize) +bool f_logicexp(char *line, int optimize) { /* If optimize > 0 then perform optimizations in scan_gates */ int t, num_ins = 0, num_outs = 0, i; char *endp; - BOOL ret_val = TRUE; + bool ret_val = TRUE; char *uname = NULL; lex_init(line); @@ -1689,8 +1689,8 @@ static char *mntymx_estimate(char *delay_str, DSTRING *pds) return s; } -static BOOL extract_delay( - LEXER lx, int val, PLINE *pline_arr, int idx, BOOL tri) +static bool extract_delay( + LEXER lx, int val, PLINE *pline_arr, int idx, bool tri) { /* NOTE: The delays are specified in a DELAY(t1,t2,t3) function. Beware if the format of t1, t2, t3 changes! @@ -1700,9 +1700,9 @@ static BOOL extract_delay( x.y represents a decimal number; w is an integer. Either numbers can have more that one digit. */ - BOOL in_delay = FALSE, ret_val = TRUE; + bool in_delay = FALSE, ret_val = TRUE; int i; - BOOL shorter = FALSE, update_val = FALSE; + bool shorter = FALSE, update_val = FALSE; struct udevices_info info = u_get_udevices_info(); float del_max_val = 0.0, del_val = 0.0, del_min_val = FLT_MAX; char *units; @@ -1807,10 +1807,10 @@ static BOOL extract_delay( return ret_val; } -static BOOL new_gen_output_models(LEXER lx) +static bool new_gen_output_models(LEXER lx) { int val, arrlen = 0, idx = 0, i; - BOOL in_pindly = FALSE, in_tristate = FALSE; + bool in_pindly = FALSE, in_tristate = FALSE; DS_CREATE(enable_name, 64); DS_CREATE(last_enable, 64); PLINE pline = NULL; @@ -1874,7 +1874,7 @@ static BOOL new_gen_output_models(LEXER lx) val = lexer_scan(lx); if (val == LEX_ID && (eq(lx->lexer_buf, "hi") || eq(lx->lexer_buf, "lo"))) { - BOOL invert = FALSE; + bool invert = FALSE; if (eq(lx->lexer_buf, "lo")) invert = TRUE; val = lexer_scan(lx); @@ -1960,7 +1960,7 @@ static char *get_pindly_instance_name(void) return pindly_instance_name; } -BOOL f_pindly(char *line) +bool f_pindly(char *line) { int t, num_ios = 0, num_ena = 0, num_refs = 0, i; char *endp; diff --git a/src/frontend/plotting/gnuplot.c b/src/frontend/plotting/gnuplot.c index 27f727947..a814954dc 100644 --- a/src/frontend/plotting/gnuplot.c +++ b/src/frontend/plotting/gnuplot.c @@ -16,7 +16,6 @@ #include "ngspice/fteparse.h" #include "gnuplot.h" #if defined(__MINGW32__) || defined(_MSC_VER) -#undef BOOLEAN #include #else #include diff --git a/src/frontend/plotting/grid.c b/src/frontend/plotting/grid.c index 52d4b6073..7ad036039 100644 --- a/src/frontend/plotting/grid.c +++ b/src/frontend/plotting/grid.c @@ -18,7 +18,6 @@ Modified: 2001 AlansFixes #include #if defined(_MSC_VER) || defined(__MINGW32__) -#undef BOOLEAN #include #endif diff --git a/src/frontend/resource.c b/src/frontend/resource.c index 13eaa1ad3..7c511f143 100644 --- a/src/frontend/resource.c +++ b/src/frontend/resource.c @@ -21,6 +21,7 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group #include "ngspice/cktdefs.h" #include +#include #include "../misc/misc_time.h" /* timediff */ @@ -42,13 +43,13 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group #define WIN32_LEAN_AND_MEAN /* - * The ngspice.h file included above defines BOOLEAN (via bool.h) and this + * The ngspice.h file included above defines bool (via bool.h) and this * clashes with the definition obtained from windows.h (via winnt.h). - * However, BOOLEAN is not used by this file so we can work round this problem - * by undefining BOOLEAN before including windows.h + * However, bool is not used by this file so we can work round this problem + * by undefining bool before including windows.h * SJB - April 2005 */ -#undef BOOLEAN + #include #include diff --git a/src/frontend/udevices.c b/src/frontend/udevices.c index ecd5dd7d0..fe406cb7c 100644 --- a/src/frontend/udevices.c +++ b/src/frontend/udevices.c @@ -296,8 +296,8 @@ static NAME_ENTRY port_names_list = NULL; static NAME_ENTRY xsubckt_names_list = NULL; static unsigned int num_name_collisions = 0; /* .model d_zero_inv99 d_inverter just once per subckt */ -static BOOL add_zero_delay_inverter_model = FALSE; -static BOOL add_drive_hilo = FALSE; +static bool add_zero_delay_inverter_model = FALSE; +static bool add_drive_hilo = FALSE; static char *current_subckt = NULL; static unsigned int subckt_msg_count = 0; @@ -365,7 +365,7 @@ static void find_collision(char *name, NAME_ENTRY nelist) } } -static BOOL there_are_name_collisions(void) +static bool there_are_name_collisions(void) { if (new_names_list) { NAME_ENTRY x = NULL; @@ -889,7 +889,7 @@ void u_add_instance(char *str) } } -static BOOL gen_timing_model( +static bool gen_timing_model( char *tmodel, char *utype, char *xspice, char *newname, Xlatorp xlp); void u_add_logicexp_model(char *tmodel, char *xspice_gate, char *model_name) @@ -1026,7 +1026,7 @@ void initialize_udevice(char *subckt_line) add_drive_hilo = FALSE; } -void cleanup_udevice(BOOL global) +void cleanup_udevice(bool global) { if (global) { if (global_model_xlatorp) { @@ -1132,7 +1132,7 @@ static void *insert_global_model_in_table(Xlate_datap x) return inserted; } -static Xlate_datap find_in_model_xlator(Xlate_datap x, BOOL global) +static Xlate_datap find_in_model_xlator(Xlate_datap x, bool global) { Xlate_datap x1 = NULL; @@ -1166,7 +1166,7 @@ static Xlate_datap find_in_model_xlator(Xlate_datap x, BOOL global) } static void add_delays_to_model_xlator(char *delays, - char *utype, char *xspice, char *tmodel, BOOL global) + char *utype, char *xspice, char *tmodel, bool global) { /* Specify xspice as "d_dlatch" or "d_srlatch" for ugff @@ -1194,14 +1194,14 @@ static void add_delays_to_model_xlator(char *delays, } /* classify gate variants */ -static BOOL is_tristate_buf_array(char *itype) +static bool is_tristate_buf_array(char *itype) { if (eq(itype, "buf3a")) { return TRUE; } if (eq(itype, "inv3a")) { return TRUE; } return FALSE; } -static BOOL is_tristate_xor_array(char *itype) +static bool is_tristate_xor_array(char *itype) { /* xor/nxor have vector inputs */ if (eq(itype, "xor3a")) { return TRUE; } @@ -1209,7 +1209,7 @@ static BOOL is_tristate_xor_array(char *itype) return FALSE; } -static BOOL is_tristate_vector_array(char *itype) +static bool is_tristate_vector_array(char *itype) { if (eq(itype, "and3a")) { return TRUE; } if (eq(itype, "nand3a")) { return TRUE; } @@ -1218,7 +1218,7 @@ static BOOL is_tristate_vector_array(char *itype) return FALSE; } -static BOOL is_tristate_array(char *itype) +static bool is_tristate_array(char *itype) { if (is_tristate_buf_array(itype)) { return TRUE; } if (is_tristate_vector_array(itype)) { return TRUE; } @@ -1226,14 +1226,14 @@ static BOOL is_tristate_array(char *itype) return FALSE; } -static BOOL is_buf_tristate(char *itype) +static bool is_buf_tristate(char *itype) { if (eq(itype, "buf3")) { return TRUE; } if (eq(itype, "inv3")) { return TRUE; } return FALSE; } -static BOOL is_xor_tristate(char *itype) +static bool is_xor_tristate(char *itype) { /* xor/nxor have vector inputs */ if (eq(itype, "xor3")) { return TRUE; } @@ -1241,7 +1241,7 @@ static BOOL is_xor_tristate(char *itype) return FALSE; } -static BOOL is_vector_tristate(char *itype) +static bool is_vector_tristate(char *itype) { if (eq(itype, "and3")) { return TRUE; } if (eq(itype, "nand3")) { return TRUE; } @@ -1250,7 +1250,7 @@ static BOOL is_vector_tristate(char *itype) return FALSE; } -static BOOL is_tristate(char *itype) +static bool is_tristate(char *itype) { if (is_buf_tristate(itype)) { return TRUE; } if (is_vector_tristate(itype)) { return TRUE; } @@ -1258,7 +1258,7 @@ static BOOL is_tristate(char *itype) return FALSE; } -static BOOL is_vector_gate_array(char *itype) +static bool is_vector_gate_array(char *itype) { if (eq(itype, "anda")) { return TRUE; } if (eq(itype, "nanda")) { return TRUE; } @@ -1267,14 +1267,14 @@ static BOOL is_vector_gate_array(char *itype) return FALSE; } -static BOOL is_buf_gate_array(char *itype) +static bool is_buf_gate_array(char *itype) { if (eq(itype, "bufa")) { return TRUE; } if (eq(itype, "inva")) { return TRUE; } return FALSE; } -static BOOL is_xor_gate_array(char *itype) +static bool is_xor_gate_array(char *itype) { /* xor/nxor have vector inputs */ if (eq(itype, "xora")) { return TRUE; } @@ -1282,7 +1282,7 @@ static BOOL is_xor_gate_array(char *itype) return FALSE; } -static BOOL is_gate_array(char *itype) +static bool is_gate_array(char *itype) { if (is_vector_gate_array(itype)) { return TRUE; } if (is_buf_gate_array(itype)) { return TRUE; } @@ -1290,7 +1290,7 @@ static BOOL is_gate_array(char *itype) return FALSE; } -static BOOL is_vector_gate(char *itype) +static bool is_vector_gate(char *itype) { if (eq(itype, "nand")) { return TRUE; } if (eq(itype, "and")) { return TRUE; } @@ -1299,14 +1299,14 @@ static BOOL is_vector_gate(char *itype) return FALSE; } -static BOOL is_buf_gate(char *itype) +static bool is_buf_gate(char *itype) { if (eq(itype, "inv")) { return TRUE; } if (eq(itype, "buf")) { return TRUE; } return FALSE; } -static BOOL is_xor_gate(char *itype) +static bool is_xor_gate(char *itype) { /* xor/nxor have vector inputs */ if (eq(itype, "xor")) { return TRUE; } @@ -1314,7 +1314,7 @@ static BOOL is_xor_gate(char *itype) return FALSE; } -static BOOL is_gate(char *itype) +static bool is_gate(char *itype) { if (is_vector_gate(itype)) { return TRUE; } if (is_buf_gate(itype)) { return TRUE; } @@ -1322,7 +1322,7 @@ static BOOL is_gate(char *itype) return FALSE; } -static BOOL is_compound_gate(char *itype) +static bool is_compound_gate(char *itype) { if (eq(itype, "aoi")) { return TRUE; } if (eq(itype, "ao")) { return TRUE; } @@ -1331,7 +1331,7 @@ static BOOL is_compound_gate(char *itype) return FALSE; } -static BOOL has_vector_inputs(char *itype) +static bool has_vector_inputs(char *itype) { switch (itype[0]) { case 'a': { @@ -1766,7 +1766,7 @@ static char *new_inverter(char *iname, char *node, Xlatorp xlp) return tmp; } -static BOOL gen_timing_model( +static bool gen_timing_model( char *tmodel, char *utype, char *xspice, char *newname, Xlatorp xlp) { /* @@ -1779,7 +1779,7 @@ static BOOL gen_timing_model( */ Xlate_datap xin = NULL, xout = NULL, newdata; char *s1; - BOOL retval; + bool retval; if (eq(utype, "ugff")) { xin = create_xlate_model("", utype, xspice, tmodel); @@ -1817,7 +1817,7 @@ static Xlatorp gen_dff_instance(struct dff_instance *ip, int withinv) char *modelnm, *s1; Xlatorp xxp = NULL; Xlate_datap xdata = NULL; - BOOL need_preb_inv = FALSE, need_clrb_inv = FALSE; + bool need_preb_inv = FALSE, need_clrb_inv = FALSE; DS_CREATE(tmpdstr, 128); if (!ip) { @@ -1929,7 +1929,7 @@ static Xlatorp gen_jkff_instance(struct jkff_instance *ip, int withinv) char *modelnm, *s1; Xlatorp xxp = NULL; Xlate_datap xdata = NULL; - BOOL need_preb_inv = FALSE, need_clrb_inv = FALSE; + bool need_preb_inv = FALSE, need_clrb_inv = FALSE; DS_CREATE(tmpdstr, 128); if (!ip) { @@ -2048,7 +2048,7 @@ static Xlatorp gen_dltch_instance(struct dltch_instance *ip, int withinv) char *modelnm, *s1, *s2, *s3; Xlatorp xxp = NULL; Xlate_datap xdata = NULL; - BOOL need_preb_inv = FALSE, need_clrb_inv = FALSE; + bool need_preb_inv = FALSE, need_clrb_inv = FALSE; if (!ip) { return NULL; } itype = ip->hdrp->instance_type; @@ -2163,7 +2163,7 @@ static Xlatorp gen_srff_instance(struct srff_instance *srffp, int withinv) char *modelnm, *s1, *s2, *s3; Xlatorp xxp = NULL; Xlate_datap xdata = NULL; - BOOL need_preb_inv = FALSE, need_clrb_inv = FALSE; + bool need_preb_inv = FALSE, need_clrb_inv = FALSE; if (!srffp) { return NULL; } itype = srffp->hdrp->instance_type; @@ -2429,17 +2429,17 @@ static Xlatorp gen_gate_instance(struct gate_instance *gip) { char **inarr, **outarr, *itype, *iname, *enable, *tmodel; char *xspice = NULL, *connector = NULL; - BOOL vector = FALSE, tristate_gate = FALSE, simple_gate = FALSE; - BOOL tristate_array = FALSE; - BOOL add_tristate = FALSE; + bool vector = FALSE, tristate_gate = FALSE, simple_gate = FALSE; + bool tristate_array = FALSE; + bool add_tristate = FALSE; char *modelnm = NULL, *startvec = NULL, *endvec = NULL; char *instance_name = NULL; int i, j, k, width, num_gates, num_ins, num_outs; Xlatorp xxp = NULL; Xlate_datap xdata = NULL; int withinv = ps_with_tri_inverters; - BOOL inv3_to_buf3 = FALSE; - BOOL inv3a_to_buf3a = FALSE; + bool inv3_to_buf3 = FALSE; + bool inv3a_to_buf3a = FALSE; if (!gip) { return NULL; } itype = gip->hdrp->instance_type; @@ -2964,7 +2964,7 @@ static char *select_delay(char *delay1, char *delay2) float val1, val2; char *units1, *units2; char *tmodel = NULL; - BOOL warns = FALSE; + bool warns = FALSE; val1 = strtof(delay1, &units1); val2 = strtof(delay2, &units2); @@ -3014,7 +3014,7 @@ static char *get_delays_ugate(char *rem) { char *rising, *falling, *delays = NULL; struct timing_data *tdp1, *tdp2; - BOOL has_rising = FALSE, has_falling = FALSE; + bool has_rising = FALSE, has_falling = FALSE; tdp1 = create_min_typ_max("tplh", rem); estimate_delay(tdp1); @@ -3070,8 +3070,8 @@ static char *get_delays_utgate(char *rem) struct timing_data *tdp1, *tdp2; struct timing_data *tdp3, *tdp4, *tdp5, *tdp6; char *tplz, *tphz, *tpzl, *tpzh, *select0, *select1, *select2, *select3; - BOOL use_zdelays = FALSE; - BOOL has_rising = FALSE, has_falling = FALSE; + bool use_zdelays = FALSE; + bool has_rising = FALSE, has_falling = FALSE; tdp1 = create_min_typ_max("tplh", rem); estimate_delay(tdp1); @@ -3340,10 +3340,10 @@ static char *get_current_tmodel(void) return current_tmodel; } -static BOOL u_process_model(char *nline, char *original, BOOL global) +static bool u_process_model(char *nline, char *original, bool global) { char *tok, *remainder, *delays = NULL, *utype, *tmodel; - BOOL retval = TRUE; + bool retval = TRUE; /* .model */ tok = strtok(nline, " \t"); @@ -3435,7 +3435,7 @@ static struct dff_instance *add_dff_inout_timing_model( char *name, **arrp; int i, num_gates = hdr->num1; struct dff_instance *dffip = NULL; - BOOL compat = TRUE; + bool compat = TRUE; if (num_gates < 1) { return NULL; } dffip = create_dff_instance(hdr); @@ -3524,7 +3524,7 @@ static struct dltch_instance *add_dltch_inout_timing_model( char *name, **arrp; int i, num_gates = hdr->num1; struct dltch_instance *dlp = NULL; - BOOL compat = TRUE; + bool compat = TRUE; if (num_gates < 1) { return NULL; } dlp = create_dltch_instance(hdr); @@ -3613,7 +3613,7 @@ static struct jkff_instance *add_jkff_inout_timing_model( char *name, **arrp, **arrpk; int i, num_gates = hdr->num1; struct jkff_instance *jkffip = NULL; - BOOL compat = TRUE; + bool compat = TRUE; if (num_gates < 1) { return NULL; } jkffip = create_jkff_instance(hdr); @@ -3711,7 +3711,7 @@ static struct srff_instance *add_srff_inout_timing_model( char *name, **arrp, **arrpr; int i, num_gates = hdr->num1; struct srff_instance *srffp = NULL; - BOOL compat = TRUE; + bool compat = TRUE; if (num_gates < 1) { return NULL; } srffp = create_srff_instance(hdr); @@ -3812,7 +3812,7 @@ static struct compound_instance *add_compound_inout_timing_model( int i, j, k, n1 =hdr->num1, n2 = hdr->num2, inwidth, numgates; struct compound_instance *compi; char **inarr; - BOOL first = TRUE; + bool first = TRUE; if (is_compound_gate(itype)) { inwidth = n1; @@ -3873,7 +3873,7 @@ static struct gate_instance *add_array_inout_timing_model( struct instance_hdr *hdr, char *start) { char *tok, *copyline, *itype = hdr->instance_type; - BOOL first = TRUE, tristate = FALSE; + bool first = TRUE, tristate = FALSE; int i, j, k, n1 =hdr->num1, n2 = hdr->num2, inwidth, numgates; struct gate_instance *gip = NULL; char **inarr = NULL, **outarr = NULL, *name; @@ -3977,7 +3977,7 @@ static struct gate_instance *add_gate_inout_timing_model( { char *tok, *copyline, *itype = hdr->instance_type; int i, n1 = hdr->num1, inwidth; - BOOL first = TRUE, tristate = FALSE; + bool first = TRUE, tristate = FALSE; struct gate_instance *gip = NULL; char **inarr = NULL, **outarr = NULL, *name; @@ -4253,7 +4253,7 @@ static Xlatorp translate_gate(struct instance_hdr *hdr, char *start) return NULL; } -BOOL u_check_instance(char *line) +bool u_check_instance(char *line) { /* Check to see if the U* instance is a type which can be translated. @@ -4358,7 +4358,7 @@ static int remove_optional(DSTRING *dstrp, char *line) Return 0 when no removal was attempted. */ char *s; - BOOL was_space; + bool was_space; if (!ps_global_tmodels || subcircuit_has_no_optional(line)) { return 0; } @@ -4403,13 +4403,13 @@ static int remove_optional(DSTRING *dstrp, char *line) a Pspice u* instance statement with all the '+' continuations added minus the '+'. */ -BOOL u_process_instance(char *nline) +bool u_process_instance(char *nline) { /* Return TRUE if ok */ char *p1, *itype, *xspice; struct instance_hdr *hdr = NULL; Xlatorp xp = NULL; - BOOL behav_ret = TRUE; + bool behav_ret = TRUE; if (ciprefix("x", nline)) { @@ -4536,12 +4536,12 @@ BOOL u_process_instance(char *nline) a Pspice .model timing model statement with all the '+' continuations added minus the '+'. */ -BOOL u_process_model_line(char *line, BOOL global) +bool u_process_model_line(char *line, bool global) { /* Translate a .model line to find the delays */ /* Return TRUE if ok */ char *newline; - BOOL retval; + bool retval; size_t n = strlen(line) - 1; if (n > 0 && line[n] == '\n') line[n] = '\0'; diff --git a/src/frontend/wdisp/wincolor.c b/src/frontend/wdisp/wincolor.c index de53318cf..521a5ced5 100644 --- a/src/frontend/wdisp/wincolor.c +++ b/src/frontend/wdisp/wincolor.c @@ -10,7 +10,6 @@ #include "ngspice/cpextern.h" #include "ngspice/hash.h" #include "ngspice/macros.h" -#undef BOOLEAN #include #include "ngspice/wincolornames.h" #include "ngspice/graph.h" diff --git a/src/frontend/wdisp/windisp.c b/src/frontend/wdisp/windisp.c index ed8bc5a3c..fc4d0610a 100644 --- a/src/frontend/wdisp/windisp.c +++ b/src/frontend/wdisp/windisp.c @@ -21,13 +21,12 @@ #include "windisp.h" /* - * The ngspice.h file included above defines BOOLEAN (via bool.h) and this + * The ngspice.h file included above defines bool (via bool.h) and this * clashes with the definition obtained from windows.h (via winnt.h). - * However, BOOLEAN is not used by this file so we can work round this problem - * by undefining BOOLEAN before including windows.h + * However, bool is not used by this file so we can work round this problem + * by undefining bool before including windows.h * SJB - May 2005 */ -#undef BOOLEAN #define STRICT #include diff --git a/src/frontend/wdisp/winprint.c b/src/frontend/wdisp/winprint.c index 249224cb6..88069121c 100644 --- a/src/frontend/wdisp/winprint.c +++ b/src/frontend/wdisp/winprint.c @@ -14,13 +14,12 @@ #include "ngspice/fteext.h" /* - * The ngspice.h file included above defines BOOLEAN (via bool.h) and this + * The ngspice.h file included above defines bool (via bool.h) and this * clashes with the definition obtained from windows.h (via winnt.h). - * However, BOOLEAN is not used by this file so we can work round this problem - * by undefining BOOLEAN before including windows.h + * However, bool is not used by this file so we can work round this problem + * by undefining bool before including windows.h * SJB - May 2005 */ -#undef BOOLEAN #define STRICT #include @@ -102,7 +101,7 @@ void WPRINT_PrintInit(HWND hwnd) } /* Abort-Procedur zum Drucken */ -BOOL CALLBACK WPRINT_Abort(HDC hdc, int iError) +ABORTPROC CALLBACK WPRINT_Abort(HDC hdc, int iError) { NG_IGNORE(hdc); NG_IGNORE(iError); @@ -111,7 +110,7 @@ BOOL CALLBACK WPRINT_Abort(HDC hdc, int iError) WaitForIdle(); /* Warten */ - return TRUE; + return (ABORTPROC)TRUE; } diff --git a/src/frontend/wdisp/winprint.h b/src/frontend/wdisp/winprint.h index 0c35a7816..d821fcae8 100644 --- a/src/frontend/wdisp/winprint.h +++ b/src/frontend/wdisp/winprint.h @@ -6,7 +6,7 @@ #define ngspice_WINPRINT_H void WPRINT_PrintInit(HWND hwnd); -BOOL CALLBACK WPRINT_Abort( HDC hdc, int iError); +ABORTPROC CALLBACK WPRINT_Abort( HDC hdc, int iError); int WPRINT_Init(void); int WPRINT_NewViewport( GRAPH * graph); int WPRINT_Close(void); diff --git a/src/include/ngspice/bool.h b/src/include/ngspice/bool.h index 7f398d105..9b61007f9 100644 --- a/src/include/ngspice/bool.h +++ b/src/include/ngspice/bool.h @@ -1,17 +1,8 @@ #ifndef ngspice_BOOL_H #define ngspice_BOOL_H -#if defined (__MINGW32__) || defined (_MSC_VER) -#ifndef __cplusplus -typedef int bool; -#endif -#else #include -#endif -typedef int BOOL; - -#define BOOLEAN int #define TRUE 1 #define FALSE 0 #define NO 0 diff --git a/src/include/ngspice/cidersupt.h b/src/include/ngspice/cidersupt.h index 1f13682b8..d7e7f40f4 100644 --- a/src/include/ngspice/cidersupt.h +++ b/src/include/ngspice/cidersupt.h @@ -85,8 +85,8 @@ extern int SUPascRead(const char *, float *, float *, int *, int *); /* externals for misc.c */ extern double guessNewConc(double , double ); extern double lookup(double **, double ); -extern BOOLEAN hasSORConverged(double *, double *, int); -extern BOOLEAN foundError(int ); -extern BOOLEAN compareFiletypeVar(char *); +extern bool hasSORConverged(double *, double *, int); +extern bool foundError(int ); +extern bool compareFiletypeVar(char *); #endif diff --git a/src/include/ngspice/dvec.h b/src/include/ngspice/dvec.h index 558eb6929..91e2bc224 100644 --- a/src/include/ngspice/dvec.h +++ b/src/include/ngspice/dvec.h @@ -6,6 +6,7 @@ #include "ngspice/grid.h" #include "ngspice/sim.h" +#include /* Dvec flags. */ enum dvec_flags { diff --git a/src/include/ngspice/hash.h b/src/include/ngspice/hash.h index 0102927f0..756fc6f00 100644 --- a/src/include/ngspice/hash.h +++ b/src/include/ngspice/hash.h @@ -321,10 +321,10 @@ Function: Returns the table size to the closest power of 2. */ -extern void *_nghash_find(NGHASHPTR hashtable, void * user_key,BOOL *status) ; +extern void *_nghash_find(NGHASHPTR hashtable, void * user_key,bool *status) ; extern void *nghash_find(NGHASHPTR hashtable, void * user_key) ; extern void *nghash_find_again(NGHASHPTR hashtable, void * user_key) ; -extern void *_nghash_find_again(NGHASHPTR hashtable, void * user_key,BOOL *status) ; +extern void *_nghash_find_again(NGHASHPTR hashtable, void * user_key,bool *status) ; extern void *nghash_delete(NGHASHPTR hashtable, void * user_key) ; extern void *nghash_delete_special(NGHASHPTR hashtable, void* user_key); extern void *nghash_insert(NGHASHPTR hashtable, void * user_key, void * data) ; @@ -416,7 +416,7 @@ Function: } */ -extern void *nghash_enumeratek(NGHASHPTR hashtable,void **key_ret,BOOL flag) ; +extern void *nghash_enumeratek(NGHASHPTR hashtable,void **key_ret,bool flag) ; /* Function: Since this is a threaded hash table, we can enumerate the elements of @@ -447,7 +447,7 @@ Function: } */ -extern void *nghash_enumerate(NGHASHPTR hashtable,BOOL flag) ; +extern void *nghash_enumerate(NGHASHPTR hashtable,bool flag) ; /* Function: Like above but we don't return the key. @@ -464,7 +464,7 @@ Function: */ -extern BOOL nghash_deleteItem( NGHASHPTR hashtable, void *key, void *data ) ; +extern bool nghash_deleteItem( NGHASHPTR hashtable, void *key, void *data ) ; /* Function: Delete a specific item in the hash table. Returns true if the item was diff --git a/src/include/ngspice/logicexp.h b/src/include/ngspice/logicexp.h index 8c77e9a09..cb45dcae2 100644 --- a/src/include/ngspice/logicexp.h +++ b/src/include/ngspice/logicexp.h @@ -3,7 +3,7 @@ #ifndef INCLUDED_LOGICEXP_H #define INCLUDED_LOGICEXP_H -BOOL f_logicexp(char *line, int optimize); -BOOL f_pindly(char *line); +bool f_logicexp(char *line, int optimize); +bool f_pindly(char *line); #endif diff --git a/src/include/ngspice/ngspice.h b/src/include/ngspice/ngspice.h index f886a0db0..e228cf2dd 100644 --- a/src/include/ngspice/ngspice.h +++ b/src/include/ngspice/ngspice.h @@ -185,11 +185,6 @@ extern double x_atanh(double); #define popen _popen #define pclose _pclose -// undo a #define bool _Bool in MS Visual Studio 2015 -#if defined(bool) -#undef bool -#endif - // warning C4127: Bedingter Ausdruck ist konstant #pragma warning(disable: 4127) #endif diff --git a/src/include/ngspice/udevices.h b/src/include/ngspice/udevices.h index f496098c5..c48db23a7 100644 --- a/src/include/ngspice/udevices.h +++ b/src/include/ngspice/udevices.h @@ -3,15 +3,15 @@ struct udevices_info { int mntymx; - BOOL shorter_delays; + bool shorter_delays; }; -BOOL u_process_instance(char *line); -BOOL u_process_model_line(char *line, BOOL global); -BOOL u_check_instance(char *line); +bool u_process_instance(char *line); +bool u_process_model_line(char *line, bool global); +bool u_check_instance(char *line); void initialize_udevice(char *subckt_line); struct card *replacement_udevice_cards(void); -void cleanup_udevice(BOOL global); +void cleanup_udevice(bool global); void u_add_instance(char *str); void u_add_logicexp_model(char *tmodel, char *xspice_gate, char *model_name); void u_remember_pin(char *name, int type); diff --git a/src/main.c b/src/main.c index 6367b06ac..71e2c675a 100644 --- a/src/main.c +++ b/src/main.c @@ -135,15 +135,15 @@ double MuLim, MutLim; /* Global debug flags from CIDER, soon they will become * spice variables :) */ -BOOLEAN ONEacDebug = FALSE; -BOOLEAN ONEdcDebug = TRUE; -BOOLEAN ONEtranDebug = TRUE; -BOOLEAN ONEjacDebug = FALSE; +bool ONEacDebug = FALSE; +bool ONEdcDebug = TRUE; +bool ONEtranDebug = TRUE; +bool ONEjacDebug = FALSE; -BOOLEAN TWOacDebug = FALSE; -BOOLEAN TWOdcDebug = TRUE; -BOOLEAN TWOtranDebug = TRUE; -BOOLEAN TWOjacDebug = FALSE; +bool TWOacDebug = FALSE; +bool TWOdcDebug = TRUE; +bool TWOtranDebug = TRUE; +bool TWOjacDebug = FALSE; /* CIDER Global Variable Declarations */ diff --git a/src/maths/misc/bernoull.c b/src/maths/misc/bernoull.c index 24653acc3..a6755d7ec 100644 --- a/src/maths/misc/bernoull.c +++ b/src/maths/misc/bernoull.c @@ -19,7 +19,7 @@ Author: 1987 Kartikeya Mayaram, U. C. Berkeley CAD Group */ void bernoulli (double x, double *pfx, double *pDfxDx, double *pfMx, - double *pDfMxDx, BOOLEAN derivAlso) + double *pDfMxDx, bool derivAlso) { double fx, fMx; double dFxDx = 0.0; diff --git a/src/maths/misc/bernoull.h b/src/maths/misc/bernoull.h index 5a6919cb1..8bb0dd163 100644 --- a/src/maths/misc/bernoull.h +++ b/src/maths/misc/bernoull.h @@ -10,6 +10,6 @@ #define ngspice_BERNOULL_H extern void bernoulli (double, double *, double *, double *, - double *, BOOLEAN); + double *, bool); #endif diff --git a/src/maths/sparse/spdefs.h b/src/maths/sparse/spdefs.h index 9ff853183..e9eb0375b 100644 --- a/src/maths/sparse/spdefs.h +++ b/src/maths/sparse/spdefs.h @@ -53,7 +53,7 @@ /* Begin macros. */ /* Boolean data type */ -#define BOOLEAN int +#define bool int #define NO 0 #define YES 1 diff --git a/src/misc/hash.c b/src/misc/hash.c index e4ee0a96e..d79f70a40 100644 --- a/src/misc/hash.c +++ b/src/misc/hash.c @@ -40,8 +40,8 @@ static NGTABLEPTR _nghash_find_item(NGHASHPTR hhtable,void *user_key,void *data) NGHASHPTR nghash_init_with_parms(nghash_compare_func_t *comp_func, nghash_func_t *hash_func, int num, int max, double growth, NGHASHFLAGS_T flags) { - BOOL unique ; /* entries are to be unique */ - BOOL power_of_two ; /* want hash table power of 2 */ + bool unique ; /* entries are to be unique */ + bool power_of_two ; /* want hash table power of 2 */ NGHASHPTR hashtable ; unique = flags & NGHASH_UNIQUE ; @@ -224,7 +224,7 @@ void nghash_free_string_hashtable(NGHASHPTR hashtable) * Now nghash_search is broken into four routines: nghash_find, * nghash_find_again, nghash_delete, and nghash_insert. ----------------------------------------------------------------- */ -void * _nghash_find(NGHASHPTR hashtable, void * user_key,BOOL *status) +void * _nghash_find(NGHASHPTR hashtable, void * user_key,bool *status) { int ret_code ; unsigned int hsum ; @@ -296,7 +296,7 @@ void * nghash_find(NGHASHPTR hashtable, void * user_key) } /* end nghash_find() */ -void * _nghash_find_again(NGHASHPTR hashtable, void * user_key,BOOL *status) +void * _nghash_find_again(NGHASHPTR hashtable, void * user_key,bool *status) { int ret_code ; /* comparison return code */ NGTABLEPTR curPtr ; /* current hashtable entry */ @@ -629,7 +629,7 @@ static NGTABLEPTR _nghash_find_item(NGHASHPTR htable,void * user_key,void * data -void * nghash_enumeratek(NGHASHPTR htable, void * *key_return, BOOL start_flag) +void * nghash_enumeratek(NGHASHPTR htable, void * *key_return, bool start_flag) { NGTABLEPTR current_spot ; /* current place in threaded list */ @@ -652,7 +652,7 @@ void * nghash_enumeratek(NGHASHPTR htable, void * *key_return, BOOL start_flag) } /* end nghash_enumeratek() */ -void * nghash_enumerate(NGHASHPTR htable,BOOL start_flag) +void * nghash_enumerate(NGHASHPTR htable,bool start_flag) { NGTABLEPTR current_spot ; /* current place in threaded list */ @@ -806,7 +806,7 @@ void nghash_dump(NGHASHPTR htable, void (*print_key) (void *)) * To be useful, unique flag should be off. Otherwise just use nghash_delete. * Returns true if item was deleted. ----------------------------------------------------------------- */ -BOOL nghash_deleteItem(NGHASHPTR hashtable, void * user_key, void * data) +bool nghash_deleteItem(NGHASHPTR hashtable, void * user_key, void * data) { int ret_code ; unsigned long hsum ; @@ -883,7 +883,7 @@ BOOL nghash_deleteItem(NGHASHPTR hashtable, void * user_key, void * data) int nghash_table_size(int minEntries) { int i; - BOOL isPrime; + bool isPrime; int prime; int testPrime; static int primes[PRIMECOUNT] = { diff --git a/src/misc/misc_time.c b/src/misc/misc_time.c index 5c14345fd..d138f0f6c 100644 --- a/src/misc/misc_time.c +++ b/src/misc/misc_time.c @@ -12,13 +12,12 @@ Copyright 1990 Regents of the University of California. All rights reserved. #if defined(HAS_WINGUI) || defined(__MINGW32__) || defined(_MSC_VER) #define WIN32_LEAN_AND_MEAN /* - * The ngspice.h file included above defines BOOLEAN (via bool.h) and this + * The ngspice.h file included above defines bool (via bool.h) and this * clashes with the definition obtained from windows.h (via winnt.h). - * However, BOOLEAN is not used by this file so we can work round this problem - * by undefining BOOLEAN before including windows.h + * However, bool is not used by this file so we can work round this problem + * by undefining bool before including windows.h * SJB - April 2005 */ -#undef BOOLEAN #include #ifndef HAVE_GETTIMEOFDAY #include diff --git a/src/misc/tilde.c b/src/misc/tilde.c index f2e0b0c3c..e0bd2c48b 100644 --- a/src/misc/tilde.c +++ b/src/misc/tilde.c @@ -13,7 +13,6 @@ Modified: 2002 R. Oktas, #endif #ifdef _WIN32 -#undef BOOLEAN #include /* win32 functions */ #include "shlobj.h" /* SHGetFolderPath */ #endif diff --git a/src/misc/util.c b/src/misc/util.c index 0542c35fb..119c3dca9 100644 --- a/src/misc/util.c +++ b/src/misc/util.c @@ -261,7 +261,6 @@ ngdirname(const char *name) /* Replacement for fopen, when using wide chars (utf-16) */ #ifndef EXT_ASC #if defined(__MINGW32__) || defined(_MSC_VER) -#undef BOOLEAN #include FILE * newfopen(const char *fn, const char* md) diff --git a/src/osdi/osdiregistry.c b/src/osdi/osdiregistry.c index d865d7c52..cce8b93c0 100644 --- a/src/osdi/osdiregistry.c +++ b/src/osdi/osdiregistry.c @@ -34,7 +34,6 @@ #else /* ifdef HAS_WINGUI */ -#undef BOOLEAN #include #include #define OPENLIB(path) LoadLibrary(path) diff --git a/src/spicelib/devices/dev.c b/src/spicelib/devices/dev.c index a8e64728e..2a32c3889 100644 --- a/src/spicelib/devices/dev.c +++ b/src/spicelib/devices/dev.c @@ -45,7 +45,6 @@ typedef void * funptr_t; #define FREE_DLERR_MSG(msg) #else /* ifdef HAS_WINGUI */ -#undef BOOLEAN #include #include #include diff --git a/src/spicelib/devices/nbjt/nbjtdump.c b/src/spicelib/devices/nbjt/nbjtdump.c index c78c9f8aa..dc27561c3 100644 --- a/src/spicelib/devices/nbjt/nbjtdump.c +++ b/src/spicelib/devices/nbjt/nbjtdump.c @@ -37,7 +37,7 @@ NBJTdump(GENmodel *inModel, CKTcircuit *ckt) char *prefix; int *state_num; int anyOutput = 0; - BOOLEAN writeAscii = TRUE; + bool writeAscii = TRUE; if (ckt->CKTmode & MODEDCOP) { prefix = "OP"; diff --git a/src/spicelib/devices/nbjt2/nbt2dump.c b/src/spicelib/devices/nbjt2/nbt2dump.c index 4ce4cc614..4df38f5be 100644 --- a/src/spicelib/devices/nbjt2/nbt2dump.c +++ b/src/spicelib/devices/nbjt2/nbt2dump.c @@ -38,7 +38,7 @@ NBJT2dump(GENmodel *inModel, CKTcircuit *ckt) char *prefix; int *state_num; int anyOutput = 0; - BOOLEAN writeAscii = TRUE; + bool writeAscii = TRUE; if (ckt->CKTmode & MODEDCOP) { prefix = "OP"; diff --git a/src/spicelib/devices/numd/numddump.c b/src/spicelib/devices/numd/numddump.c index 25ce945e5..6cae566c9 100644 --- a/src/spicelib/devices/numd/numddump.c +++ b/src/spicelib/devices/numd/numddump.c @@ -37,7 +37,7 @@ NUMDdump(GENmodel *inModel, CKTcircuit *ckt) char *prefix; int *state_num; int anyOutput = 0; - BOOLEAN writeAscii = TRUE; + bool writeAscii = TRUE; if (ckt->CKTmode & MODEDCOP) { prefix = "OP"; diff --git a/src/spicelib/devices/numd2/nud2dump.c b/src/spicelib/devices/numd2/nud2dump.c index 612bd16db..85b24fbd1 100644 --- a/src/spicelib/devices/numd2/nud2dump.c +++ b/src/spicelib/devices/numd2/nud2dump.c @@ -38,7 +38,7 @@ NUMD2dump(GENmodel *inModel, CKTcircuit *ckt) char *prefix; int *state_num; int anyOutput = 0; - BOOLEAN writeAscii = TRUE; + bool writeAscii = TRUE; if (ckt->CKTmode & MODEDCOP) { prefix = "OP"; diff --git a/src/spicelib/devices/numos/nummdump.c b/src/spicelib/devices/numos/nummdump.c index 7fddbaa4a..be0e61c72 100644 --- a/src/spicelib/devices/numos/nummdump.c +++ b/src/spicelib/devices/numos/nummdump.c @@ -38,7 +38,7 @@ NUMOSdump(GENmodel *inModel, CKTcircuit *ckt) char *prefix; int *state_num; int anyOutput = 0; - BOOLEAN writeAscii = TRUE; + bool writeAscii = TRUE; if (ckt->CKTmode & MODEDCOP) { prefix = "OP"; diff --git a/src/winmain.c b/src/winmain.c index 0d4d44e76..d380ff753 100644 --- a/src/winmain.c +++ b/src/winmain.c @@ -124,7 +124,7 @@ static char CRLF[] = {CR, LF, SE}; /* CR/LF */ static int RowHeight = 16; /* Height of line of text */ static int LineHeight = 25; /* Height of input line */ static int VisibleRows = 10; /* Number of visible lines in text window */ -static BOOL DoUpdate = FALSE; /* Update text window */ +static bool DoUpdate = FALSE; /* Update text window */ static WNDPROC swProc = NULL; /* original string window procedure */ static WNDPROC twProc = NULL; /* original text window procedure */ static HFONT efont; /* Font for element windows */ diff --git a/src/xspice/cmpp/cmpp.h b/src/xspice/cmpp/cmpp.h index ff5bd45c2..4cf5d0fa8 100644 --- a/src/xspice/cmpp/cmpp.h +++ b/src/xspice/cmpp/cmpp.h @@ -144,7 +144,7 @@ typedef struct { typedef struct { - bool bvalue; /* For BOOLEAN parameters */ + bool bvalue; /* For bool parameters */ int ivalue; /* For INTEGER parameters */ double rvalue; /* For REAL parameters */ Complex_t cvalue; /* For COMPLEX parameters */ diff --git a/src/xspice/cmpp/file_buffer.h b/src/xspice/cmpp/file_buffer.h index bee1f76fc..9cf8ca415 100644 --- a/src/xspice/cmpp/file_buffer.h +++ b/src/xspice/cmpp/file_buffer.h @@ -1,8 +1,6 @@ #ifndef file_buffer_h_included #define file_buffer_h_included -#include - /* Null-terminated string prefixed by length excluding null */ typedef struct Filebuf_len_str { diff --git a/src/xspice/cmpp/writ_ifs.c b/src/xspice/cmpp/writ_ifs.c index 907451b48..32d1c18ac 100644 --- a/src/xspice/cmpp/writ_ifs.c +++ b/src/xspice/cmpp/writ_ifs.c @@ -337,7 +337,7 @@ static int write_pTable( } if(type == CMPP_BOOLEAN) { - rc |= fprintf(fp, "IF_FLAG"); /* no BOOLEAN in SPICE3 */ + rc |= fprintf(fp, "IF_FLAG"); /* no bool in SPICE3 */ } else if(type == CMPP_INTEGER) { rc |= fprintf(fp, "IF_INTEGER"); @@ -446,7 +446,7 @@ static int write_mPTable( } if (type == CMPP_BOOLEAN) { - rc |= fprintf(fp, "IF_FLAG"); /* no BOOLEAN in SPICE3 */ + rc |= fprintf(fp, "IF_FLAG"); /* no bool in SPICE3 */ } else if (type == CMPP_INTEGER) { rc |= fprintf(fp, "IF_INTEGER"); diff --git a/visualc/src/include/ngspice/config.h b/visualc/src/include/ngspice/config.h index 575a45346..b20ffa1a4 100644 --- a/visualc/src/include/ngspice/config.h +++ b/visualc/src/include/ngspice/config.h @@ -450,7 +450,7 @@ /* Define to 1 if `vfork' works. */ /* #undef HAVE_WORKING_VFORK */ -/* Define to 1 if the system has the type `_Bool'. */ +/* Define to 1 if the system has the type `bool'. */ /* #undef HAVE__BOOL */ /* Define to 1 if you have the header file. */