beautify code

This commit is contained in:
h_vogt 2012-05-01 14:32:07 +02:00
parent d65259fd45
commit 80ca57eb76
1 changed files with 413 additions and 415 deletions

View File

@ -86,7 +86,7 @@ OUTpBeginPlot(CKTcircuit *circuitPtr, JOB *analysisPtr,
char *name; char *name;
#ifdef PARALLEL_ARCH #ifdef PARALLEL_ARCH
if (ARCHme != 0) return(OK); if (ARCHme != 0) return(OK);
#endif /* PARALLEL_ARCH */ #endif /* PARALLEL_ARCH */
@ -133,7 +133,7 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam
/*to resume a run saj /*to resume a run saj
*All it does is reassign the file pointer and return (requires *runp to be NULL if this is not needed) *All it does is reassign the file pointer and return (requires *runp to be NULL if this is not needed)
*/ */
if(dataType == 666 && numNames == 666){ if(dataType == 666 && numNames == 666) {
run = *runp; run = *runp;
run->writeOut = ft_getOutReq(&run->fp, &run->runPlot, &run->binary, run->writeOut = ft_getOutReq(&run->fp, &run->runPlot, &run->binary,
run->type, run->name); run->type, run->name);
@ -174,7 +174,7 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam
continue; continue;
} }
/* Check for ".save all" and new synonym ".save allv" */ /* Check for ".save all" and new synonym ".save allv" */
if (cieq(saves[i].name, "all") || cieq(saves[i].name, "allv")) { if (cieq(saves[i].name, "all") || cieq(saves[i].name, "allv")) {
saveall = TRUE; saveall = TRUE;
@ -183,7 +183,7 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam
continue; continue;
} }
/* And now for the new ".save alli" option */ /* And now for the new ".save alli" option */
if (cieq(saves[i].name, "alli")) { if (cieq(saves[i].name, "alli")) {
savealli = TRUE; savealli = TRUE;
@ -225,7 +225,7 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam
for (i = 0; i < numNames; i++) for (i = 0; i < numNames; i++)
if (!refName || !name_eq(dataNames[i], refName)) { if (!refName || !name_eq(dataNames[i], refName)) {
/* Save the node as long as it's an internal device node */ /* Save the node as long as it's an internal device node */
if (!strstr(dataNames[i], "#internal") && if (!strstr(dataNames[i], "#internal") &&
!strstr(dataNames[i], "#source") && !strstr(dataNames[i], "#source") &&
@ -278,8 +278,7 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam
addSpecialDesc(run, tmpname, namebuf, parambuf, depind); addSpecialDesc(run, tmpname, namebuf, parambuf, depind);
}; };
strcpy(ch, "[ib]"); strcpy(ch, "[ib]");
} else } else if ((strstr(ch, "#internal")!=NULL)&&(tmpname[1]=='d')) {
if ((strstr(ch, "#internal")!=NULL)&&(tmpname[1]=='d')) {
strcpy(ch, "[id]"); strcpy(ch, "[id]");
} else { } else {
fprintf(cp_err, fprintf(cp_err,
@ -287,7 +286,8 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam
continue; continue;
}; };
if (parseSpecial(tmpname, namebuf, parambuf, depbuf)) { if (parseSpecial(tmpname, namebuf, parambuf, depbuf)) {
if (*depbuf) { fprintf( stderr, if (*depbuf) {
fprintf( stderr,
"Warning : unexpected dependent variable on %s\n", tmpname); "Warning : unexpected dependent variable on %s\n", tmpname);
} else { } else {
addSpecialDesc(run, tmpname, namebuf, parambuf, depind); addSpecialDesc(run, tmpname, namebuf, parambuf, depind);
@ -344,8 +344,7 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam
if (numNames && if (numNames &&
( (run->numData == 1 && run->refIndex != -1) ( (run->numData == 1 && run->refIndex != -1)
|| (run->numData == 0 && run->refIndex == -1)) ) /* va: suggested parentheses */ || (run->numData == 0 && run->refIndex == -1)) ) { /* va: suggested parentheses */
{
fprintf(cp_err, "Error: no data saved for %s; analysis not run\n", fprintf(cp_err, "Error: no data saved for %s; analysis not run\n",
spice_analysis_get_description(analysisPtr->JOBtype)); spice_analysis_get_description(analysisPtr->JOBtype));
return E_NOTFOUND; return E_NOTFOUND;
@ -458,10 +457,10 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr)
fileStartPoint(run->fp, run->binary, run->pointCount); fileStartPoint(run->fp, run->binary, run->pointCount);
if (run->refIndex != -1) { if (run->refIndex != -1) {
if (run->isComplex){ if (run->isComplex) {
fileAddComplexValue(run->fp, run->binary, refValue->cValue); fileAddComplexValue(run->fp, run->binary, refValue->cValue);
/* While we're looking at the reference value, print it to the screen /* While we're looking at the reference value, print it to the screen
every quarter of a second, to give some feedback without using every quarter of a second, to give some feedback without using
too much CPU time */ too much CPU time */
#ifndef HAS_WINDOWS #ifndef HAS_WINDOWS
@ -474,7 +473,7 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr)
#endif #endif
} else { } else {
/* And the same for a non-complex value */ /* And the same for a non-complex value */
fileAddRealValue(run->fp, run->binary, refValue->rValue); fileAddRealValue(run->fp, run->binary, refValue->rValue);
#ifndef HAS_WINDOWS #ifndef HAS_WINDOWS
@ -506,10 +505,9 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr)
fprintf(stderr, "OUTpData: unsupported data type\n"); fprintf(stderr, "OUTpData: unsupported data type\n");
} else { } else {
/* should pre-check instance */ /* should pre-check instance */
if (!getSpecial(&run->data[i], run, &val)) if (!getSpecial(&run->data[i], run, &val)) {
{
/* If this is the first data point, print a warning for any unrecognized /* If this is the first data point, print a warning for any unrecognized
variables, since this has not already been checked */ variables, since this has not already been checked */
if (run->pointCount==1) if (run->pointCount==1)
@ -544,7 +542,7 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr)
} }
fileEndPoint(run->fp, run->binary); fileEndPoint(run->fp, run->binary);
/* Check that the write to disk completed successfully, otherwise abort */ /* Check that the write to disk completed successfully, otherwise abort */
if (ferror(run->fp)) { if (ferror(run->fp)) {
fprintf(stderr, "Warning: rawfile write error !!\n"); fprintf(stderr, "Warning: rawfile write error !!\n");
@ -552,7 +550,7 @@ OUTpData(runDesc *plotPtr, IFvalue *refValue, IFvalue *valuePtr)
}; };
} else { } else {
/* This is interactive mode. Update the screen with the reference /* This is interactive mode. Update the screen with the reference
variable just the same */ variable just the same */
currclock = clock(); currclock = clock();