diff --git a/src/ciderlib/oned/onecond.c b/src/ciderlib/oned/onecond.c index 81d78d25a..093ae8dae 100644 --- a/src/ciderlib/oned/onecond.c +++ b/src/ciderlib/oned/onecond.c @@ -104,10 +104,10 @@ NBJTconductance(ONEdevice *pDevice, BOOLEAN tranAnalysis, double *intCoeff, pNode = pBaseElem->pRightNode; if (pNode->baseType == N_TYPE) { - nConc = *(pDevice->devState0 + pNode->nodeN); + nConc = pDevice->devState0 [pNode->nodeN]; pDevice->rhs[pNode->nEqn] = nConc * pNode->eg; } else if (pNode->baseType == P_TYPE) { - pConc = *(pDevice->devState0 + pNode->nodeP); + pConc = pDevice->devState0 [pNode->nodeP]; pDevice->rhs[pNode->pEqn] = pConc * pNode->eg; } else { printf("NBJTconductance: unknown base type\n"); diff --git a/src/ciderlib/oned/onecont.c b/src/ciderlib/oned/onecont.c index 1d4d99909..a6c81c233 100644 --- a/src/ciderlib/oned/onecont.c +++ b/src/ciderlib/oned/onecont.c @@ -149,9 +149,9 @@ ONE_sysLoad(ONEdevice *pDevice, BOOLEAN tranAnalysis, netConc = pNode->netConc; dNd = 0.0; dNa = 0.0; - psi = *(pDevice->devState0 + pNode->nodePsi); - nConc = *(pDevice->devState0 + pNode->nodeN); - pConc = *(pDevice->devState0 + pNode->nodeP); + psi = pDevice->devState0 [pNode->nodePsi]; + nConc = pDevice->devState0 [pNode->nodeN]; + pConc = pDevice->devState0 [pNode->nodeP]; if (FreezeOut) { @@ -290,9 +290,9 @@ ONE_jacLoad(ONEdevice *pDevice) pEdge = pElem->pEdge; dNd = 0.0; dNa = 0.0; - psi = *(pDevice->devState0 + pNode->nodePsi); - nConc = *(pDevice->devState0 + pNode->nodeN); - pConc = *(pDevice->devState0 + pNode->nodeP); + psi = pDevice->devState0 [pNode->nodePsi]; + nConc = pDevice->devState0 [pNode->nodeN]; + pConc = pDevice->devState0 [pNode->nodeP]; if (FreezeOut) { ONE_freezeOut(pNode, nConc, pConc, &fNd, &fNa, &fdNd, &fdNa); dNd = pNode->nd * fdNd; @@ -418,9 +418,9 @@ ONE_rhsLoad(ONEdevice *pDevice, BOOLEAN tranAnalysis, netConc = pNode->netConc; dNd = 0.0; dNa = 0.0; - psi = *(pDevice->devState0 + pNode->nodePsi); - nConc = *(pDevice->devState0 + pNode->nodeN); - pConc = *(pDevice->devState0 + pNode->nodeP); + psi = pDevice->devState0 [pNode->nodePsi]; + nConc = pDevice->devState0 [pNode->nodeN]; + pConc = pDevice->devState0 [pNode->nodeP]; if (FreezeOut) { ONE_freezeOut(pNode, nConc, pConc, &fNd, &fNa, &fdNd, &fdNa); netConc = pNode->nd * fNd - pNode->na * fNa; @@ -543,10 +543,10 @@ ONE_commonTerms(ONEdevice *pDevice, BOOLEAN currentOnly, } } /* store info in the state tables */ - *(pDevice->devState0 + pNode->nodePsi) = psi; + pDevice->devState0 [pNode->nodePsi] = psi; if (pElem->elemType == SEMICON) { - *(pDevice->devState0 + pNode->nodeN) = nConc; - *(pDevice->devState0 + pNode->nodeP) = pConc; + pDevice->devState0 [pNode->nodeN] = nConc; + pDevice->devState0 [pNode->nodeP] = pConc; if (tranAnalysis && pNode->nodeType != CONTACT) { pNode->dNdT = integrate(pDevice->devStates, info, pNode->nodeN); pNode->dPdT = integrate(pDevice->devStates, info, pNode->nodeP); @@ -568,7 +568,7 @@ ONE_commonTerms(ONEdevice *pDevice, BOOLEAN currentOnly, psi2 = pNode->psi; } pEdge->dPsi = psi2 - psi1; - *(pDevice->devState0 + pEdge->edgeDpsi) = pEdge->dPsi; + pDevice->devState0 [pEdge->edgeDpsi] = pEdge->dPsi; } /* calculate the current densities and mobility values */ for (eIndex = 1; eIndex < pDevice->numNodes; eIndex++) { @@ -579,10 +579,10 @@ ONE_commonTerms(ONEdevice *pDevice, BOOLEAN currentOnly, dPsiP = pEdge->dPsi - pEdge->dVBand; bernoulli(dPsiN, &bPsiN, &dbPsiN, &bMPsiN, &dbMPsiN, !currentOnly); bernoulli(dPsiP, &bPsiP, &dbPsiP, &bMPsiP, &dbMPsiP, !currentOnly); - nC = *(pDevice->devState0 + pElem->pLeftNode->nodeN); - nP1 = *(pDevice->devState0 + pElem->pRightNode->nodeN); - pC = *(pDevice->devState0 + pElem->pLeftNode->nodeP); - pP1 = *(pDevice->devState0 + pElem->pRightNode->nodeP); + nC = pDevice->devState0 [pElem->pLeftNode->nodeN]; + nP1 = pDevice->devState0 [pElem->pRightNode->nodeN]; + pC = pDevice->devState0 [pElem->pLeftNode->nodeP]; + pP1 = pDevice->devState0 [pElem->pRightNode->nodeP]; conc1 = pElem->pLeftNode->totalConc; conc2 = pElem->pRightNode->totalConc; pEdge->jn = (bPsiN * nP1 - bMPsiN * nC); diff --git a/src/ciderlib/oned/onesolve.c b/src/ciderlib/oned/onesolve.c index 4b79b90cd..17950ff3b 100644 --- a/src/ciderlib/oned/onesolve.c +++ b/src/ciderlib/oned/onesolve.c @@ -714,12 +714,12 @@ ONEbiasSolve(ONEdevice *pDevice, int iterationLimit, pNode = pElem->pNodes[index]; if (pNode->nodeType != CONTACT) { pNode->psi = solution[pNode->psiEqn]; - *(pDevice->devState0 + pNode->nodePsi) = pNode->psi; + pDevice->devState0 [pNode->nodePsi] = pNode->psi; if (pElem->elemType == SEMICON) { pNode->nConc = solution[pNode->nEqn]; pNode->pConc = solution[pNode->pEqn]; - *(pDevice->devState0 + pNode->nodeN) = pNode->nConc; - *(pDevice->devState0 + pNode->nodeP) = pNode->pConc; + pDevice->devState0 [pNode->nodeN] = pNode->nConc; + pDevice->devState0 [pNode->nodeP] = pNode->pConc; } } } @@ -894,7 +894,7 @@ ONEpredict(ONEdevice *pDevice, ONEtranInfo *info) for (nIndex = 0; nIndex <= 1; nIndex++) { if (pElem->evalNodes[nIndex]) { pNode = pElem->pNodes[nIndex]; - pNode->psi = *(pDevice->devState1 + pNode->nodePsi); + pNode->psi = pDevice->devState1 [pNode->nodePsi]; if (pElem->elemType == SEMICON && pNode->nodeType != CONTACT) { pNode->nPred = predict(pDevice->devStates, info, pNode->nodeN); pNode->pPred = predict(pDevice->devStates, info, pNode->nodeP); @@ -983,10 +983,10 @@ ONEsaveState(ONEdevice *pDevice) for (nIndex = 0; nIndex <= 1; nIndex++) { if (pElem->evalNodes[nIndex]) { pNode = pElem->pNodes[nIndex]; - pNode->psi = *(pDevice->devState1 + pNode->nodePsi); + pNode->psi = pDevice->devState1 [pNode->nodePsi]; if (pElem->elemType == SEMICON && pNode->nodeType != CONTACT) { - pNode->nConc = *(pDevice->devState1 + pNode->nodeN); - pNode->pConc = *(pDevice->devState1 + pNode->nodeP); + pNode->nConc = pDevice->devState1 [pNode->nodeN]; + pNode->pConc = pDevice->devState1 [pNode->nodeP]; } } } diff --git a/src/ciderlib/support/integuse.c b/src/ciderlib/support/integuse.c index 1c47e6827..8c38d1755 100644 --- a/src/ciderlib/support/integuse.c +++ b/src/ciderlib/support/integuse.c @@ -23,43 +23,43 @@ integrate(double **devStates, TranInfo *info, int qcap ) case BDF: switch( info->order ) { case 1: - value = coeff[0] * (*(devStates[0]+qcap)) + - coeff[1] * (*(devStates[1]+qcap)); + value = coeff[0] * devStates[0][qcap] + + coeff[1] * devStates[1][qcap]; break; case 2: - value = coeff[0] * (*(devStates[0]+qcap)) + - coeff[1] * (*(devStates[1]+qcap)) + - coeff[2] * (*(devStates[2]+qcap)); + value = coeff[0] * devStates[0][qcap] + + coeff[1] * devStates[1][qcap] + + coeff[2] * devStates[2][qcap]; break; case 3: - value = coeff[0] * (*(devStates[0]+qcap)) + - coeff[1] * (*(devStates[1]+qcap)) + - coeff[2] * (*(devStates[2]+qcap)) + - coeff[3] * (*(devStates[3]+qcap)); + value = coeff[0] * devStates[0][qcap] + + coeff[1] * devStates[1][qcap] + + coeff[2] * devStates[2][qcap] + + coeff[3] * devStates[3][qcap]; break; case 4: - value = coeff[0] * (*(devStates[0]+qcap)) + - coeff[1] * (*(devStates[1]+qcap)) + - coeff[2] * (*(devStates[2]+qcap)) + - coeff[3] * (*(devStates[3]+qcap)) + - coeff[4] * (*(devStates[4]+qcap)); + value = coeff[0] * devStates[0][qcap] + + coeff[1] * devStates[1][qcap] + + coeff[2] * devStates[2][qcap] + + coeff[3] * devStates[3][qcap] + + coeff[4] * devStates[4][qcap]; break; case 5: - value = coeff[0] * (*(devStates[0]+qcap)) + - coeff[1] * (*(devStates[1]+qcap)) + - coeff[2] * (*(devStates[2]+qcap)) + - coeff[3] * (*(devStates[3]+qcap)) + - coeff[4] * (*(devStates[4]+qcap)) + - coeff[5] * (*(devStates[5]+qcap)); + value = coeff[0] * devStates[0][qcap] + + coeff[1] * devStates[1][qcap] + + coeff[2] * devStates[2][qcap] + + coeff[3] * devStates[3][qcap] + + coeff[4] * devStates[4][qcap] + + coeff[5] * devStates[5][qcap]; break; case 6: - value = coeff[0] * (*(devStates[0]+qcap)) + - coeff[1] * (*(devStates[1]+qcap)) + - coeff[2] * (*(devStates[2]+qcap)) + - coeff[3] * (*(devStates[3]+qcap)) + - coeff[4] * (*(devStates[4]+qcap)) + - coeff[5] * (*(devStates[5]+qcap)) + - coeff[6] * (*(devStates[6]+qcap)); + value = coeff[0] * devStates[0][qcap] + + coeff[1] * devStates[1][qcap] + + coeff[2] * devStates[2][qcap] + + coeff[3] * devStates[3][qcap] + + coeff[4] * devStates[4][qcap] + + coeff[5] * devStates[5][qcap] + + coeff[6] * devStates[6][qcap]; break; default: printf( "\n integration order %d !! STOP \n", info->order ); @@ -70,15 +70,15 @@ integrate(double **devStates, TranInfo *info, int qcap ) default: switch( info->order ) { case 1: - value = coeff[0] * (*(devStates[0]+qcap)) + - coeff[1] * (*(devStates[1]+qcap)); - *(devStates[0]+ccap) = value; + value = coeff[0] * devStates[0][qcap] + + coeff[1] * devStates[1][qcap]; + devStates[0][ccap] = value; break; case 2: - value = coeff[0] * (*(devStates[0]+qcap)) + - coeff[1] * (*(devStates[1]+qcap)) + - coeff[2] * (*(devStates[1]+ccap)); - *(devStates[0]+ccap) = value; + value = coeff[0] * devStates[0][qcap] + + coeff[1] * devStates[1][qcap] + + coeff[2] * devStates[1][ccap]; + devStates[0][ccap] = value; break; default: printf( "\n integration order %d !! STOP \n", info->order ); @@ -102,43 +102,43 @@ predict(double **devStates, TranInfo *info, int qcap ) case BDF: switch( info->order ) { case 1: - value = coeff[0] * (*(devStates[1]+qcap)) + - coeff[1] * (*(devStates[2]+qcap)); + value = coeff[0] * devStates[1][qcap] + + coeff[1] * devStates[2][qcap]; break; case 2: - value = coeff[0] * (*(devStates[1]+qcap)) + - coeff[1] * (*(devStates[2]+qcap)) + - coeff[2] * (*(devStates[3]+qcap)); + value = coeff[0] * devStates[1][qcap] + + coeff[1] * devStates[2][qcap] + + coeff[2] * devStates[3][qcap]; break; case 3: - value = coeff[0] * (*(devStates[1]+qcap)) + - coeff[1] * (*(devStates[2]+qcap)) + - coeff[2] * (*(devStates[3]+qcap)) + - coeff[3] * (*(devStates[4]+qcap)); + value = coeff[0] * devStates[1][qcap] + + coeff[1] * devStates[2][qcap] + + coeff[2] * devStates[3][qcap] + + coeff[3] * devStates[4][qcap]; break; case 4: - value = coeff[0] * (*(devStates[1]+qcap)) + - coeff[1] * (*(devStates[2]+qcap)) + - coeff[2] * (*(devStates[3]+qcap)) + - coeff[3] * (*(devStates[4]+qcap)) + - coeff[4] * (*(devStates[5]+qcap)); + value = coeff[0] * devStates[1][qcap] + + coeff[1] * devStates[2][qcap] + + coeff[2] * devStates[3][qcap] + + coeff[3] * devStates[4][qcap] + + coeff[4] * devStates[5][qcap]; break; case 5: - value = coeff[0] * (*(devStates[1]+qcap)) + - coeff[1] * (*(devStates[2]+qcap)) + - coeff[2] * (*(devStates[3]+qcap)) + - coeff[3] * (*(devStates[4]+qcap)) + - coeff[4] * (*(devStates[5]+qcap)) + - coeff[5] * (*(devStates[6]+qcap)); + value = coeff[0] * devStates[1][qcap] + + coeff[1] * devStates[2][qcap] + + coeff[2] * devStates[3][qcap] + + coeff[3] * devStates[4][qcap] + + coeff[4] * devStates[5][qcap] + + coeff[5] * devStates[6][qcap]; break; case 6: - value = coeff[0] * (*(devStates[1]+qcap)) + - coeff[1] * (*(devStates[2]+qcap)) + - coeff[2] * (*(devStates[3]+qcap)) + - coeff[3] * (*(devStates[4]+qcap)) + - coeff[4] * (*(devStates[5]+qcap)) + - coeff[5] * (*(devStates[6]+qcap)) + - coeff[6] * (*(devStates[7]+qcap)); + value = coeff[0] * devStates[1][qcap] + + coeff[1] * devStates[2][qcap] + + coeff[2] * devStates[3][qcap] + + coeff[3] * devStates[4][qcap] + + coeff[4] * devStates[5][qcap] + + coeff[5] * devStates[6][qcap] + + coeff[6] * devStates[7][qcap]; break; default: printf( "\n prediction order %d !! STOP \n", info->order ); @@ -149,17 +149,17 @@ predict(double **devStates, TranInfo *info, int qcap ) default: switch( info->order ) { case 1: - value = coeff[0] * (*(devStates[1]+qcap)) + - coeff[1] * (*(devStates[2]+qcap)); + value = coeff[0] * devStates[1][qcap] + + coeff[1] * devStates[2][qcap]; break; case 2: - value = coeff[0] * (*(devStates[1]+qcap)) + - coeff[1] * (*(devStates[2]+qcap)) + - coeff[2] * (*(devStates[3]+qcap)); + value = coeff[0] * devStates[1][qcap] + + coeff[1] * devStates[2][qcap] + + coeff[2] * devStates[3][qcap]; /* - value = coeff[0] * (*(devStates[1]+qcap)) + - coeff[1] * (*(devStates[2]+qcap)) + - coeff[2] * (*(devStates[1]+ccap)); + value = coeff[0] * devStates[1][qcap] + + coeff[1] * devStates[2][qcap] + + coeff[2] * devStates[1][ccap]; */ break; default: @@ -244,37 +244,37 @@ integrateLin(double **devStates, TranInfo *info, int qcap ) case BDF: switch( info->order ) { case 1: - value = coeff[1] * (*(devStates[1]+qcap)); + value = coeff[1] * devStates[1][qcap]; break; case 2: - value = coeff[1] * (*(devStates[1]+qcap)) + - coeff[2] * (*(devStates[2]+qcap)); + value = coeff[1] * devStates[1][qcap] + + coeff[2] * devStates[2][qcap]; break; case 3: - value = coeff[1] * (*(devStates[1]+qcap)) + - coeff[2] * (*(devStates[2]+qcap)) + - coeff[3] * (*(devStates[3]+qcap)); + value = coeff[1] * devStates[1][qcap] + + coeff[2] * devStates[2][qcap] + + coeff[3] * devStates[3][qcap]; break; case 4: - value = coeff[1] * (*(devStates[1]+qcap)) + - coeff[2] * (*(devStates[2]+qcap)) + - coeff[3] * (*(devStates[3]+qcap)) + - coeff[4] * (*(devStates[4]+qcap)); + value = coeff[1] * devStates[1][qcap] + + coeff[2] * devStates[2][qcap] + + coeff[3] * devStates[3][qcap] + + coeff[4] * devStates[4][qcap]; break; case 5: - value = coeff[1] * (*(devStates[1]+qcap)) + - coeff[2] * (*(devStates[2]+qcap)) + - coeff[3] * (*(devStates[3]+qcap)) + - coeff[4] * (*(devStates[4]+qcap)) + - coeff[5] * (*(devStates[5]+qcap)); + value = coeff[1] * devStates[1][qcap] + + coeff[2] * devStates[2][qcap] + + coeff[3] * devStates[3][qcap] + + coeff[4] * devStates[4][qcap] + + coeff[5] * devStates[5][qcap]; break; case 6: - value = coeff[1] * (*(devStates[1]+qcap)) + - coeff[2] * (*(devStates[2]+qcap)) + - coeff[3] * (*(devStates[3]+qcap)) + - coeff[4] * (*(devStates[4]+qcap)) + - coeff[5] * (*(devStates[5]+qcap)) + - coeff[6] * (*(devStates[6]+qcap)); + value = coeff[1] * devStates[1][qcap] + + coeff[2] * devStates[2][qcap] + + coeff[3] * devStates[3][qcap] + + coeff[4] * devStates[4][qcap] + + coeff[5] * devStates[5][qcap] + + coeff[6] * devStates[6][qcap]; break; default: printf( "\n integration order %d !! STOP \n", info->order ); @@ -285,11 +285,11 @@ integrateLin(double **devStates, TranInfo *info, int qcap ) default: switch( info->order ) { case 1: - value = coeff[1] * (*(devStates[1]+qcap)); + value = coeff[1] * devStates[1][qcap]; break; case 2: - value = coeff[1] * (*(devStates[1]+qcap)) + - coeff[2] * (*(devStates[1]+ccap)); + value = coeff[1] * devStates[1][qcap] + + coeff[2] * devStates[1][ccap]; break; default: printf( "\n integration order %d !! STOP \n", info->order ); diff --git a/src/ciderlib/twod/twocont.c b/src/ciderlib/twod/twocont.c index 4750abe4b..d4c1ca060 100644 --- a/src/ciderlib/twod/twocont.c +++ b/src/ciderlib/twod/twocont.c @@ -366,8 +366,8 @@ void *(pNode->fPPsi) -= dy * pHEdge->dJpDpsiP1 + dx * pVEdge->dJpDpsiP1; - nConc = *(pDevice->devState0 + pNode->nodeN); - pConc = *(pDevice->devState0 + pNode->nodeP); + nConc = pDevice->devState0 [pNode->nodeN]; + pConc = pDevice->devState0 [pNode->nodeP]; pRhs[ pNode->psiEqn ] += dxdy * (pNode->netConc + pConc - nConc); /* Handle generation terms */ @@ -725,8 +725,8 @@ void pRhs[ pNode->psiEqn ] += dx * pHEdge->qf; pRhs[ pNode->psiEqn ] += dy * pVEdge->qf; if ( pElem->elemType == SEMICON ) { - nConc = *(pDevice->devState0 + pNode->nodeN); - pConc = *(pDevice->devState0 + pNode->nodeP); + nConc = pDevice->devState0 [pNode->nodeN]; + pConc = pDevice->devState0 [pNode->nodeP]; pRhs[ pNode->psiEqn ] += dxdy * (pNode->netConc + pConc - nConc); /* Handle generation terms */ @@ -842,10 +842,10 @@ void } /* store info in the state tables */ - *(pDevice->devState0 + pNode->nodePsi) = psi; + pDevice->devState0 [pNode->nodePsi] = psi; if ( pElem->elemType == SEMICON ) { - *(pDevice->devState0 + pNode->nodeN) = nConc; - *(pDevice->devState0 + pNode->nodeP) = pConc; + pDevice->devState0 [pNode->nodeN] = nConc; + pDevice->devState0 [pNode->nodeP] = pConc; if ( tranAnalysis && (pNode->nodeType != CONTACT) ) { pNode->dNdT = integrate( pDevice->devStates, info, pNode->nodeN ); pNode->dPdT = integrate( pDevice->devStates, info, pNode->nodeP ); @@ -873,7 +873,7 @@ void } else { pEdge->dPsi = psi1 - psi2; } - *(pDevice->devState0 + pEdge->edgeDpsi) = pEdge->dPsi; + pDevice->devState0 [pEdge->edgeDpsi] = pEdge->dPsi; if ( pElem->elemType == SEMICON ) { /* Calculate weighted driving forces - wdfn & wdfp for the edge */ diff --git a/src/ciderlib/twod/twoncont.c b/src/ciderlib/twod/twoncont.c index 07cad1164..572967d36 100644 --- a/src/ciderlib/twod/twoncont.c +++ b/src/ciderlib/twod/twoncont.c @@ -308,8 +308,8 @@ void pRhs[ pNode->psiEqn ] += dx * pHEdge->qf; pRhs[ pNode->psiEqn ] += dy * pVEdge->qf; if ( pElem->elemType == SEMICON ) { - nConc = *(pDevice->devState0 + pNode->nodeN); - pConc = *(pDevice->devState0 + pNode->nodeP); + nConc = pDevice->devState0 [pNode->nodeN]; + pConc = pDevice->devState0 [pNode->nodeP]; *(pNode->fPsiN) += dxdy; *(pNode->fPsiPsi) += dxdy * pConc; @@ -465,7 +465,7 @@ void } else { pVEdge = pREdge; } - pConc = *(pDevice->devState0 + pNode->nodeP); + pConc = pDevice->devState0 [pNode->nodeP]; *(pNode->fPsiN) += dxdy; *(pNode->fPsiPsi) += dxdy * pConc; *(pNode->fNPsi) -= dy * pHEdge->dJnDpsiP1 + dx * pVEdge->dJnDpsiP1; @@ -613,8 +613,8 @@ void pRhs[ pNode->psiEqn ] += dx * pHEdge->qf; pRhs[ pNode->psiEqn ] += dy * pVEdge->qf; if ( pElem->elemType == SEMICON ) { - nConc = *(pDevice->devState0 + pNode->nodeN); - pConc = *(pDevice->devState0 + pNode->nodeP); + nConc = pDevice->devState0 [pNode->nodeN]; + pConc = pDevice->devState0 [pNode->nodeP]; pRhs[ pNode->psiEqn ] += dxdy * (pNode->netConc + pConc - nConc); /* Handle generation terms */ @@ -718,10 +718,10 @@ void } /* store info in the state tables */ - *(pDevice->devState0 + pNode->nodePsi) = psi; + pDevice->devState0 [pNode->nodePsi] = psi; if ( pElem->elemType == SEMICON ) { - *(pDevice->devState0 + pNode->nodeN) = nConc; - *(pDevice->devState0 + pNode->nodeP) = pConc; + pDevice->devState0 [pNode->nodeN] = nConc; + pDevice->devState0 [pNode->nodeP] = pConc; if ( tranAnalysis && pNode->nodeType != CONTACT ) { pNode->dNdT = integrate( pDevice->devStates, info, pNode->nodeN ); } @@ -748,7 +748,7 @@ void } else { pEdge->dPsi = psi1 - psi2; } - *(pDevice->devState0 + pEdge->edgeDpsi) = pEdge->dPsi; + pDevice->devState0 [pEdge->edgeDpsi] = pEdge->dPsi; if ( pElem->elemType == SEMICON ) { /* Calculate weighted driving forces - wdfn & wdfp for the edge */ diff --git a/src/ciderlib/twod/twopcont.c b/src/ciderlib/twod/twopcont.c index d2aa90b63..e72b6f286 100644 --- a/src/ciderlib/twod/twopcont.c +++ b/src/ciderlib/twod/twopcont.c @@ -307,8 +307,8 @@ void pRhs[ pNode->psiEqn ] += dy * pVEdge->qf; *(pNode->fPsiPsi) += dyOverDx + dxOverDy; if ( pElem->elemType == SEMICON ) { - nConc = *(pDevice->devState0 + pNode->nodeN); - pConc = *(pDevice->devState0 + pNode->nodeP); + nConc = pDevice->devState0 [pNode->nodeN]; + pConc = pDevice->devState0 [pNode->nodeP]; *(pNode->fPsiPsi) += dxdy * nConc; *(pNode->fPsiP) -= dxdy; @@ -463,7 +463,7 @@ void } else { pVEdge = pREdge; } - nConc = *(pDevice->devState0 + pNode->nodeN); + nConc = pDevice->devState0 [pNode->nodeN]; *(pNode->fPsiPsi) += dxdy * nConc; *(pNode->fPsiP) -= dxdy; *(pNode->fPPsi) -= dy * pHEdge->dJpDpsiP1 + dx * pVEdge->dJpDpsiP1; @@ -611,8 +611,8 @@ void pRhs[ pNode->psiEqn ] += dx * pHEdge->qf; pRhs[ pNode->psiEqn ] += dy * pVEdge->qf; if ( pElem->elemType == SEMICON ) { - nConc = *(pDevice->devState0 + pNode->nodeN); - pConc = *(pDevice->devState0 + pNode->nodeP); + nConc = pDevice->devState0 [pNode->nodeN]; + pConc = pDevice->devState0 [pNode->nodeP]; pRhs[ pNode->psiEqn ] += dxdy * (pNode->netConc + pConc - nConc); /* Handle generation terms */ @@ -716,10 +716,10 @@ void } /* store info in the state tables */ - *(pDevice->devState0 + pNode->nodePsi) = psi; + pDevice->devState0 [pNode->nodePsi] = psi; if ( pElem->elemType == SEMICON ) { - *(pDevice->devState0 + pNode->nodeN) = nConc; - *(pDevice->devState0 + pNode->nodeP) = pConc; + pDevice->devState0 [pNode->nodeN] = nConc; + pDevice->devState0 [pNode->nodeP] = pConc; if ( tranAnalysis && pNode->nodeType != CONTACT ) { pNode->dNdT = integrate( pDevice->devStates, info, pNode->nodeN ); pNode->dPdT = integrate( pDevice->devStates, info, pNode->nodeP ); @@ -747,7 +747,7 @@ void } else { pEdge->dPsi = psi1 - psi2; } - *(pDevice->devState0 + pEdge->edgeDpsi) = pEdge->dPsi; + pDevice->devState0 [pEdge->edgeDpsi] = pEdge->dPsi; if ( pElem->elemType == SEMICON ) { /* Calculate weighted driving forces - wdfn & wdfp for the edge */ diff --git a/src/ciderlib/twod/twosolve.c b/src/ciderlib/twod/twosolve.c index 89bb3d234..a08b290dc 100644 --- a/src/ciderlib/twod/twosolve.c +++ b/src/ciderlib/twod/twosolve.c @@ -628,7 +628,7 @@ TWObiasSolve(TWOdevice *pDevice, int iterationLimit, BOOLEAN tranAnalysis, pNode = pElem->pNodes[index]; if (pNode->nodeType != CONTACT) { pNode->psi = pDevice->dcSolution[pNode->psiEqn]; - *(pDevice->devState0 + pNode->nodePsi) = pNode->psi; + pDevice->devState0 [pNode->nodePsi] = pNode->psi; if (pElem->elemType == SEMICON) { if (!OneCarrier) { pNode->nConc = pDevice->dcSolution[pNode->nEqn]; @@ -640,8 +640,8 @@ TWObiasSolve(TWOdevice *pDevice, int iterationLimit, BOOLEAN tranAnalysis, pNode->pConc = pDevice->dcSolution[pNode->pEqn]; pNode->nConc = pNode->nie * exp(pNode->psi - refPsi); } - *(pDevice->devState0 + pNode->nodeN) = pNode->nConc; - *(pDevice->devState0 + pNode->nodeP) = pNode->pConc; + pDevice->devState0 [pNode->nodeN] = pNode->nConc; + pDevice->devState0 [pNode->nodeP] = pNode->pConc; } } } @@ -910,17 +910,17 @@ TWOpredict(TWOdevice *pDevice, TWOtranInfo *info) for (nIndex = 0; nIndex <= 3; nIndex++) { if (pElem->evalNodes[nIndex]) { pNode = pElem->pNodes[nIndex]; - pNode->psi = *(pDevice->devState1 + pNode->nodePsi); + pNode->psi = pDevice->devState1 [pNode->nodePsi]; if ((pElem->elemType == SEMICON) && (pNode->nodeType != CONTACT)) { if (!OneCarrier) { pNode->nPred = predict(pDevice->devStates, info, pNode->nodeN); pNode->pPred = predict(pDevice->devStates, info, pNode->nodeP); } else if (OneCarrier == N_TYPE) { pNode->nPred = predict(pDevice->devStates, info, pNode->nodeN); - pNode->pPred = *(pDevice->devState1 + pNode->nodeP); + pNode->pPred = pDevice->devState1 [pNode->nodeP]; } else if (OneCarrier == P_TYPE) { pNode->pPred = predict(pDevice->devStates, info, pNode->nodeP); - pNode->nPred = *(pDevice->devState1 + pNode->nodeN); + pNode->nPred = pDevice->devState1 [pNode->nodeN]; } pNode->nConc = pNode->nPred; pNode->pConc = pNode->pPred; @@ -1019,10 +1019,10 @@ TWOsaveState(TWOdevice *pDevice) for (nIndex = 0; nIndex <= 3; nIndex++) { if (pElem->evalNodes[nIndex]) { pNode = pElem->pNodes[nIndex]; - pNode->psi = *(pDevice->devState1 + pNode->nodePsi); + pNode->psi = pDevice->devState1 [pNode->nodePsi]; if ((pElem->elemType == SEMICON) && (pNode->nodeType != CONTACT)) { - pNode->nConc = *(pDevice->devState1 + pNode->nodeN); - pNode->pConc = *(pDevice->devState1 + pNode->nodeP); + pNode->nConc = pDevice->devState1 [pNode->nodeN]; + pNode->pConc = pDevice->devState1 [pNode->nodeP]; } } } diff --git a/src/frontend/com_hardcopy.c b/src/frontend/com_hardcopy.c index 8f8552b5d..464d74e9c 100644 --- a/src/frontend/com_hardcopy.c +++ b/src/frontend/com_hardcopy.c @@ -69,9 +69,9 @@ com_hardcopy(wordlist *wl) /* change .tmp to .ps */ psfname = strchr(fname, '.'); if (psfname) { - *(psfname + 1) = 'p'; - *(psfname + 2) = 's'; - *(psfname + 3) = '\0'; + psfname[1] = 'p'; + psfname[2] = 's'; + psfname[3] = '\0'; } else { fname = realloc(fname, strlen(fname)+4); strcat(fname, ".ps"); diff --git a/src/frontend/device.c b/src/frontend/device.c index d8209dbac..31d6bb796 100644 --- a/src/frontend/device.c +++ b/src/frontend/device.c @@ -1333,7 +1333,7 @@ com_alter_common(wordlist *wl, int do_model) /*printf(" returning vector value %g\n", tmp); */ i++; list = TREALLOC(double, list, i); - *(list+i-1) = tmp; + list[i-1] = tmp; tmp = INPevaluate(&xsbuf, &error, 1); } dv->v_realdata = list; diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 4dfe8efbb..c6000edb5 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -579,7 +579,7 @@ inp_readall(FILE *fp, struct line **data, int call_depth, char *dir_name, bool c /* find the true .end command out of .endc, .ends, .endl, .end (comments may follow) */ if (ciprefix(".end", buffer)) - if ((*(buffer+4) == '\0') || (isspace(*(buffer+4)))) { + if ((buffer[4] == '\0') || (isspace(buffer[4]))) { found_end = TRUE; *buffer = '*'; } @@ -976,8 +976,8 @@ inp_fix_gnd_name(struct line *deck) } // replace "?gnd?" by "? 0 ?", ? being a ' ' ',' '(' ')'. while ((gnd = strstr(gnd, "gnd")) != NULL) { - if ((isspace(*(gnd-1)) || *(gnd-1) == '(' || *(gnd-1) == ',') && - (isspace(*(gnd+3)) || *(gnd+3) == ')' || *(gnd+3) == ',')) { + if ((isspace(gnd[-1]) || gnd[-1] == '(' || gnd[-1] == ',') && + (isspace(gnd[3]) || gnd[3] == ')' || gnd[3] == ',')) { memcpy(gnd, " 0 ", 3); } gnd += 3; @@ -1291,11 +1291,11 @@ inp_fix_macro_param_func_paren_io(struct line *begin_card) if (str_ptr) *str_ptr = ' '; str_ptr = card->li_line + 1; - *str_ptr = 'f'; - *(str_ptr+1) = 'u'; - *(str_ptr+2) = 'n'; - *(str_ptr+3) = 'c'; - *(str_ptr+4) = ' '; + str_ptr[0] = 'f'; + str_ptr[1] = 'u'; + str_ptr[2] = 'n'; + str_ptr[3] = 'c'; + str_ptr[4] = ' '; } } } @@ -2432,7 +2432,7 @@ inp_get_params(char *line, char *param_names[], char *param_values[]) while ((equal_ptr = strchr(line, '=')) != NULL) { // check for equality '==' - if (*(equal_ptr+1) == '=') { + if (equal_ptr[1] == '=') { line = equal_ptr+2; continue; } @@ -2469,7 +2469,7 @@ inp_get_params(char *line, char *param_names[], char *param_values[]) *end = '\0'; if (*value != '{' && - !(isdigit(*value) || (*value == '.' && isdigit(*(value+1))))) { + !(isdigit(*value) || (*value == '.' && isdigit(value[1])))) { sprintf(tmp_str, "{%s}", value); value = tmp_str; } @@ -2864,7 +2864,7 @@ inp_do_macro_param_replace(int fcn_number, char *params[]) before = '\0'; else before = *(param_ptr-1); - after = *(param_ptr+strlen(func_params[fcn_number][i])); + after = param_ptr [ strlen(func_params[fcn_number][i]) ]; if (!(is_arith_char(before) || isspace(before) || before == ',' || before == '=' || (param_ptr-1) < curr_ptr) || !(is_arith_char(after) || isspace(after) || @@ -3160,18 +3160,18 @@ inp_fix_param_values(struct line *deck) // special case: .MEASURE {DC|AC|TRAN} result FIND out_variable WHEN out_variable2=out_variable3 // no braces around out_variable3. out_variable3 may be v(...) or i(...) if (ciprefix(".meas", line)) - if (((*(equal_ptr+1) == 'v') || (*(equal_ptr+1) == 'i')) && - (*(equal_ptr+2) == '(')) + if (((equal_ptr[1] == 'v') || (equal_ptr[1] == 'i')) && + (equal_ptr[2] == '(')) { // find closing ')' and skip token v(...) or i(...) - while (*equal_ptr != ')' && *(equal_ptr+1) != '\0') + while (*equal_ptr != ')' && equal_ptr[1] != '\0') equal_ptr++; line = equal_ptr + 1; continue; } // skip over equality '==' - if (*(equal_ptr+1) == '=') { + if (equal_ptr[1] == '=') { line += 2; continue; } @@ -3188,8 +3188,8 @@ inp_fix_param_values(struct line *deck) *beg_of_str == '{' || *beg_of_str == '.' || *beg_of_str == '"' || - (*beg_of_str == '-' && isdigit(*(beg_of_str+1))) || - (*beg_of_str == '-' && *(beg_of_str+1) == '.' && isdigit(*(beg_of_str+2))) || + (*beg_of_str == '-' && isdigit(beg_of_str[1])) || + (*beg_of_str == '-' && beg_of_str[1] == '.' && isdigit(beg_of_str[2])) || ciprefix("true", beg_of_str) || ciprefix("false", beg_of_str)) { @@ -3212,7 +3212,7 @@ inp_fix_param_values(struct line *deck) buffer = TMALLOC(char, strlen(natok) + 4); if (isdigit(*natok) || *natok == '{' || *natok == '.' || - *natok == '"' || (*natok == '-' && isdigit(*(natok+1))) || + *natok == '"' || (*natok == '-' && isdigit(natok[1])) || ciprefix("true", natok) || ciprefix("false", natok) || eq(natok, "<") || eq(natok, ">")) { @@ -3221,8 +3221,8 @@ inp_fix_param_values(struct line *deck) /* < xx and yy > have been dealt with before */ /* */ } else if (strchr(natok, '>')) { - if (isdigit(*natok) || (*natok == '-' && isdigit(*(natok+1)))) { + if (isdigit(*natok) || (*natok == '-' && isdigit(natok[1]))) { (void) sprintf(buffer, "%s", natok); } else { whereisgt = strchr(natok, '>'); @@ -3279,7 +3279,7 @@ inp_fix_param_values(struct line *deck) buffer = TMALLOC(char, strlen(natok) + 4); if (isdigit(*natok) || *natok == '{' || *natok == '.' || - *natok == '"' || (*natok == '-' && isdigit(*(natok+1))) || + *natok == '"' || (*natok == '-' && isdigit(natok[1])) || ciprefix("true", natok) || ciprefix("false", natok)) { (void) sprintf(buffer, "%s", natok); @@ -3386,8 +3386,8 @@ inp_get_param_level(int param_num, char ***depends_on, char **param_names, char int index1 = 0, comp_level = 0, temp_level = 0; int index2 = 0; - if (*(level+param_num) != -1) - return *(level+param_num); + if (level[param_num] != -1) + return level[param_num]; while (depends_on[param_num][index1] != NULL) { index2 = 0; @@ -3406,7 +3406,7 @@ inp_get_param_level(int param_num, char ***depends_on, char **param_names, char comp_level = temp_level; index1++; } - *(level+param_num) = comp_level; + level[param_num] = comp_level; return comp_level; } @@ -3618,9 +3618,9 @@ inp_sort_params(struct line *start_card, struct line *end_card, struct line *car while ((param_ptr = strstr(param_str, param_name)) != NULL) { ioff = (strchr(param_ptr, '}') != NULL ? 1 : 0); /* want prevent wrong memory access below */ /* looking for curly braces or other string limiter */ - if ((!isalnum(*(param_ptr-ioff)) && *(param_ptr-ioff) != '_' && - !isalnum(*(param_ptr+strlen(param_name))) && - *(param_ptr+strlen(param_name)) != '_') || + if ((!isalnum(param_ptr[-ioff]) && param_ptr[-ioff] != '_' && + !isalnum(param_ptr[strlen(param_name)]) && + param_ptr[strlen(param_name)] != '_') || strcmp(param_ptr, param_name) == 0) { /* this are cases without curly braces */ ind = 0; @@ -3946,7 +3946,7 @@ inp_split_multi_param_lines(struct line *deck, int line_num) counter = 0; while ((equal_ptr = strchr(curr_line, '=')) != NULL) { // check for equality '==' - if (*(equal_ptr+1) == '=') { + if (equal_ptr[1] == '=') { curr_line = equal_ptr+2; continue; } @@ -3968,7 +3968,7 @@ inp_split_multi_param_lines(struct line *deck, int line_num) counter = 0; while (curr_line < card->li_line+strlen(card->li_line) && (equal_ptr = strchr(curr_line, '=')) != NULL) { // check for equality '==' - if (*(equal_ptr+1) == '=') { + if (equal_ptr[1] == '=') { curr_line = equal_ptr+2; continue; } @@ -4134,11 +4134,11 @@ inp_compat(struct line *deck) --> Exxx n1 n2 vol={equation} */ if ((str_ptr = strstr(curr_line, "value=")) != NULL) { - *str_ptr = ' '; - *(str_ptr + 1) = ' '; - *(str_ptr + 2) = 'v'; - *(str_ptr + 3) = 'o'; - *(str_ptr + 4) = 'l'; + str_ptr[0] = ' '; + str_ptr[1] = ' '; + str_ptr[2] = 'v'; + str_ptr[3] = 'o'; + str_ptr[4] = 'l'; } /* Exxx n1 n2 TABLE {expression} = (x0, y0) (x1, y1) (x2, y2) --> @@ -4326,11 +4326,11 @@ inp_compat(struct line *deck) --> Gxxx n1 n2 cur={equation} */ if ((str_ptr = strstr(curr_line, "value=")) != NULL) { - *str_ptr = ' '; - *(str_ptr + 1) = ' '; - *(str_ptr + 2) = 'c'; - *(str_ptr + 3) = 'u'; - *(str_ptr + 4) = 'r'; + str_ptr[0] = ' '; + str_ptr[1] = ' '; + str_ptr[2] = 'c'; + str_ptr[3] = 'u'; + str_ptr[4] = 'r'; } /* Gxxx n1 n2 TABLE {expression} = (x0, y0) (x1, y1) (x2, y2) @@ -5171,10 +5171,10 @@ replace_token(char *string, char *token, int wherereplace, int total) txfree(gettok(&actstring)); /* If token to be replaced at right position */ if (ciprefix(token, actstring)) { - *actstring = ' '; - *(actstring + 1) = ' '; - *(actstring + 2) = ' '; - *(actstring + 3) = ' '; + actstring[0] = ' '; + actstring[1] = ' '; + actstring[2] = ' '; + actstring[3] = ' '; } } } @@ -5251,7 +5251,7 @@ inp_bsource_compat(struct line *deck) (actchar == '*') || (actchar == '/') || (actchar == '^') || (actchar == '+') || (actchar == '?') || (actchar == ':')) { - if ((actchar == '*') && (*(str_ptr+1) == '*')) { + if ((actchar == '*') && (str_ptr[1] == '*')) { actchar = '^'; str_ptr++; } @@ -5297,7 +5297,7 @@ inp_bsource_compat(struct line *deck) i = 0; } - if (((actchar == 'v') || (actchar == 'i')) && (*(str_ptr+1) == '(')) { + if (((actchar == 'v') || (actchar == 'i')) && (str_ptr[1] == '(')) { while (*str_ptr != ')') { buf[i] = *str_ptr; i++; @@ -5443,7 +5443,7 @@ inp_bsource_compat(struct line *deck) controlled_exit(EXIT_FAILURE); } /* cut the tmp_char after the equal sign */ - *(equal_ptr + 1) = '\0'; + equal_ptr[1] = '\0'; xlen = strlen(tmp_char) + strlen(new_str) + 2; final_str = TMALLOC(char, xlen); sprintf(final_str, "%s %s", tmp_char, new_str); diff --git a/src/frontend/measure.c b/src/frontend/measure.c index d6678f13e..d5f58eccb 100644 --- a/src/frontend/measure.c +++ b/src/frontend/measure.c @@ -69,7 +69,7 @@ com_meas(wordlist *wl) token = wl_index->wl_word; /* find the vector vec_found, next token after each '=' sign. May be in the next wl_word */ - if (*(token + strlen(token) - 1) == '=') { + if (token[strlen(token) - 1] == '=') { wl_index = wl_index->wl_next; vec_found = wl_index->wl_word; /* token may be already a value, maybe 'LAST', which we have to keep, or maybe a vector */ @@ -173,7 +173,7 @@ get_double_value( return_val = FALSE; } else { /* see if '=' is last char of current token -- implies we need to read value in next token */ - if (*(token + strlen(token) - 1) == '=') { + if (token[strlen(token) - 1] == '=') { txfree(token); junk = token = gettok(line); diff --git a/src/frontend/outitf.c b/src/frontend/outitf.c index 045b3c27a..7e3511f69 100644 --- a/src/frontend/outitf.c +++ b/src/frontend/outitf.c @@ -1216,7 +1216,7 @@ OUTerror(int flags, char *format, IFuid *names) fprintf(cp_err, "%s: ", m->string); for (s = format, bptr = buf; *s; s++) { - if (*s == '%' && (s == format || *(s-1) != '%') && *(s+1) == 's') { + if (*s == '%' && (s == format || s[-1] != '%') && s[1] == 's') { if (names[nindex]) strcpy(bptr, names[nindex]); else diff --git a/src/frontend/parser/lexical.c b/src/frontend/parser/lexical.c index 926ba1dd4..ae114e4cc 100644 --- a/src/frontend/parser/lexical.c +++ b/src/frontend/parser/lexical.c @@ -378,7 +378,7 @@ prompt(void) fprintf(cp_out, "%d", cp_event); break; case '\\': - if (*(s + 1)) + if (s[1]) (void) putc(strip(*++s), cp_out); default: (void) putc(strip(*s), cp_out); diff --git a/src/frontend/vectors.c b/src/frontend/vectors.c index 5ddee8142..f57dbf0f5 100644 --- a/src/frontend/vectors.c +++ b/src/frontend/vectors.c @@ -385,7 +385,7 @@ vec_fromplot(char *word, struct plot *plot) /* scanf("%c(%s)" doesn't do what it should do. ) */ if (!d && (sscanf(word, "%c(%s", /* ) */ &cc, buf) == 2) && /* ( */ ((s = strrchr(buf, ')')) != NULL) && - (*(s + 1) == '\0')) { + (s[1] == '\0')) { *s = '\0'; if (prefix("i(", /* ) */ word) || prefix("I(", /* ) */ word)) { /* Spice dependency... */ @@ -581,7 +581,7 @@ vec_get(const char *vec_name) nv = vv->va_vlist; for (i = 1; ; i++) { list = TREALLOC(double, list, i); - *(list+i-1) = nv->va_real; + list[i-1] = nv->va_real; nv = nv->va_next; if (!nv) break; diff --git a/src/main.c b/src/main.c index 7f908acec..99457634e 100644 --- a/src/main.c +++ b/src/main.c @@ -540,7 +540,7 @@ prompt(void) #endif /* HAVE_BSDEDITLINE*/ break; case '\\': - if (*(s + 1)) + if (s[1]) p += sprintf(p, "%c", strip(*++s)); default: *p = (char) strip(*s); ++p; diff --git a/src/maths/ni/niconv.c b/src/maths/ni/niconv.c index 203e65b61..1ca12c82a 100644 --- a/src/maths/ni/niconv.c +++ b/src/maths/ni/niconv.c @@ -29,15 +29,15 @@ NIconvTest(CKTcircuit *ckt) size = SMPmatSize(ckt->CKTmatrix); #ifdef STEPDEBUG for (i=1;i<=size;i++) { - new = *((ckt->CKTrhs) + i ) ; - old = *((ckt->CKTrhsOld) + i ) ; + new = ckt->CKTrhs [i] ; + old = ckt->CKTrhsOld [i] ; printf("chk for convergence: %s new: %g old: %g\n",CKTnodName(ckt,i),new,old); } #endif /* STEPDEBUG */ for (i=1;i<=size;i++) { node = node->next; - new = *((ckt->CKTrhs) + i ) ; - old = *((ckt->CKTrhsOld) + i ) ; + new = ckt->CKTrhs [i] ; + old = ckt->CKTrhsOld [i] ; if(node->type == 3) { tol = ckt->CKTreltol * (MAX(fabs(old),fabs(new))) + ckt->CKTvoltTol; diff --git a/src/maths/ni/niinteg.c b/src/maths/ni/niinteg.c index c3653f5d5..d9ac471eb 100644 --- a/src/maths/ni/niinteg.c +++ b/src/maths/ni/niinteg.c @@ -25,13 +25,13 @@ NIintegrate(CKTcircuit *ckt, double *geq, double *ceq, double cap, int qcap) case TRAPEZOIDAL: switch(ckt->CKTorder) { case 1: - *(ckt->CKTstate0+ccap) = ckt->CKTag[0] * (*(ckt->CKTstate0+qcap)) - + ckt->CKTag[1] * (*(ckt->CKTstate1+qcap)); + ckt->CKTstate0[ccap] = ckt->CKTag[0] * ckt->CKTstate0[qcap] + + ckt->CKTag[1] * ckt->CKTstate1[qcap]; break; case 2: - *(ckt->CKTstate0+ccap) = - *(ckt->CKTstate1+ccap) * ckt->CKTag[1] + + ckt->CKTstate0[ccap] = - ckt->CKTstate1[ccap] * ckt->CKTag[1] + ckt->CKTag[0] * - ( *(ckt->CKTstate0+qcap) - *(ckt->CKTstate1+qcap) ); + ( ckt->CKTstate0[qcap] - ckt->CKTstate1[qcap] ); break; default: errMsg = TMALLOC(char, strlen(ordmsg) + 1); @@ -40,27 +40,27 @@ NIintegrate(CKTcircuit *ckt, double *geq, double *ceq, double cap, int qcap) } break; case GEAR: - *(ckt->CKTstate0+ccap)=0; + ckt->CKTstate0[ccap]=0; switch(ckt->CKTorder) { case 6: - *(ckt->CKTstate0+ccap) += ckt->CKTag[6]* *(ckt->CKTstate6+qcap); + ckt->CKTstate0[ccap] += ckt->CKTag[6]* ckt->CKTstate6[qcap]; /* fall through */ case 5: - *(ckt->CKTstate0+ccap) += ckt->CKTag[5]* *(ckt->CKTstate5+qcap); + ckt->CKTstate0[ccap] += ckt->CKTag[5]* ckt->CKTstate5[qcap]; /* fall through */ case 4: - *(ckt->CKTstate0+ccap) += ckt->CKTag[4]* *(ckt->CKTstate4+qcap); + ckt->CKTstate0[ccap] += ckt->CKTag[4]* ckt->CKTstate4[qcap]; /* fall through */ case 3: - *(ckt->CKTstate0+ccap) += ckt->CKTag[3]* *(ckt->CKTstate3+qcap); + ckt->CKTstate0[ccap] += ckt->CKTag[3]* ckt->CKTstate3[qcap]; /* fall through */ case 2: - *(ckt->CKTstate0+ccap) += ckt->CKTag[2]* *(ckt->CKTstate2+qcap); + ckt->CKTstate0[ccap] += ckt->CKTag[2]* ckt->CKTstate2[qcap]; /* fall through */ case 1: - *(ckt->CKTstate0+ccap) += ckt->CKTag[1]* *(ckt->CKTstate1+qcap); - *(ckt->CKTstate0+ccap) += ckt->CKTag[0]* *(ckt->CKTstate0+qcap); + ckt->CKTstate0[ccap] += ckt->CKTag[1]* ckt->CKTstate1[qcap]; + ckt->CKTstate0[ccap] += ckt->CKTag[0]* ckt->CKTstate0[qcap]; break; default: @@ -74,7 +74,7 @@ NIintegrate(CKTcircuit *ckt, double *geq, double *ceq, double cap, int qcap) strcpy(errMsg,methodmsg); return(E_METHOD); } - *ceq = *(ckt->CKTstate0+ccap) - ckt->CKTag[0] * *(ckt->CKTstate0+qcap); + *ceq = ckt->CKTstate0[ccap] - ckt->CKTag[0] * ckt->CKTstate0[qcap]; *geq = ckt->CKTag[0] * cap; return(OK); } diff --git a/src/maths/ni/niiter.c b/src/maths/ni/niiter.c index 6bb50704c..863685276 100644 --- a/src/maths/ni/niiter.c +++ b/src/maths/ni/niiter.c @@ -163,7 +163,7 @@ NIiter(CKTcircuit *ckt, int maxIter) if(!OldCKTstate0) OldCKTstate0=TMALLOC(double, ckt->CKTnumStates + 1); for(i=0; iCKTnumStates; i++) { - *(OldCKTstate0+i) = *(ckt->CKTstate0+i); + OldCKTstate0[i] = ckt->CKTstate0[i]; } startTime = SPfrontEnd->IFseconds(); @@ -213,8 +213,8 @@ NIiter(CKTcircuit *ckt, int maxIter) maxdiff=0; for (node = ckt->CKTnodes->next; node; node = node->next) { if(node->type == NODE_VOLTAGE) { - diff = (ckt->CKTrhs)[node->number] - - (ckt->CKTrhsOld)[node->number]; + diff = ckt->CKTrhs [node->number] - + ckt->CKTrhsOld [node->number]; if (diff>maxdiff) maxdiff=diff; } } @@ -228,8 +228,8 @@ NIiter(CKTcircuit *ckt, int maxIter) (damp_factor * diff); } for(i=0; iCKTnumStates; i++) { - diff = *(ckt->CKTstate0+i) - *(OldCKTstate0+i); - *(ckt->CKTstate0+i) = *(OldCKTstate0+i) + + diff = ckt->CKTstate0[i] - OldCKTstate0[i]; + ckt->CKTstate0[i] = OldCKTstate0[i] + (damp_factor * diff); } } diff --git a/src/maths/ni/niniter.c b/src/maths/ni/niniter.c index c4f13ebe8..af4dc0bcc 100644 --- a/src/maths/ni/niniter.c +++ b/src/maths/ni/niniter.c @@ -25,12 +25,12 @@ NInzIter(CKTcircuit *ckt, int posDrive, int negDrive) /* clear out the right hand side vector */ for (i = 0; i <= SMPmatSize(ckt->CKTmatrix); i++) { - *((ckt->CKTrhs) + i) = 0.0; - *((ckt->CKTirhs) + i) = 0.0; + ckt->CKTrhs [i] = 0.0; + ckt->CKTirhs [i] = 0.0; } - *((ckt->CKTrhs) + posDrive) = 1.0; /* apply unit current excitation */ - *((ckt->CKTrhs) + negDrive) = -1.0; + ckt->CKTrhs [posDrive] = 1.0; /* apply unit current excitation */ + ckt->CKTrhs [negDrive] = -1.0; SMPcaSolve(ckt->CKTmatrix, ckt->CKTrhs, ckt->CKTirhs, ckt->CKTrhsSpare, ckt->CKTirhsSpare); *ckt->CKTrhs = 0.0; diff --git a/src/ngproc2mod.c b/src/ngproc2mod.c index 4bc13c1bc..521c13b7c 100644 --- a/src/ngproc2mod.c +++ b/src/ngproc2mod.c @@ -104,7 +104,7 @@ main(void) { ncur = TMALLOC(nmod, 1); ncur->nnext = NULL; ncur->nname = typeline; - *(typeline+3) = '\0'; + typeline[3] = '\0'; typeline += 4; getdata(ncur->nparms,69,3); ncur->nnext = nlist; @@ -113,7 +113,7 @@ main(void) { pcur = TMALLOC(pmod, 1); pcur->pnext = NULL; pcur->pname = typeline; - *(typeline+3) = '\0'; + typeline[3] = '\0'; typeline += 4; getdata(pcur->pparms,69,3); pcur->pnext = plist; @@ -122,7 +122,7 @@ main(void) { ycur = TMALLOC(ymod, 1); ycur->ynext = NULL; ycur->yname = typeline; - *(typeline+3) = '\0'; + typeline[3] = '\0'; typeline += 4; getdata(ycur->yparms,10,5); ycur->ynext = ylist; @@ -131,7 +131,7 @@ main(void) { dcur = TMALLOC(dmod, 1); dcur->dnext = NULL; dcur->dname = typeline; - *(typeline+3) = '\0'; + typeline[3] = '\0'; typeline += 4; getdata(dcur->dparms,10,5); dcur->dnext = dlist; @@ -140,7 +140,7 @@ main(void) { mcur = TMALLOC(mmod, 1); mcur->mnext = NULL; mcur->mname = typeline; - *(typeline+3) = '\0'; + typeline[3] = '\0'; typeline += 4; getdata(mcur->mparms,10,5); mcur->mnext = mlist; diff --git a/src/spicelib/analysis/acan.c b/src/spicelib/analysis/acan.c index 79b1d2b2e..b8fc9ed42 100644 --- a/src/spicelib/analysis/acan.c +++ b/src/spicelib/analysis/acan.c @@ -407,8 +407,8 @@ CKTacLoad(CKTcircuit *ckt) startTime = SPfrontEnd->IFseconds(); size = SMPmatSize(ckt->CKTmatrix); for (i=0;i<=size;i++) { - *(ckt->CKTrhs+i)=0; - *(ckt->CKTirhs+i)=0; + ckt->CKTrhs[i]=0; + ckt->CKTirhs[i]=0; } SMPcClear(ckt->CKTmatrix); diff --git a/src/spicelib/analysis/cktbkdum.c b/src/spicelib/analysis/cktbkdum.c index 48727dd2b..b8e595627 100644 --- a/src/spicelib/analysis/cktbkdum.c +++ b/src/spicelib/analysis/cktbkdum.c @@ -19,6 +19,6 @@ CKTbreakDump(CKTcircuit *ckt) { int i; for(i=0;iCKTbreakSize;i++) { - (void)printf("breakpoint table entry %d is %g\n",i,*(ckt->CKTbreaks+i)); + (void)printf("breakpoint table entry %d is %g\n",i,ckt->CKTbreaks[i]); } } diff --git a/src/spicelib/analysis/cktclrbk.c b/src/spicelib/analysis/cktclrbk.c index 3a3995205..edd9d1288 100644 --- a/src/spicelib/analysis/cktclrbk.c +++ b/src/spicelib/analysis/cktclrbk.c @@ -25,14 +25,14 @@ CKTclrBreak(CKTcircuit *ckt) tmp = TMALLOC(double, ckt->CKTbreakSize - 1); if(tmp == NULL) return(E_NOMEM); for(j=1;jCKTbreakSize;j++) { - *(tmp+j-1) = *(ckt->CKTbreaks+j); + tmp[j-1] = ckt->CKTbreaks[j]; } FREE(ckt->CKTbreaks); ckt->CKTbreakSize--; ckt->CKTbreaks=tmp; } else { - *(ckt->CKTbreaks)= *(ckt->CKTbreaks+1); - *(ckt->CKTbreaks+1) = ckt->CKTfinalTime; + ckt->CKTbreaks[0] = ckt->CKTbreaks[1]; + ckt->CKTbreaks[1] = ckt->CKTfinalTime; } return(OK); } diff --git a/src/spicelib/analysis/cktdisto.c b/src/spicelib/analysis/cktdisto.c index 9a54cab83..68c57fd31 100644 --- a/src/spicelib/analysis/cktdisto.c +++ b/src/spicelib/analysis/cktdisto.c @@ -77,8 +77,8 @@ CKTdisto (CKTcircuit *ckt, int mode) size = SMPmatSize(ckt->CKTmatrix); for (i=0;i<=size;i++) { - *(ckt->CKTrhs+i)=0; - *(ckt->CKTirhs+i)=0; + ckt->CKTrhs[i]=0; + ckt->CKTirhs[i]=0; } vcode = CKTtypelook("Vsource"); @@ -111,8 +111,8 @@ else if ((here->VSRCdF2given) && (mode == D_RHSF2)) { if (((here->VSRCdF1given) && (mode == D_RHSF1)) || ((here->VSRCdF2given) && (mode == D_RHSF2))) { - *(ckt->CKTrhs + here->VSRCbranch) = 0.5*mag* cos(M_PI*phase/180.0); - *(ckt->CKTirhs + here->VSRCbranch) = 0.5*mag*sin(M_PI*phase/180.0); + ckt->CKTrhs[here->VSRCbranch] = 0.5*mag* cos(M_PI*phase/180.0); + ckt->CKTirhs[here->VSRCbranch] = 0.5*mag*sin(M_PI*phase/180.0); } @@ -147,13 +147,13 @@ else if ((here->ISRCdF2given) && (mode == D_RHSF2)) { if (((here->ISRCdF1given) && (mode == D_RHSF1)) || ((here->ISRCdF2given) && (mode == D_RHSF2))) { - *(ckt->CKTrhs + here->ISRCposNode) = - 0.5 * mag + ckt->CKTrhs[here->ISRCposNode] = - 0.5 * mag * cos(M_PI*phase/180.0); - *(ckt->CKTrhs + here->ISRCnegNode) = 0.5 * mag * cos( + ckt->CKTrhs[here->ISRCnegNode] = 0.5 * mag * cos( M_PI*phase/180.0); - *(ckt->CKTirhs + here->ISRCposNode) = - 0.5 * mag * sin( + ckt->CKTirhs[here->ISRCposNode] = - 0.5 * mag * sin( M_PI*phase/180.0); - *(ckt->CKTirhs + here->ISRCnegNode) = 0.5 * mag * sin( + ckt->CKTirhs[here->ISRCnegNode] = 0.5 * mag * sin( M_PI*phase/180.0); } } diff --git a/src/spicelib/analysis/cktic.c b/src/spicelib/analysis/cktic.c index 7903a042f..ebf909568 100644 --- a/src/spicelib/analysis/cktic.c +++ b/src/spicelib/analysis/cktic.c @@ -20,7 +20,7 @@ CKTic(CKTcircuit *ckt) size = SMPmatSize(ckt->CKTmatrix); for (i=0;i<=size;i++) { - *(ckt->CKTrhs+i)=0; + ckt->CKTrhs[i]=0; } for(node = ckt->CKTnodes;node != NULL; node = node->next) { @@ -28,7 +28,7 @@ CKTic(CKTcircuit *ckt) node->ptr = SMPmakeElt(ckt->CKTmatrix,node->number,node->number); if(node->ptr == NULL) return(E_NOMEM); ckt->CKThadNodeset = 1; - *(ckt->CKTrhs+node->number) = node->nodeset; + ckt->CKTrhs[node->number] = node->nodeset; } if(node->icGiven) { if(! ( node->ptr)) { @@ -36,7 +36,7 @@ CKTic(CKTcircuit *ckt) node->number); if(node->ptr == NULL) return(E_NOMEM); } - *(ckt->CKTrhs+node->number) = node->ic; + ckt->CKTrhs[node->number] = node->ic; } } diff --git a/src/spicelib/analysis/cktload.c b/src/spicelib/analysis/cktload.c index aeeb9a455..62b6f2a47 100644 --- a/src/spicelib/analysis/cktload.c +++ b/src/spicelib/analysis/cktload.c @@ -51,7 +51,7 @@ CKTload(CKTcircuit *ckt) startTime = SPfrontEnd->IFseconds(); size = SMPmatSize(ckt->CKTmatrix); for (i = 0; i <= size; i++) { - *(ckt->CKTrhs+i) = 0; + ckt->CKTrhs[i] = 0; } SMPclear(ckt->CKTmatrix); #ifdef STEPDEBUG @@ -109,11 +109,11 @@ CKTload(CKTcircuit *ckt) if (node->nsGiven) { if (ZeroNoncurRow(ckt->CKTmatrix, ckt->CKTnodes, node->number)) { - *(ckt->CKTrhs+node->number) = 1.0e10 * node->nodeset * + ckt->CKTrhs[node->number] = 1.0e10 * node->nodeset * ckt->CKTsrcFact; *(node->ptr) = 1e10; } else { - *(ckt->CKTrhs+node->number) = node->nodeset * + ckt->CKTrhs[node->number] = node->nodeset * ckt->CKTsrcFact; *(node->ptr) = 1; } @@ -121,7 +121,7 @@ CKTload(CKTcircuit *ckt) * revert to this. */ /* - * *(ckt->CKTrhs+node->number) += 1.0e10 * node->nodeset; + * ckt->CKTrhs[node->number] += 1.0e10 * node->nodeset; * *(node->ptr) += 1.0e10; */ } @@ -133,23 +133,23 @@ CKTload(CKTcircuit *ckt) if (ZeroNoncurRow(ckt->CKTmatrix, ckt->CKTnodes, node->number)) { /* Original code: - *(ckt->CKTrhs+node->number) += 1.0e10 * node->ic; + ckt->CKTrhs[node->number] += 1.0e10 * node->ic; */ - *(ckt->CKTrhs+node->number) = 1.0e10 * node->ic * + ckt->CKTrhs[node->number] = 1.0e10 * node->ic * ckt->CKTsrcFact; *(node->ptr) += 1.0e10; } else { /* Original code: - *(ckt->CKTrhs+node->number) = node->ic; + ckt->CKTrhs[node->number] = node->ic; */ - *(ckt->CKTrhs+node->number) = node->ic*ckt->CKTsrcFact; /* AlansFixes */ + ckt->CKTrhs[node->number] = node->ic*ckt->CKTsrcFact; /* AlansFixes */ *(node->ptr) = 1; } /* DAG: Original CIDER fix. If above fix doesn't work, * revert to this. */ /* - * *(ckt->CKTrhs+node->number) += 1.0e10 * node->ic; + * ckt->CKTrhs[node->number] += 1.0e10 * node->ic; * *(node->ptr) += 1.0e10; */ } diff --git a/src/spicelib/analysis/cktnames.c b/src/spicelib/analysis/cktnames.c index 78e39d905..9fc145310 100644 --- a/src/spicelib/analysis/cktnames.c +++ b/src/spicelib/analysis/cktnames.c @@ -25,7 +25,7 @@ CKTnames(CKTcircuit *ckt, int *numNames, IFuid **nameList) if ((*nameList) == NULL) return(E_NOMEM); i=0; for (here = ckt->CKTnodes->next; here; here = here->next) { - *((*nameList)+i++) = here->name; + (*nameList) [i++] = here->name; } return(OK); } diff --git a/src/spicelib/analysis/cktncdump.c b/src/spicelib/analysis/cktncdump.c index d836c3d8e..ced915842 100644 --- a/src/spicelib/analysis/cktncdump.c +++ b/src/spicelib/analysis/cktncdump.c @@ -22,8 +22,8 @@ CKTncDump( fprintf(stdout,"%-30s %20s %20s\n", "----", "------------", "-------------"); for(node=ckt->CKTnodes->next;node;node=node->next) { if (strstr(node->name, "#branch") || !strstr(node->name, "#")) { - new = *((ckt->CKTrhsOld) + i ) ; - old = *((ckt->CKTrhs) + i ) ; + new = ckt->CKTrhsOld [i] ; + old = ckt->CKTrhs [i] ; fprintf(stdout,"%-30s %20g %20g", node->name, new, old); if(node->type == 3) { tol = ckt->CKTreltol * (MAX(fabs(old),fabs(new))) + diff --git a/src/spicelib/analysis/cktop.c b/src/spicelib/analysis/cktop.c index 904212a6c..9ce2f7364 100644 --- a/src/spicelib/analysis/cktop.c +++ b/src/spicelib/analysis/cktop.c @@ -154,10 +154,10 @@ dynamic_gmin (CKTcircuit * ckt, long int firstmode, TMALLOC(double, ckt->CKTnumStates + 1); for (n = ckt->CKTnodes; n; n = n->next) - *(ckt->CKTrhsOld + n->number) = 0; + ckt->CKTrhsOld [n->number] = 0; for (i = 0; i < ckt->CKTnumStates; i++) - *(ckt->CKTstate0 + i) = 0; + ckt->CKTstate0 [i] = 0; factor = ckt->CKTgminFactor; OldGmin = 1e-2; @@ -183,12 +183,12 @@ dynamic_gmin (CKTcircuit * ckt, long int firstmode, } else { i = 0; for (n = ckt->CKTnodes; n; n = n->next){ - OldRhsOld[i] = *(ckt->CKTrhsOld + n->number); + OldRhsOld[i] = ckt->CKTrhsOld[n->number]; i++; } for (i = 0; i < ckt->CKTnumStates; i++){ - *(OldCKTstate0 + i) = *(ckt->CKTstate0 + i); + OldCKTstate0[i] = ckt->CKTstate0[i]; } if (iters <= (ckt->CKTdcTrcvMaxIter / 4)){ @@ -224,12 +224,12 @@ dynamic_gmin (CKTcircuit * ckt, long int firstmode, i = 0; for (n = ckt->CKTnodes; n; n = n->next){ - *(ckt->CKTrhsOld + n->number) = OldRhsOld[i]; + ckt->CKTrhsOld[n->number] = OldRhsOld[i]; i++; } for (i = 0; i < ckt->CKTnumStates; i++){ - *(ckt->CKTstate0 + i) = *(OldCKTstate0 + i); + ckt->CKTstate0[i] = OldCKTstate0[i]; } } } @@ -393,10 +393,10 @@ gillespie_src (CKTcircuit * ckt, long int firstmode, TMALLOC(double, ckt->CKTnumStates + 1); for (n = ckt->CKTnodes; n; n = n->next) - *(ckt->CKTrhsOld + n->number) = 0; + ckt->CKTrhsOld[n->number] = 0; for (i = 0; i < ckt->CKTnumStates; i++) - *(ckt->CKTstate0 + i) = 0; + ckt->CKTstate0[i] = 0; /* First, try a straight solution with all sources at zero */ @@ -454,12 +454,12 @@ gillespie_src (CKTcircuit * ckt, long int firstmode, if (converged == 0){ i = 0; for (n = ckt->CKTnodes; n; n = n->next){ - OldRhsOld[i] = *(ckt->CKTrhsOld + n->number); + OldRhsOld[i] = ckt->CKTrhsOld[n->number]; i++; } for (i = 0; i < ckt->CKTnumStates; i++) - *(OldCKTstate0 + i) = *(ckt->CKTstate0 + i); + OldCKTstate0[i] = ckt->CKTstate0[i]; SPfrontEnd->IFerror (ERR_INFO, @@ -491,12 +491,12 @@ gillespie_src (CKTcircuit * ckt, long int firstmode, i = 0; for (n = ckt->CKTnodes; n; n = n->next){ - OldRhsOld[i] = *(ckt->CKTrhsOld + n->number); + OldRhsOld[i] = ckt->CKTrhsOld[n->number]; i++; } for (i = 0; i < ckt->CKTnumStates; i++) - *(OldCKTstate0 + i) = *(ckt->CKTstate0 + i); + OldCKTstate0[i] = ckt->CKTstate0[i]; SPfrontEnd->IFerror (ERR_INFO, "One successful source step", @@ -528,12 +528,12 @@ gillespie_src (CKTcircuit * ckt, long int firstmode, i = 0; for (n = ckt->CKTnodes; n; n = n->next){ - *(ckt->CKTrhsOld + n->number) = OldRhsOld[i]; + ckt->CKTrhsOld[n->number] = OldRhsOld[i]; i++; } for (i = 0; i < ckt->CKTnumStates; i++) - *(ckt->CKTstate0 + i) = *(OldCKTstate0 + i); + ckt->CKTstate0[i] = OldCKTstate0[i]; } diff --git a/src/spicelib/analysis/cktsetbk.c b/src/spicelib/analysis/cktsetbk.c index e881bea95..3aed64f7f 100644 --- a/src/spicelib/analysis/cktsetbk.c +++ b/src/spicelib/analysis/cktsetbk.c @@ -33,18 +33,18 @@ CKTsetBreak(CKTcircuit *ckt, double time) return(E_INTERN); } for(i=0;iCKTbreakSize;i++) { - if(*(ckt->CKTbreaks+i)>time) { /* passed */ - if((*(ckt->CKTbreaks+i)-time) <= ckt->CKTminBreak) { + if(ckt->CKTbreaks[i]>time) { /* passed */ + if((ckt->CKTbreaks[i]-time) <= ckt->CKTminBreak) { /* very close together - take earlier point */ #ifdef TRACE_BREAKPOINT printf("[t:%e] \t %e replaces %e\n", ckt->CKTtime, time, - *(ckt->CKTbreaks+i)); + ckt->CKTbreaks[i]); CKTbreakDump(ckt); #endif - *(ckt->CKTbreaks+i) = time; + ckt->CKTbreaks[i] = time; return(OK); } - if(i>0 && time-*(ckt->CKTbreaks+i-1) <= ckt->CKTminBreak) { + if(i>0 && time-ckt->CKTbreaks[i-1] <= ckt->CKTminBreak) { /* very close together, but after, so skip */ #ifdef TRACE_BREAKPOINT printf("[t:%e] \t %e skipped\n", ckt->CKTtime, time); @@ -56,15 +56,15 @@ CKTsetBreak(CKTcircuit *ckt, double time) tmp = TMALLOC(double, ckt->CKTbreakSize + 1); if(tmp == NULL) return(E_NOMEM); for(j=0;jCKTbreaks+j); + tmp[j] = ckt->CKTbreaks[j]; } - *(tmp+i)=time; + tmp[i]=time; #ifdef TRACE_BREAKPOINT printf("[t:%e] \t %e added\n", ckt->CKTtime, time); CKTbreakDump(ckt); #endif for(j=i;jCKTbreakSize;j++) { - *(tmp+j+1) = *(ckt->CKTbreaks+j); + tmp[j+1] = ckt->CKTbreaks[j]; } FREE(ckt->CKTbreaks); ckt->CKTbreakSize++; diff --git a/src/spicelib/analysis/cktterr.c b/src/spicelib/analysis/cktterr.c index 0a7bd4098..9852b2acf 100644 --- a/src/spicelib/analysis/cktterr.c +++ b/src/spicelib/analysis/cktterr.c @@ -35,14 +35,14 @@ CKTterr(int qcap, CKTcircuit *ckt, double *timeStep) }; volttol = ckt->CKTabstol + ckt->CKTreltol * - MAX( fabs(*(ckt->CKTstate0+ccap)), fabs(*(ckt->CKTstate1+ccap))); + MAX( fabs(ckt->CKTstate0[ccap]), fabs(ckt->CKTstate1[ccap])); - chargetol = MAX(fabs(*(ckt->CKTstate0 +qcap)),fabs(*(ckt->CKTstate1+qcap))); + chargetol = MAX(fabs(ckt->CKTstate0[qcap]),fabs(ckt->CKTstate1[qcap])); chargetol = ckt->CKTreltol * MAX(chargetol,ckt->CKTchgtol)/ckt->CKTdelta; tol = MAX(volttol,chargetol); /* now divided differences */ for(i=ckt->CKTorder+1;i>=0;i--) { - diff[i] = *(ckt->CKTstates[i] + qcap); + diff[i] = ckt->CKTstates[i][qcap]; } for(i=0 ; i <= ckt->CKTorder ; i++) { deltmp[i] = ckt->CKTdeltaOld[i]; diff --git a/src/spicelib/analysis/dcop.c b/src/spicelib/analysis/dcop.c index 791090a30..82bf758be 100644 --- a/src/spicelib/analysis/dcop.c +++ b/src/spicelib/analysis/dcop.c @@ -92,8 +92,8 @@ DCop(CKTcircuit *ckt, int notused) "-------------"); for(node=ckt->CKTnodes->next;node;node=node->next) { if (strstr(node->name, "#branch") || !strstr(node->name, "#")) { - new = *((ckt->CKTrhsOld) + i ) ; - old = *((ckt->CKTrhs) + i ) ; + new = ckt->CKTrhsOld [i] ; + old = ckt->CKTrhs [i] ; fprintf(stdout,"%-30s %20g %20g", node->name, new, old); if(node->type == 3) { tol = ckt->CKTreltol * (MAX(fabs(old),fabs(new))) + @@ -131,7 +131,7 @@ DCop(CKTcircuit *ckt, int notused) ckt->CKTsenInfo->SENmode = DCSEN; size = SMPmatSize(ckt->CKTmatrix); for(i = 1; i<=size ; i++){ - *(ckt->CKTrhsOp + i) = *(ckt->CKTrhsOld + i); + ckt->CKTrhsOp[i] = ckt->CKTrhsOld[i]; } if(error = CKTsenDCtran(ckt)) return(error); ckt->CKTmode = save; diff --git a/src/spicelib/analysis/dcpss.c b/src/spicelib/analysis/dcpss.c index e26d67e8b..71602e663 100644 --- a/src/spicelib/analysis/dcpss.c +++ b/src/spicelib/analysis/dcpss.c @@ -305,8 +305,8 @@ DCpss(CKTcircuit *ckt, "-------------"); for(node=ckt->CKTnodes->next;node;node=node->next) { if (strstr(node->name, "#branch") || !strstr(node->name, "#")) { - new = *((ckt->CKTrhsOld) + i ) ; - old = *((ckt->CKTrhs) + i ) ; + new = ckt->CKTrhsOld [i] ; + old = ckt->CKTrhs [i] ; fprintf(stdout,"%-30s %20g %20g", node->name, new, old); if(node->type == 3) { tol = ckt->CKTreltol * (MAX(fabs(old),fabs(new))) + diff --git a/src/spicelib/analysis/dctran.c b/src/spicelib/analysis/dctran.c index f4ed6074c..43bf9e616 100644 --- a/src/spicelib/analysis/dctran.c +++ b/src/spicelib/analysis/dctran.c @@ -234,8 +234,8 @@ DCtran(CKTcircuit *ckt, "-------------"); for(node=ckt->CKTnodes->next;node;node=node->next) { if (strstr(node->name, "#branch") || !strstr(node->name, "#")) { - new = *((ckt->CKTrhsOld) + i ) ; - old = *((ckt->CKTrhs) + i ) ; + new = ckt->CKTrhsOld [i] ; + old = ckt->CKTrhs [i] ; fprintf(stdout,"%-30s %20g %20g", node->name, new, old); if(node->type == 3) { tol = ckt->CKTreltol * (MAX(fabs(old),fabs(new))) + diff --git a/src/spicelib/analysis/distoan.c b/src/spicelib/analysis/distoan.c index 62dd6263b..b28564230 100644 --- a/src/spicelib/analysis/distoan.c +++ b/src/spicelib/analysis/distoan.c @@ -529,11 +529,11 @@ time1 = SPfrontEnd->IFseconds(); } for (i=0; i< displacement ; i++) { - DkerProc(D_TWOF1,*(job->r2H11stor + i), - *(job->i2H11stor + i), + DkerProc(D_TWOF1,job->r2H11stor[i], + job->i2H11stor[i], size, job); - ckt->CKTrhsOld = *((job->r2H11stor) + i); - ckt->CKTirhsOld = *((job->i2H11stor) + i); + ckt->CKTrhsOld = job->r2H11stor[i]; + ckt->CKTirhsOld = job->i2H11stor[i]; error = CKTacDump(ckt,ckt->CKTrhsOld[0],acPlot); if(error) return(error); } @@ -551,11 +551,11 @@ time1 = SPfrontEnd->IFseconds(); numNames, nameList, IF_COMPLEX, &acPlot); for (i=0; i< displacement ; i++) { - DkerProc(D_THRF1,*(job->r3H11stor + i), - *(job->i3H11stor + i), + DkerProc(D_THRF1,job->r3H11stor[i], + job->i3H11stor[i], size, job); - ckt->CKTrhsOld = *((job->r3H11stor) + i); - ckt->CKTirhsOld = *((job->i3H11stor) + i); + ckt->CKTrhsOld = job->r3H11stor[i]; + ckt->CKTirhsOld = job->i3H11stor[i]; error = CKTacDump(ckt,ckt->CKTrhsOld[0],acPlot); } SPfrontEnd->OUTendPlot (acPlot); @@ -575,11 +575,11 @@ time1 = SPfrontEnd->IFseconds(); numNames, nameList, IF_COMPLEX, &acPlot); for (i=0; i< displacement ; i++) { - DkerProc(D_F1PF2,*(job->r2H12stor + i), - *(job->i2H12stor + i), + DkerProc(D_F1PF2,job->r2H12stor[i], + job->i2H12stor[i], size, job); - ckt->CKTrhsOld = *((job->r2H12stor) + i); - ckt->CKTirhsOld = *((job->i2H12stor) + i); + ckt->CKTrhsOld = job->r2H12stor[i]; + ckt->CKTirhsOld = job->i2H12stor[i]; error = CKTacDump(ckt,ckt->CKTrhsOld[0],acPlot); if(error) return(error); } @@ -598,11 +598,11 @@ time1 = SPfrontEnd->IFseconds(); for (i=0; i< displacement ; i++) { DkerProc(D_F1MF2, - *(job->r2H1m2stor + i), - *(job->i2H1m2stor + i), + job->r2H1m2stor[i], + job->i2H1m2stor[i], size, job); - ckt->CKTrhsOld = *((job->r2H1m2stor) + i); - ckt->CKTirhsOld = *((job->i2H1m2stor) + i); + ckt->CKTrhsOld = job->r2H1m2stor[i]; + ckt->CKTirhsOld = job->i2H1m2stor[i]; error = CKTacDump(ckt,ckt->CKTrhsOld[0],acPlot); if(error) return(error); } @@ -621,11 +621,11 @@ time1 = SPfrontEnd->IFseconds(); for (i=0; i< displacement ; i++) { DkerProc(D_2F1MF2, - *(job->r3H1m2stor + i), - *(job->i3H1m2stor + i), + job->r3H1m2stor[i], + job->i3H1m2stor[i], size, job); - ckt->CKTrhsOld = *((job->r3H1m2stor) + i); - ckt->CKTirhsOld = *((job->i3H1m2stor) + i); + ckt->CKTrhsOld = job->r3H1m2stor[i]; + ckt->CKTirhsOld = job->i3H1m2stor[i]; error = CKTacDump(ckt,ckt->CKTrhsOld[0],acPlot); if(error) return(error); } diff --git a/src/spicelib/analysis/nevalsrc.c b/src/spicelib/analysis/nevalsrc.c index ff4c76cd8..d7edc8895 100644 --- a/src/spicelib/analysis/nevalsrc.c +++ b/src/spicelib/analysis/nevalsrc.c @@ -28,8 +28,8 @@ NevalSrc (double *noise, double *lnNoise, CKTcircuit *ckt, int type, int node1, double imagVal; double gain; - realVal = *((ckt->CKTrhs) + node1) - *((ckt->CKTrhs) + node2); - imagVal = *((ckt->CKTirhs) + node1) - *((ckt->CKTirhs) + node2); + realVal = ckt->CKTrhs [node1] - ckt->CKTrhs [node2]; + imagVal = ckt->CKTirhs [node1] - ckt->CKTirhs [node2]; gain = (realVal*realVal) + (imagVal*imagVal); switch (type) { @@ -87,10 +87,10 @@ double phi21) /* Phase of signal 2 relative to signal 1 */ double realOut, imagOut, param_gain; double T0, T1, T2, T3; - realVal1 = *((ckt->CKTrhs) + node1) - *((ckt->CKTrhs) + node2); - imagVal1 = *((ckt->CKTirhs) + node1) - *((ckt->CKTirhs) + node2); - realVal2 = *((ckt->CKTrhs) + node3) - *((ckt->CKTrhs) + node4); - imagVal2 = *((ckt->CKTirhs) + node3) - *((ckt->CKTirhs) + node4); + realVal1 = ckt->CKTrhs [node1] - ckt->CKTrhs [node2]; + imagVal1 = ckt->CKTirhs [node1] - ckt->CKTirhs [node2]; + realVal2 = ckt->CKTrhs [node3] - ckt->CKTrhs [node4]; + imagVal2 = ckt->CKTirhs [node3] - ckt->CKTirhs [node4]; T0 = sqrt(param1); T1 = sqrt(param2); T2 = T1 * cos(phi21); @@ -134,8 +134,8 @@ NevalSrcInstanceTemp (double *noise, double *lnNoise, CKTcircuit *ckt, int type, double imagVal; double gain; - realVal = *((ckt->CKTrhs) + node1) - *((ckt->CKTrhs) + node2); - imagVal = *((ckt->CKTirhs) + node1) - *((ckt->CKTirhs) + node2); + realVal = ckt->CKTrhs [node1] - ckt->CKTrhs [node2]; + imagVal = ckt->CKTirhs [node1] - ckt->CKTirhs [node2]; gain = (realVal*realVal) + (imagVal*imagVal); switch (type) { diff --git a/src/spicelib/analysis/noisean.c b/src/spicelib/analysis/noisean.c index 13973dd55..06a2ae81c 100644 --- a/src/spicelib/analysis/noisean.c +++ b/src/spicelib/analysis/noisean.c @@ -206,10 +206,10 @@ NOISEan (CKTcircuit *ckt, int restart) */ NIacIter(ckt); - realVal = *((ckt->CKTrhsOld) + posOutNode) - - *((ckt->CKTrhsOld) + negOutNode); - imagVal = *((ckt->CKTirhsOld) + posOutNode) - - *((ckt->CKTirhsOld) + negOutNode); + realVal = ckt->CKTrhsOld [posOutNode] + - ckt->CKTrhsOld [negOutNode]; + imagVal = ckt->CKTirhsOld [posOutNode] + - ckt->CKTirhsOld [negOutNode]; data->GainSqInv = 1.0 / MAX(((realVal*realVal) + (imagVal*imagVal)),N_MINGAIN); data->lnGainInv = log(data->GainSqInv); diff --git a/src/spicelib/parser/inpeval.c b/src/spicelib/parser/inpeval.c index 843bf5cc5..6f6ab1787 100644 --- a/src/spicelib/parser/inpeval.c +++ b/src/spicelib/parser/inpeval.c @@ -171,10 +171,10 @@ double INPevaluate(char **line, int *error, int gobble) case 'M': { /* special case for m - may be m or mil or meg */ - if (*(here + 1) != 0 && *(here + 2) != 0) { + if (here[1] != 0 && here[2] != 0) { /* at least 2 characters, so check them. */ - if ((*(here + 1) == 'E') || (*(here + 1) == 'e')) { - if ((*(here + 2) == 'G') || (*(here + 2) == 'g')) { + if ((here[1] == 'E') || (here[1] == 'e')) { + if ((here[2] == 'G') || (here[2] == 'g')) { expo1 = expo1 + 6; if (gobble) { FREE(token); @@ -185,8 +185,8 @@ double INPevaluate(char **line, int *error, int gobble) pow(10.0, (double) (expo1 + expsgn * expo2))); } - } else if ((*(here + 1) == 'I') || (*(here + 1) == 'i')) { - if ((*(here + 2) == 'L') || (*(here + 2) == 'l')) { + } else if ((here[1] == 'I') || (here[1] == 'i')) { + if ((here[2] == 'L') || (here[2] == 'l')) { expo1 = expo1 - 6; mantis = mantis * 25.4; if (gobble) { diff --git a/src/spicelib/parser/inpgval.c b/src/spicelib/parser/inpgval.c index 6143738d3..1ae446f73 100644 --- a/src/spicelib/parser/inpgval.c +++ b/src/spicelib/parser/inpgval.c @@ -38,7 +38,7 @@ IFvalue *INPgetValue(CKTcircuit *ckt, char **line, int type, INPtables * tab) temp.v.numValue++; list = TREALLOC(double, list, temp.v.numValue); - *(list + temp.v.numValue - 1) = tmp; + list[temp.v.numValue - 1] = tmp; tmp = INPevaluate(line, &error, 1); } temp.v.vec.rVec = list; @@ -51,7 +51,7 @@ IFvalue *INPgetValue(CKTcircuit *ckt, char **line, int type, INPtables * tab) temp.v.numValue++; ilist = TREALLOC(int, ilist, temp.v.numValue); - *(ilist + temp.v.numValue - 1) = (int) floor(0.5 + tmp); + ilist[temp.v.numValue - 1] = (int) floor(0.5 + tmp); tmp = INPevaluate(line, &error, 1); } temp.v.vec.iVec = ilist; diff --git a/src/unsupported/cktsncom.c b/src/unsupported/cktsncom.c index 0e68d79f5..619b31f40 100644 --- a/src/unsupported/cktsncom.c +++ b/src/unsupported/cktsncom.c @@ -50,15 +50,15 @@ register CKTcircuit *ckt; for (col=1;col<=info->SENparms;col++) { for(row=1;row<=size;row++){ - *(ckt->CKTsenRhs + row ) = *(info->SEN_RHS[row] + col); + ckt->CKTsenRhs[row] = info->SEN_RHS[row][col]; } /* solve for the sensitivity values */ SMPsolve(ckt->CKTmatrix,ckt->CKTsenRhs,ckt->CKTrhsSpare); /* store the sensitivity values */ for(row=1;row<=size;row++){ - *(info->SEN_Sap[row] + col) = *(ckt->CKTsenRhs+row); - *(info->SEN_RHS[row] + col) = *(ckt->CKTsenRhs+row); + info->SEN_Sap[row][col] = ckt->CKTsenRhs[row]; + info->SEN_RHS[row][col] = ckt->CKTsenRhs[row]; } } #ifdef SENSDEBUG @@ -71,7 +71,7 @@ register CKTcircuit *ckt; for (col=1;col<=info->SENparms;col++) { printf("\t"); printf("Sap(%s,%d) = %.5e\t",rowe,col, - *(info->SEN_Sap[row] + col)); + info->SEN_Sap[row][col]); } printf("\n\n"); } @@ -82,7 +82,7 @@ register CKTcircuit *ckt; for (col=1;col<=info->SENparms;col++) { printf(" "); printf("RHS(%d,%d) = %.7e ",row,col, - *(info->SEN_RHS[row] + col)); + info->SEN_RHS[row][col]); } printf("\n"); } @@ -112,8 +112,8 @@ register CKTcircuit *ckt; for (col=1;col<=info->SENparms;col++) { for(row=1;row<=size;row++){ - *(ckt->CKTsenRhs+row) = *(info->SEN_RHS[row] + col); - *(ckt->CKTseniRhs+row) = *(info->SEN_iRHS[row] + col); + ckt->CKTsenRhs[row] = info->SEN_RHS[row][col]; + ckt->CKTseniRhs[row] = info->SEN_iRHS[row][col]; } /* solve for the sensitivity values ( both real and imag parts)*/ @@ -122,8 +122,8 @@ register CKTcircuit *ckt; /* store the sensitivity values ( both real and imag parts)*/ for(row=1;row<=size;row++){ - *(info->SEN_RHS[row] + col) = *(ckt->CKTsenRhs+row); - *(info->SEN_iRHS[row] + col) = *(ckt->CKTseniRhs+row); + info->SEN_RHS[row][col] = ckt->CKTsenRhs[row]; + info->SEN_iRHS[row][col] = ckt->CKTseniRhs[row]; } } #ifdef SENSDEBUG @@ -135,8 +135,8 @@ register CKTcircuit *ckt; for (col=1;col<=info->SENparms;col++) { printf("\t"); printf("RHS(%s,%d) = %.5e",rowe,col, - *(info->SEN_RHS[row] + col)); - printf(" + j %.5e\t",*(info->SEN_iRHS[row] + col)); + info->SEN_RHS[row][col]); + printf(" + j %.5e\t",info->SEN_iRHS[row][col]); printf("\n\n"); } @@ -150,8 +150,8 @@ register CKTcircuit *ckt; for (col=1;col<=info->SENparms;col++) { printf(" "); printf("RHS(%d,%d) = %.7e ",row,col, - *(info->SEN_RHS[row] + col)); - printf("+j %.7e ",*(info->SEN_iRHS[row] + col)); + info->SEN_RHS[row][col]); + printf("+j %.7e ",info->SEN_iRHS[row][col]); } printf("\n"); } diff --git a/src/unsupported/cktsnld.c b/src/unsupported/cktsnld.c index 556e4b8a4..57e7ce436 100644 --- a/src/unsupported/cktsnld.c +++ b/src/unsupported/cktsnld.c @@ -39,7 +39,7 @@ register CKTcircuit *ckt; (ckt->CKTsenInfo->SENmode == TRANSEN)) { for (col=0;col<=ckt->CKTsenInfo->SENparms;col++) { for(row=0;row<=size;row++){ - *(ckt->CKTsenInfo->SEN_RHS[row] + col)= 0; + ckt->CKTsenInfo->SEN_RHS[row][col]= 0; } } for (i=0;iCKTsenInfo->SENparms;col++) { for(row=0;row<=size;row++){ - *(ckt->CKTsenInfo->SEN_RHS[row] + col)= 0; - *(ckt->CKTsenInfo->SEN_iRHS[row] + col)= 0; + ckt->CKTsenInfo->SEN_RHS[row][col]= 0; + ckt->CKTsenInfo->SEN_iRHS[row][col]= 0; } } for (i=0;iSENparmNames = TREALLOC(char *, ((SENstruct *)anal)->SENparmNames, ((SENstruct *)anal)->SENnumVal) ; if( ((SENstruct *)anal)->SENparmNames == NULL) return(E_NOMEM); } - *(((SENstruct *)anal)->SENdevices+((SENstruct *)anal)->SENnumVal-1)= + ((SENstruct *)anal)->SENdevices [ ((SENstruct *)anal)->SENnumVal - 1 ] = value->sValue; break; case SEN_PARM: - *(((SENstruct *)anal)->SENparmNames+((SENstruct *)anal)->SENnumVal-1)= + ((SENstruct *)anal)->SENparmNames [ ((SENstruct *)anal)->SENnumVal - 1 ] = value->sValue; break; diff --git a/src/unsupported/snstart.c b/src/unsupported/snstart.c index 54e3993da..79449259c 100644 --- a/src/unsupported/snstart.c +++ b/src/unsupported/snstart.c @@ -39,13 +39,13 @@ SENstartup(ckt) type = -1; fast = NULL; err = CKTfndDev((GENERIC*)ckt,&type,(GENERIC**)&fast, - (*((ckt->CKTsenInfo->SENdevices)+i)), + ((ckt->CKTsenInfo->SENdevices)[i]), NULL, NULL); if(err != OK) return(err); err = CKTpName( - (*((ckt->CKTsenInfo->SENparmNames)+i)), + ((ckt->CKTsenInfo->SENparmNames)[i]), &parmtemp,ckt ,type, - (*((ckt->CKTsenInfo->SENdevices)+i)), + ((ckt->CKTsenInfo->SENdevices)[i]), &fast); if(err != OK) return(err); } diff --git a/src/xspice/cm/cmutil.c b/src/xspice/cm/cmutil.c index b0a919046..0dc7f40bd 100644 --- a/src/xspice/cm/cmutil.c +++ b/src/xspice/cm/cmutil.c @@ -383,17 +383,17 @@ double cm_smooth_pwl(double x_input, double *x, double *y, int size, /* Determine segment boundaries within which x_input resides */ - if (x_input <= (*(x+1) + *x)/2.0) {/*** x_input below lowest midpoint ***/ - *dout_din = (*(y+1) - *y)/(*(x+1) - *x); + if (x_input <= (x[1] + x[0])/2.0) {/*** x_input below lowest midpoint ***/ + *dout_din = (y[1] - y[0])/(x[1] - x[0]); out = *y + (x_input - *x) * *dout_din; return out; } else { - if (x_input >= (*(x+size-2) + *(x+size-1))/2.0) { + if (x_input >= (x[size-2] + x[size-1])/2.0) { /*** x_input above highest midpoint ***/ - *dout_din = (*(y+size-1) - *(y+size-2)) / - (*(x+size-1) - *(x+size-2)); - out = *(y+size-1) + (x_input - *(x+size-1)) * *dout_din; + *dout_din = (y[size-1] - y[size-2]) / + (x[size-1] - x[size-2]); + out = y[size-1] + (x_input - x[size-1]) * *dout_din; return out; } else { /*** x_input within bounds of end midpoints... ***/ @@ -402,11 +402,11 @@ double cm_smooth_pwl(double x_input, double *x, double *y, int size, for (i=1; i= *(x+cntl_size-1)) { - dout_din = (*(y+cntl_size-1) - *(y+cntl_size-2)) / - (*(x+cntl_size-1) - *(x+cntl_size-2)); - pw = *(y+cntl_size-1) + (cntl_input - *(x+cntl_size-1)) * dout_din; + if (cntl_input >= x[cntl_size-1]) { + dout_din = (y[cntl_size-1] - y[cntl_size-2]) / + (x[cntl_size-1] - x[cntl_size-2]); + pw = y[cntl_size-1] + (cntl_input - x[cntl_size-1]) * dout_din; } else { /*** cntl_input within bounds of end midpoints... @@ -386,10 +386,10 @@ void cm_oneshot(ARGS) /* structure holding parms, calculate required output. ***/ for (i=0; i= *(x+i))) { + if ((cntl_input < x[i+1]) && (cntl_input >= x[i])) { /* Interpolate to get the correct pulse width value */ - pw = ((cntl_input - *(x+i))/(*(x+i+1) - *(x+i)))* - (*(y+i+1)-*(y+i)) + *(y+i); + pw = ((cntl_input - x[i])/(x[i+1] - x[i]))* + (y[i+1]-y[i]) + y[i]; } } } diff --git a/src/xspice/icm/analog/sine/cfunc.mod b/src/xspice/icm/analog/sine/cfunc.mod index c9f299c23..76187da08 100644 --- a/src/xspice/icm/analog/sine/cfunc.mod +++ b/src/xspice/icm/analog/sine/cfunc.mod @@ -215,8 +215,8 @@ void cm_sine(ARGS) /* structure holding parms, /* Retrieve x and y values. */ for (i=0; i= *(x+cntl_size-1)){ - dout_din = (*(y+cntl_size-1) - *(y+cntl_size-2)) / - (*(x+cntl_size-1) - *(x+cntl_size-2)); - freq = *(y+cntl_size-1) + (cntl_input - *(x+cntl_size-1)) * dout_din; + if (cntl_input >= x[cntl_size-1]){ + dout_din = (y[cntl_size-1] - y[cntl_size-2]) / + (x[cntl_size-1] - x[cntl_size-2]); + freq = y[cntl_size-1] + (cntl_input - x[cntl_size-1]) * dout_din; } else { /*** cntl_input within bounds of end midpoints... must determine position progressively & then @@ -251,12 +251,12 @@ void cm_sine(ARGS) /* structure holding parms, for (i=0; i= *(x+i))) { + if ((cntl_input < x[i+1]) && (cntl_input >= x[i])) { /* Interpolate to the correct frequency value */ - freq = ((cntl_input - *(x+i))/(*(x+i+1) - *(x+i)))* - (*(y+i+1)-*(y+i)) + *(y+i); + freq = ((cntl_input - x[i])/(x[i+1] - x[i]))* + (y[i+1]-y[i]) + y[i]; } } diff --git a/src/xspice/icm/analog/square/cfunc.mod b/src/xspice/icm/analog/square/cfunc.mod index 2ef1d9399..32bbd8426 100644 --- a/src/xspice/icm/analog/square/cfunc.mod +++ b/src/xspice/icm/analog/square/cfunc.mod @@ -283,8 +283,8 @@ void cm_square(ARGS) /* structure holding parms, /* Retrieve x and y values. */ for (i=0; i= *(x+cntl_size-1)) { - dout_din = (*(y+cntl_size-1) - *(y+cntl_size-2)) / - (*(x+cntl_size-1) - *(x+cntl_size-2)); - freq = *(y+cntl_size-1) + (cntl_input - *(x+cntl_size-1)) * dout_din; - /* freq = *(y+cntl_size-1); */ + } else if (cntl_input >= x[cntl_size-1]) { + dout_din = (y[cntl_size-1] - y[cntl_size-2]) / + (x[cntl_size-1] - x[cntl_size-2]); + freq = y[cntl_size-1] + (cntl_input - x[cntl_size-1]) * dout_din; + /* freq = y[cntl_size-1]; */ } else { /*** cntl_input within bounds of end midpoints... @@ -315,12 +315,12 @@ void cm_square(ARGS) /* structure holding parms, for (i=0; i= *(x+i))) { + if ((cntl_input < x[i+1]) && (cntl_input >= x[i])) { /* Interpolate to the correct frequency value */ - freq = ((cntl_input - *(x+i))/(*(x+i+1) - *(x+i)))* - (*(y+i+1)-*(y+i)) + *(y+i); + freq = ((cntl_input - x[i])/(x[i+1] - x[i]))* + (y[i+1]-y[i]) + y[i]; } } diff --git a/src/xspice/icm/analog/triangle/cfunc.mod b/src/xspice/icm/analog/triangle/cfunc.mod index 13d648bb3..16c4bec66 100644 --- a/src/xspice/icm/analog/triangle/cfunc.mod +++ b/src/xspice/icm/analog/triangle/cfunc.mod @@ -272,8 +272,8 @@ void cm_triangle(ARGS) /* structure holding parms, /* Retrieve x and y values. */ for (i=0; i= *(x+cntl_size-1)) { - dout_din = (*(y+cntl_size-1) - *(y+cntl_size-2)) / - (*(x+cntl_size-1) - *(x+cntl_size-2)); - freq = *(y+cntl_size-1) + (cntl_input - *(x+cntl_size-1)) * dout_din; - /* freq = *(y+cntl_size-1); */ + if (cntl_input >= x[cntl_size-1]) { + dout_din = (y[cntl_size-1] - y[cntl_size-2]) / + (x[cntl_size-1] - x[cntl_size-2]); + freq = y[cntl_size-1] + (cntl_input - x[cntl_size-1]) * dout_din; + /* freq = y[cntl_size-1]; */ } else { /*** cntl_input within bounds of end midpoints... @@ -308,12 +308,12 @@ void cm_triangle(ARGS) /* structure holding parms, for (i=0; i= *(x+i))) { + if ((cntl_input < x[i+1]) && (cntl_input >= x[i])) { /* Interpolate to the correct frequency value */ - freq = ((cntl_input - *(x+i))/(*(x+i+1) - *(x+i)))* - (*(y+i+1)-*(y+i)) + *(y+i); + freq = ((cntl_input - x[i])/(x[i+1] - x[i]))* + (y[i+1]-y[i]) + y[i]; } } } diff --git a/src/xspice/icm/xtradev/core/cfunc.mod b/src/xspice/icm/xtradev/core/cfunc.mod index 406d551e7..1b0235511 100644 --- a/src/xspice/icm/xtradev/core/cfunc.mod +++ b/src/xspice/icm/xtradev/core/cfunc.mod @@ -306,8 +306,8 @@ void cm_core(ARGS) /* structure holding parms, /* Retrieve H and B values. */ for (i=0; i= (*(H+size-2) + *(H+size-1))/2.0) { + if (H_input >= (H[size-2] + H[size-1])/2.0) { /*** H_input above highest midpoint ***/ - dout_din = (*(B+size-1) - *(B+size-2)) / - (*(H+size-1) - *(H+size-2)); - B_out = *(B+size-1) + (H_input - *(H+size-1)) * dout_din; + dout_din = (B[size-1] - B[size-2]) / + (H[size-1] - H[size-2]); + B_out = B[size-1] + (H_input - H[size-1]) * dout_din; } else { /*** H_input within bounds of end midpoints... ***/ /*** must determine position progressively & then ***/ /*** calculate required output. ***/ for (i=1; iCKTmode & MODEINITTRAN) || (ckt->CKTmode & MODEINITPRED)) /* first iteration step at timepoint */ - fast->input.rvalue = *(ckt->CKTstate1 + fast->old_input); + fast->input.rvalue = ckt->CKTstate1[fast->old_input]; else { /* subsequent iterations */ @@ -369,7 +369,7 @@ MIFload( } /* end else */ /* Save value of input for use with MODEINITTRAN */ - *(ckt->CKTstate0 + fast->old_input) = fast->input.rvalue; + ckt->CKTstate0[fast->old_input] = fast->input.rvalue; } /* end else analog type */ } /* end for number of ports */ @@ -599,27 +599,27 @@ MIFload( switch(cntl_src_type) { case MIF_VCVS: if(anal_type == MIF_AC) { - *(smp_ptr->e.branch_poscntl) -= ac_gain.real; - *(smp_ptr->e.branch_negcntl) += ac_gain.real; - *(smp_ptr->e.branch_poscntl+1) -= ac_gain.imag; - *(smp_ptr->e.branch_negcntl+1) += ac_gain.imag; + smp_ptr->e.branch_poscntl[0] -= ac_gain.real; + smp_ptr->e.branch_negcntl[0] += ac_gain.real; + smp_ptr->e.branch_poscntl[1] -= ac_gain.imag; + smp_ptr->e.branch_negcntl[1] += ac_gain.imag; } else { - *(smp_ptr->e.branch_poscntl) -= partial; - *(smp_ptr->e.branch_negcntl) += partial; + smp_ptr->e.branch_poscntl[0] -= partial; + smp_ptr->e.branch_negcntl[0] += partial; rhs[smp_data_out->branch] -= partial * cntl_input; } break; case MIF_ICIS: if(anal_type == MIF_AC) { - *(smp_ptr->f.pos_ibranchcntl) += ac_gain.real; - *(smp_ptr->f.neg_ibranchcntl) -= ac_gain.real; - *(smp_ptr->f.pos_ibranchcntl+1) += ac_gain.imag; - *(smp_ptr->f.neg_ibranchcntl+1) -= ac_gain.imag; + smp_ptr->f.pos_ibranchcntl[0] += ac_gain.real; + smp_ptr->f.neg_ibranchcntl[0] -= ac_gain.real; + smp_ptr->f.pos_ibranchcntl[1] += ac_gain.imag; + smp_ptr->f.neg_ibranchcntl[1] -= ac_gain.imag; } else { - *(smp_ptr->f.pos_ibranchcntl) += partial; - *(smp_ptr->f.neg_ibranchcntl) -= partial; + smp_ptr->f.pos_ibranchcntl[0] += partial; + smp_ptr->f.neg_ibranchcntl[0] -= partial; temp = partial * cntl_input; rhs[smp_data_out->pos_node] += temp; rhs[smp_data_out->neg_node] -= temp; @@ -627,20 +627,20 @@ MIFload( break; case MIF_VCIS: if(anal_type == MIF_AC) { - *(smp_ptr->g.pos_poscntl) += ac_gain.real; - *(smp_ptr->g.pos_negcntl) -= ac_gain.real; - *(smp_ptr->g.neg_poscntl) -= ac_gain.real; - *(smp_ptr->g.neg_negcntl) += ac_gain.real; - *(smp_ptr->g.pos_poscntl+1) += ac_gain.imag; - *(smp_ptr->g.pos_negcntl+1) -= ac_gain.imag; - *(smp_ptr->g.neg_poscntl+1) -= ac_gain.imag; - *(smp_ptr->g.neg_negcntl+1) += ac_gain.imag; + smp_ptr->g.pos_poscntl[0] += ac_gain.real; + smp_ptr->g.pos_negcntl[0] -= ac_gain.real; + smp_ptr->g.neg_poscntl[0] -= ac_gain.real; + smp_ptr->g.neg_negcntl[0] += ac_gain.real; + smp_ptr->g.pos_poscntl[1] += ac_gain.imag; + smp_ptr->g.pos_negcntl[1] -= ac_gain.imag; + smp_ptr->g.neg_poscntl[1] -= ac_gain.imag; + smp_ptr->g.neg_negcntl[1] += ac_gain.imag; } else { - *(smp_ptr->g.pos_poscntl) += partial; - *(smp_ptr->g.pos_negcntl) -= partial; - *(smp_ptr->g.neg_poscntl) -= partial; - *(smp_ptr->g.neg_negcntl) += partial; + smp_ptr->g.pos_poscntl[0] += partial; + smp_ptr->g.pos_negcntl[0] -= partial; + smp_ptr->g.neg_poscntl[0] -= partial; + smp_ptr->g.neg_negcntl[0] += partial; temp = partial * cntl_input; rhs[smp_data_out->pos_node] += temp; rhs[smp_data_out->neg_node] -= temp; @@ -648,11 +648,11 @@ MIFload( break; case MIF_ICVS: if(anal_type == MIF_AC) { - *(smp_ptr->h.branch_ibranchcntl) -= ac_gain.real; - *(smp_ptr->h.branch_ibranchcntl+1) -= ac_gain.imag; + smp_ptr->h.branch_ibranchcntl[0] -= ac_gain.real; + smp_ptr->h.branch_ibranchcntl[1] -= ac_gain.imag; } else { - *(smp_ptr->h.branch_ibranchcntl) -= partial; + smp_ptr->h.branch_ibranchcntl[0] -= partial; rhs[smp_data_out->branch] -= partial * cntl_input; } break; diff --git a/src/xspice/mif/miftrunc.c b/src/xspice/mif/miftrunc.c index ba69706fd..99ed55379 100644 --- a/src/xspice/mif/miftrunc.c +++ b/src/xspice/mif/miftrunc.c @@ -172,7 +172,7 @@ static void MIFterr( /* Old code */ /* volttol = ckt->CKTabstol + ckt->CKTreltol * - MAX( fabs(*(ckt->CKTstate0+ccap)), fabs(*(ckt->CKTstate1+ccap))); + MAX( fabs(ckt->CKTstate0[ccap]), fabs(ckt->CKTstate1[ccap])); */ /* New code */