diff --git a/ChangeLog b/ChangeLog index 633977b15..e88a82f25 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-06-30 Robert Larice + * src/spicelib/devices/cpl/cplmpar.c , + * src/spicelib/devices/isrc/isrcpar.c , + * src/spicelib/devices/vsrc/vsrcpar.c : + copy_coeffs(), swallow type conversion warnings + 2011-06-26 Robert Larice * src/include/hash.h , * src/misc/dstring.c , diff --git a/src/spicelib/devices/cpl/cplmpar.c b/src/spicelib/devices/cpl/cplmpar.c index 0adf204fc..293db8fde 100644 --- a/src/spicelib/devices/cpl/cplmpar.c +++ b/src/spicelib/devices/cpl/cplmpar.c @@ -15,12 +15,14 @@ Author: 1992 Charles Hough static void copy_coeffs(double **dst, IFvalue *value) { + int n = value->v.numValue; + if(*dst) tfree(*dst); - *dst = TMALLOC(double, value->v.numValue); + *dst = TMALLOC(double, n); - memcpy(*dst, value->v.vec.rVec, value->v.numValue * sizeof(double)); + memcpy(*dst, value->v.vec.rVec, (size_t) n * sizeof(double)); } diff --git a/src/spicelib/devices/isrc/isrcpar.c b/src/spicelib/devices/isrc/isrcpar.c index 32f95b117..33a744887 100644 --- a/src/spicelib/devices/isrc/isrcpar.c +++ b/src/spicelib/devices/isrc/isrcpar.c @@ -16,14 +16,16 @@ Modified: 2000 AlansFixes static void copy_coeffs(ISRCinstance *here, IFvalue *value) { + int n = value->v.numValue; + if(here->ISRCcoeffs) tfree(here->ISRCcoeffs); - here->ISRCcoeffs = TMALLOC(double, value->v.numValue); - here->ISRCfunctionOrder = value->v.numValue; + here->ISRCcoeffs = TMALLOC(double, n); + here->ISRCfunctionOrder = n; here->ISRCcoeffsGiven = TRUE; - memcpy(here->ISRCcoeffs, value->v.vec.rVec, value->v.numValue * sizeof(double)); + memcpy(here->ISRCcoeffs, value->v.vec.rVec, (size_t) n * sizeof(double)); } diff --git a/src/spicelib/devices/vsrc/vsrcpar.c b/src/spicelib/devices/vsrc/vsrcpar.c index 5987c67f9..2ac216899 100644 --- a/src/spicelib/devices/vsrc/vsrcpar.c +++ b/src/spicelib/devices/vsrc/vsrcpar.c @@ -16,14 +16,16 @@ Modified: 2000 AlansFixes static void copy_coeffs(VSRCinstance *here, IFvalue *value) { + int n = value->v.numValue; + if(here->VSRCcoeffs) tfree(here->VSRCcoeffs); - here->VSRCcoeffs = TMALLOC(double, value->v.numValue); - here->VSRCfunctionOrder = value->v.numValue; + here->VSRCcoeffs = TMALLOC(double, n); + here->VSRCfunctionOrder = n; here->VSRCcoeffsGiven = TRUE; - memcpy(here->VSRCcoeffs, value->v.vec.rVec, value->v.numValue * sizeof(double)); + memcpy(here->VSRCcoeffs, value->v.vec.rVec, (size_t) n * sizeof(double)); }