From f9d9b6deba63ca578d9cf48251b02450d80015c6 Mon Sep 17 00:00:00 2001 From: Markus Mueller Date: Sun, 27 Dec 2020 12:17:01 +0100 Subject: [PATCH] fix "unused but set variable" warnings --- src/spicelib/devices/hicum2/Makefile.am | 4 ++-- src/spicelib/devices/hicum2/hicum2acld.c | 4 ++++ src/spicelib/devices/hicum2/hicum2conv.c | 13 ++++++------- src/spicelib/devices/hicum2/hicum2pzld.c | 4 ++++ 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/spicelib/devices/hicum2/Makefile.am b/src/spicelib/devices/hicum2/Makefile.am index 3d9fe062f..265ab9592 100644 --- a/src/spicelib/devices/hicum2/Makefile.am +++ b/src/spicelib/devices/hicum2/Makefile.am @@ -26,8 +26,8 @@ libhicum2_la_SOURCES = \ hicum2soachk.c \ hicum2trunc.c -AM_CFLAGS = -O -g -Wall -Wextra -I$(top_srcdir)/src/include -AM_CPPFLAGS = @AM_CPPFLAGS@ -O -g -Wall -Wextra +AM_CFLAGS = -O -g -Wall -Wextra -Wunused-but-set-variable -I$(top_srcdir)/src/include +AM_CPPFLAGS = @AM_CPPFLAGS@ -O -g -Wall -Wextra -Wunused-but-set-variable AM_CXXFLAGS = -I$(top_srcdir)/src/include/cppduals -I$(top_srcdir)/src/include -std=c++11 -O -g -Wall -Wextra MAINTAINERCLEANFILES = Makefile.in diff --git a/src/spicelib/devices/hicum2/hicum2acld.c b/src/spicelib/devices/hicum2/hicum2acld.c index 480d3f29a..59aa27679 100644 --- a/src/spicelib/devices/hicum2/hicum2acld.c +++ b/src/spicelib/devices/hicum2/hicum2acld.c @@ -238,6 +238,10 @@ HICUMacLoad(GENmodel *inModel, CKTcircuit *ckt) *(here->HICUMemitEICollCIPtr) += Ibiei_Vbici; *(here->HICUMbaseBICollCIPtr) += -Ibiei_Vbici; *(here->HICUMemitEIBaseBIPtr) += -Ibiei_Vbici; + if (nqs) { + *(here->HICUMbaseBIXfPtr) += Ibiei_Vxf; + *(here->HICUMemitEIXfPtr) += -Ibiei_Vxf; + } // Stamp element: Ibpei *(here->HICUMbaseBPBaseBPPtr) += Ibpei_Vbpei; diff --git a/src/spicelib/devices/hicum2/hicum2conv.c b/src/spicelib/devices/hicum2/hicum2conv.c index 0c4dadd79..0be839408 100644 --- a/src/spicelib/devices/hicum2/hicum2conv.c +++ b/src/spicelib/devices/hicum2/hicum2conv.c @@ -32,6 +32,7 @@ HICUMconvTest(GENmodel *inModel, CKTcircuit *ckt) double delvcic; double delvbbp; double delveie; + double delvxf; double ibieihat; double ibicihat; @@ -44,15 +45,11 @@ HICUMconvTest(GENmodel *inModel, CKTcircuit *ckt) double volatile ithhat; - double Vbiei, Vbici, Vciei, Vbpei, Vbpbi, Vbpci, Vbci, Vsici, Vrth, Vcic, Vbbp, Veie; + double Vbiei, Vbici, Vbpei, Vbpbi, Vbpci, Vsici, Vrth, Vcic, Vbbp, Veie, Vxf; double Ibiei, Ibici, Iciei, Ibpei, Ibpbi, Ibpci, Ibpsi, Isici, Ith; for( ; model != NULL; model = HICUMnextModel(model)) { for(here=HICUMinstances(model);here!=NULL;here = HICUMnextInstance(here)) { - - Vbci = model->HICUMtype*( - *(ckt->CKTrhsOld+here->HICUMbaseNode)- - *(ckt->CKTrhsOld+here->HICUMcollCINode)); Vbiei= model->HICUMtype*( *(ckt->CKTrhsOld+here->HICUMbaseBINode)- *(ckt->CKTrhsOld+here->HICUMemitEINode)); @@ -80,8 +77,8 @@ HICUMconvTest(GENmodel *inModel, CKTcircuit *ckt) Veie = model->HICUMtype*( *(ckt->CKTrhsOld+here->HICUMemitNode)- *(ckt->CKTrhsOld+here->HICUMemitEINode)); + Vxf = *(ckt->CKTrhsOld+here->HICUMxfNode); - Vciei = Vbiei - Vbici; Vrth = model->HICUMtype*(*(ckt->CKTrhsOld+here->HICUMtempNode)); delvrth = Vrth - *(ckt->CKTstate0 + here->HICUMvrth); @@ -95,12 +92,14 @@ HICUMconvTest(GENmodel *inModel, CKTcircuit *ckt) delvcic = Vcic - *(ckt->CKTstate0 + here->HICUMvcic); delvbbp = Vbbp - *(ckt->CKTstate0 + here->HICUMvbbp); delveie = Veie - *(ckt->CKTstate0 + here->HICUMveie); + delvxf = Vxf - *(ckt->CKTstate0 + here->HICUMvxf); //todo: maybe add ibiei_Vxf ibieihat = *(ckt->CKTstate0 + here->HICUMibiei) + *(ckt->CKTstate0 + here->HICUMibiei_Vbiei)*delvbiei + *(ckt->CKTstate0 + here->HICUMibiei_Vrth)*delvrth + - *(ckt->CKTstate0 + here->HICUMibiei_Vbici)*delvbici; + *(ckt->CKTstate0 + here->HICUMibiei_Vbici)*delvbici + + *(ckt->CKTstate0 + here->HICUMibiei_Vxf)*delvxf; ibicihat = *(ckt->CKTstate0 + here->HICUMibici) + *(ckt->CKTstate0 + here->HICUMibici_Vbici)*delvbici+ *(ckt->CKTstate0 + here->HICUMibici_Vrth)*delvrth+ diff --git a/src/spicelib/devices/hicum2/hicum2pzld.c b/src/spicelib/devices/hicum2/hicum2pzld.c index ce918fc21..c447b6662 100644 --- a/src/spicelib/devices/hicum2/hicum2pzld.c +++ b/src/spicelib/devices/hicum2/hicum2pzld.c @@ -237,6 +237,10 @@ HICUMpzLoad(GENmodel *inModel, CKTcircuit *ckt, SPcomplex *s) *(here->HICUMemitEICollCIPtr) += Ibiei_Vbici; *(here->HICUMbaseBICollCIPtr) += -Ibiei_Vbici; *(here->HICUMemitEIBaseBIPtr) += -Ibiei_Vbici; + if (nqs) { + *(here->HICUMbaseBIXfPtr) += Ibiei_Vxf; + *(here->HICUMemitEIXfPtr) += -Ibiei_Vxf; + } // Stamp element: Ibpei *(here->HICUMbaseBPBaseBPPtr) += Ibpei_Vbpei;