rewrite-rw, TSTALLOC()
This commit is contained in:
parent
d1acfdc738
commit
97d61c495f
|
|
@ -11,6 +11,12 @@ Author: 1985 Gordon Jacobs
|
|||
#include "ngspice/sperror.h"
|
||||
#include "ngspice/suffix.h"
|
||||
|
||||
#define TSTALLOC(ptr, first, second) \
|
||||
do { \
|
||||
if (!(here->ptr = SMPmakeElt(matrix, here->first, here->second))) \
|
||||
return E_NOMEM; \
|
||||
} while(0)
|
||||
|
||||
|
||||
int
|
||||
CSWsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||
|
|
@ -53,12 +59,6 @@ CSWsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
|||
return E_BADPARM;
|
||||
}
|
||||
|
||||
/* macro to make elements with built in test for out of memory */
|
||||
#define TSTALLOC(ptr,first,second) \
|
||||
do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
|
||||
return(E_NOMEM);\
|
||||
} } while(0)
|
||||
|
||||
TSTALLOC(CSWposPosPtr, CSWposNode, CSWposNode);
|
||||
TSTALLOC(CSWposNegPtr, CSWposNode, CSWnegNode);
|
||||
TSTALLOC(CSWnegPosPtr, CSWnegNode, CSWposNode);
|
||||
|
|
|
|||
|
|
@ -12,6 +12,12 @@ Author: 1985 Gordon Jacobs
|
|||
#include "ngspice/sperror.h"
|
||||
#include "ngspice/suffix.h"
|
||||
|
||||
#define TSTALLOC(ptr, first, second) \
|
||||
do { \
|
||||
if (!(here->ptr = SMPmakeElt(matrix, here->first, here->second))) \
|
||||
return E_NOMEM; \
|
||||
} while (0)
|
||||
|
||||
|
||||
int
|
||||
SWsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
||||
|
|
@ -48,12 +54,6 @@ SWsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit *ckt, int *states)
|
|||
/* Default Value Processing for Switch Instance */
|
||||
/* none */
|
||||
|
||||
/* macro to make elements with built in test for out of memory */
|
||||
#define TSTALLOC(ptr,first,second) \
|
||||
do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\
|
||||
return(E_NOMEM);\
|
||||
} } while(0)
|
||||
|
||||
TSTALLOC(SWposPosPtr, SWposNode, SWposNode);
|
||||
TSTALLOC(SWposNegPtr, SWposNode, SWnegNode);
|
||||
TSTALLOC(SWnegPosPtr, SWnegNode, SWposNode);
|
||||
|
|
|
|||
Loading…
Reference in New Issue