From 0cf889d59082ab00cb786269de06e482c2e9b86e Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 13 Aug 2011 16:13:16 +0000 Subject: [PATCH] twoprint.c, swallow warnings --- ChangeLog | 4 ++++ src/ciderlib/twod/twoprint.c | 15 ++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 748c3a499..dfd14f232 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-08-13 Robert Larice + * src/ciderlib/twod/twoprint.c : + twoprint.c, swallow warnings + 2011-08-13 Robert Larice * src/frontend/parse-bison.c , * src/frontend/parse-bison.h , diff --git a/src/ciderlib/twod/twoprint.c b/src/ciderlib/twod/twoprint.c index c5f175d38..9fdca12ab 100644 --- a/src/ciderlib/twod/twoprint.c +++ b/src/ciderlib/twod/twoprint.c @@ -27,7 +27,6 @@ TWOprnSolution(FILE *file, TWOdevice *pDevice, OUTPcard *output) int numVars = 0; TWOnode ***nodeArray = NULL; TWOnode *pNode; - TWOelem *pElem; TWOmaterial *info; double data[50]; double ex, ey, refPsi = 0.0, eGap, dGap; @@ -36,7 +35,6 @@ TWOprnSolution(FILE *file, TWOdevice *pDevice, OUTPcard *output) double jcy, jdy, jny, jpy, jty; double *xScale = pDevice->xScale; double *yScale = pDevice->yScale; - BOOLEAN foundElem; if (output->OUTPnumVars == -1) { /* First pass. Need to count number of variables in output. */ @@ -109,12 +107,12 @@ TWOprnSolution(FILE *file, TWOdevice *pDevice, OUTPcard *output) /* store the nodes in this work array and print out later */ for (xIndex = 1; xIndex < pDevice->numXNodes; xIndex++) { for (yIndex = 1; yIndex < pDevice->numYNodes; yIndex++) { - pElem = pDevice->elemArray[xIndex][yIndex]; + TWOelem *pElem = pDevice->elemArray[xIndex][yIndex]; if (pElem != NIL(TWOelem)) { if (refPsi == 0.0 && pElem->matlInfo->type == SEMICON) { refPsi = pElem->matlInfo->refPsi; } - for (index = 0; index <= 3; index++) { + for (index = 0; index < 4; index++) { if (pElem->evalNodes[index]) { pNode = pElem->pNodes[index]; nodeArray[pNode->nodeI][pNode->nodeJ] = pNode; @@ -214,13 +212,12 @@ TWOprnSolution(FILE *file, TWOdevice *pDevice, OUTPcard *output) for (yIndex = 1; yIndex <= pDevice->numYNodes; yIndex++) { pNode = nodeArray[xIndex][yIndex]; if (pNode != NIL(TWOnode)) { + TWOelem *pElem = NULL; /* Find the element to which this node belongs. */ - foundElem = FALSE; - for (index = 0; (index <= 3) && (!foundElem); index++) { + for (index = 0; index < 4; index++) { pElem = pNode->pElems[index]; - if (pElem != NIL(TWOelem) && pElem->evalNodes[(index + 2) % 4]) { - foundElem = TRUE; - } + if (pElem != NIL(TWOelem) && pElem->evalNodes[(index + 2) % 4]) + break; } nodeFields(pElem, pNode, &ex, &ey); nodeCurrents(pElem, pNode, &mun, &mup,