Browse Source

vsrc, isrc, merge checks for length of vector parameters

pre-master-46
rlar 15 years ago
parent
commit
454ade725f
  1. 5
      ChangeLog
  2. 21
      src/spicelib/devices/isrc/isrcpar.c
  3. 13
      src/spicelib/devices/vsrc/vsrcpar.c

5
ChangeLog

@ -1,3 +1,8 @@
2011-02-27 Robert Larice
* src/spicelib/devices/isrc/isrcpar.c ,
* src/spicelib/devices/vsrc/vsrcpar.c :
vsrc, isrc, merge checks for length of vector parameters
2011-02-27 Robert Larice
* src/spicelib/devices/isrc/isrcask.c ,
* src/spicelib/devices/vsrc/vsrcload.c ,

21
src/spicelib/devices/isrc/isrcpar.c

@ -67,25 +67,29 @@ ISRCparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
}
break;
case ISRC_PULSE:
if(value->v.numValue <2) return(E_BADPARM);
if(value->v.numValue < 2)
return(E_BADPARM);
here->ISRCfunctionType = PULSE;
here->ISRCfuncTGiven = TRUE;
copy_coeffs(here, value);
break;
case ISRC_SINE:
if(value->v.numValue <2) return(E_BADPARM);
if(value->v.numValue < 2)
return(E_BADPARM);
here->ISRCfunctionType = SINE;
here->ISRCfuncTGiven = TRUE;
copy_coeffs(here, value);
break;
case ISRC_EXP:
if(value->v.numValue <2) return(E_BADPARM);
if(value->v.numValue < 2)
return(E_BADPARM);
here->ISRCfunctionType = EXP;
here->ISRCfuncTGiven = TRUE;
copy_coeffs(here, value);
break;
case ISRC_PWL:
if(value->v.numValue <2) return(E_BADPARM);
if(value->v.numValue < 2)
return(E_BADPARM);
here->ISRCfunctionType = PWL;
here->ISRCfuncTGiven = TRUE;
copy_coeffs(here, value);
@ -100,13 +104,16 @@ ISRCparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
break;
case ISRC_SFFM:
if(value->v.numValue <2) return(E_BADPARM);
if(value->v.numValue < 2)
return(E_BADPARM);
here->ISRCfunctionType = SFFM;
here->ISRCfuncTGiven = TRUE;
copy_coeffs(here, value);
break;
case ISRC_AM:
if(value->v.numValue <2) return(E_BADPARM);
case ISRC_AM:
if(value->v.numValue < 2)
return(E_BADPARM);
here->ISRCfunctionType = AM;
here->ISRCfuncTGiven = TRUE;
copy_coeffs(here, value);

13
src/spicelib/devices/vsrc/vsrcpar.c

@ -67,21 +67,29 @@ VSRCparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
}
break;
case VSRC_PULSE:
if(value->v.numValue < 2)
return(E_BADPARM);
here->VSRCfunctionType = PULSE;
here->VSRCfuncTGiven = TRUE;
copy_coeffs(here, value);
break;
case VSRC_SINE:
if(value->v.numValue < 2)
return(E_BADPARM);
here->VSRCfunctionType = SINE;
here->VSRCfuncTGiven = TRUE;
copy_coeffs(here, value);
break;
case VSRC_EXP:
if(value->v.numValue < 2)
return(E_BADPARM);
here->VSRCfunctionType = EXP;
here->VSRCfuncTGiven = TRUE;
copy_coeffs(here, value);
break;
case VSRC_PWL:
if(value->v.numValue < 2)
return(E_BADPARM);
here->VSRCfunctionType = PWL;
here->VSRCfuncTGiven = TRUE;
copy_coeffs(here, value);
@ -121,12 +129,15 @@ VSRCparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
break; }
case VSRC_SFFM:
if(value->v.numValue < 2)
return(E_BADPARM);
here->VSRCfunctionType = SFFM;
here->VSRCfuncTGiven = TRUE;
copy_coeffs(here, value);
break;
case VSRC_AM:
if(value->v.numValue <2) return(E_BADPARM);
if(value->v.numValue < 2)
return(E_BADPARM);
here->VSRCfunctionType = AM;
here->VSRCfuncTGiven = TRUE;
copy_coeffs(here, value);

Loading…
Cancel
Save