From c2ca9a799823c187f675ae469043afbfdccdc7ac Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 10 Jul 2010 12:23:33 +0000 Subject: [PATCH] drop -1, extend enum Mif_Cntl_Src_Type_t --- ChangeLog | 8 ++++++++ src/include/miftypes.h | 1 + src/xspice/mif/mifload.c | 2 ++ src/xspice/mif/mifsetup.c | 4 +++- src/xspice/mif/mifutil.c | 2 +- 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index dde126e41..5b0822b01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-07-10 Robert Larice + * src/include/miftypes.h , + * src/xspice/mif/mifload.c , + * src/xspice/mif/mifsetup.c , + * src/xspice/mif/mifutil.c : + extend the Mif_Cntl_Src_Type_t enum, to avoid mixed use with integer -1. + FIXME, the switch() in mifsetup.c looks suspicious. + 2010-07-10 Holger Vogt * com_measure2.c: allow variables v(n1)=v(n2) * inpcom.c: par('expression') in .four, .plot, .print, .meas, .save, diff --git a/src/include/miftypes.h b/src/include/miftypes.h index 95c5ab5a6..e425b4e22 100755 --- a/src/include/miftypes.h +++ b/src/include/miftypes.h @@ -168,6 +168,7 @@ typedef enum { MIF_VCIS, MIF_ICVS, MIF_ICIS, + MIF_minus_one, } Mif_Cntl_Src_Type_t; diff --git a/src/xspice/mif/mifload.c b/src/xspice/mif/mifload.c index 265f271d3..6c6c75cf7 100755 --- a/src/xspice/mif/mifload.c +++ b/src/xspice/mif/mifload.c @@ -660,6 +660,8 @@ MIFload( rhs[smp_data_out->branch] -= partial * cntl_input; } break; + case MIF_minus_one: + break; } /* end switch on controlled source type */ } /* end for number of input ports */ } /* end for number of input connections */ diff --git a/src/xspice/mif/mifsetup.c b/src/xspice/mif/mifsetup.c index ba0c30687..01ede3f05 100755 --- a/src/xspice/mif/mifsetup.c +++ b/src/xspice/mif/mifsetup.c @@ -435,6 +435,8 @@ MIFsetup( case MIF_ICVS: CTSTALLOC(h.branch_ibranchcntl, branch, ibranch); break; + case MIF_minus_one: + break; } /* end switch on controlled source type */ } /* end for number of input ports */ } /* end for number of input connections */ @@ -507,7 +509,7 @@ MIFunsetup(GENmodel *inModel,CKTcircuit *ckt) case MIF_ICVS: case MIF_VCIS: case MIF_ICIS: - case -1: + case MIF_minus_one: /* FIXME, really ? */ if(smp_data_out->branch) { CKTdltNNum(ckt, smp_data_out->branch); diff --git a/src/xspice/mif/mifutil.c b/src/xspice/mif/mifutil.c index 48b1f0cf4..9b250fef3 100755 --- a/src/xspice/mif/mifutil.c +++ b/src/xspice/mif/mifutil.c @@ -302,7 +302,7 @@ Mif_Cntl_Src_Type_t MIFget_cntl_src_type( } - return(-1); + return(MIF_minus_one); }