From bcf00ade0618790bef2ce62742dc4bce106e3d64 Mon Sep 17 00:00:00 2001 From: rlar Date: Sun, 22 Apr 2018 22:04:45 +0200 Subject: [PATCH] cpl/cplsetup.c, cleanup VECTOR_ALLOC and MATRIX_ALLOC swap first two arguments for readability --- src/spicelib/devices/cpl/cplsetup.c | 36 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/spicelib/devices/cpl/cplsetup.c b/src/spicelib/devices/cpl/cplsetup.c index 1989ecec9..d24f18d99 100644 --- a/src/spicelib/devices/cpl/cplsetup.c +++ b/src/spicelib/devices/cpl/cplsetup.c @@ -16,15 +16,15 @@ Modified: 2004 Paolo Nenzi - (ng)spice integration -#define VECTOR_ALLOC(vec, type, n) { \ +#define VECTOR_ALLOC(type, vec, n) { \ vec = TMALLOC(type *, n); \ } -#define MATRIX_ALLOC(mat, type, m, j) { \ +#define MATRIX_ALLOC(type, mat, m, j) { \ int k; \ mat = TMALLOC(type **, m); \ for (k = 0; k < m; k++) { \ - VECTOR_ALLOC(mat[k], type, j); \ + VECTOR_ALLOC(type, mat[k], j); \ } \ } @@ -195,21 +195,21 @@ do { if((here->ptr = SMPmakeElt(matrix, here->first, here->second)) == NULL){\ here->CPLibr1 = TMALLOC(int, noL); here->CPLibr2 = TMALLOC(int, noL); - VECTOR_ALLOC(here->CPLibr1Ibr1Ptr, double, noL); - VECTOR_ALLOC(here->CPLibr2Ibr2Ptr, double, noL); - VECTOR_ALLOC(here->CPLposIbr1Ptr, double, noL); - VECTOR_ALLOC(here->CPLnegIbr2Ptr, double, noL); - VECTOR_ALLOC(here->CPLposPosPtr, double, noL); - VECTOR_ALLOC(here->CPLnegNegPtr, double, noL); - VECTOR_ALLOC(here->CPLnegPosPtr, double, noL); - VECTOR_ALLOC(here->CPLposNegPtr, double, noL); - - MATRIX_ALLOC(here->CPLibr1PosPtr, double, noL, noL); - MATRIX_ALLOC(here->CPLibr2NegPtr, double, noL, noL); - MATRIX_ALLOC(here->CPLibr1NegPtr, double, noL, noL); - MATRIX_ALLOC(here->CPLibr2PosPtr, double, noL, noL); - MATRIX_ALLOC(here->CPLibr1Ibr2Ptr, double, noL, noL); - MATRIX_ALLOC(here->CPLibr2Ibr1Ptr, double, noL, noL); + VECTOR_ALLOC(double, here->CPLibr1Ibr1Ptr, noL); + VECTOR_ALLOC(double, here->CPLibr2Ibr2Ptr, noL); + VECTOR_ALLOC(double, here->CPLposIbr1Ptr, noL); + VECTOR_ALLOC(double, here->CPLnegIbr2Ptr, noL); + VECTOR_ALLOC(double, here->CPLposPosPtr, noL); + VECTOR_ALLOC(double, here->CPLnegNegPtr, noL); + VECTOR_ALLOC(double, here->CPLnegPosPtr, noL); + VECTOR_ALLOC(double, here->CPLposNegPtr, noL); + + MATRIX_ALLOC(double, here->CPLibr1PosPtr, noL, noL); + MATRIX_ALLOC(double, here->CPLibr2NegPtr, noL, noL); + MATRIX_ALLOC(double, here->CPLibr1NegPtr, noL, noL); + MATRIX_ALLOC(double, here->CPLibr2PosPtr, noL, noL); + MATRIX_ALLOC(double, here->CPLibr1Ibr2Ptr, noL, noL); + MATRIX_ALLOC(double, here->CPLibr2Ibr1Ptr, noL, noL); branchname = TMALLOC(char *, here->dimension);