xspice/icm, fix some warnings

This commit is contained in:
rlar 2016-03-09 17:57:23 +01:00
parent 72d7bb9c8a
commit d59b74471b
3 changed files with 7 additions and 7 deletions

View File

@ -160,7 +160,7 @@ void cm_filesource(ARGS) /* structure holding parms, inputs, outputs, etc.
/* Allocate storage for internal state */
loc->timeinterval = (double*)calloc(2, sizeof(double));
loc->amplinterval = (double*)calloc(2 * size, sizeof(double));
loc->amplinterval = (double*)calloc(2 * (size_t) size, sizeof(double));
loc->state = (struct filesource_state*)malloc(sizeof(struct filesource_state));
loc->timeinterval[0] = loc->timeinterval[1] = PARAM_NULL(timeoffset) ? 0.0 : PARAM(timeoffset);

View File

@ -698,7 +698,7 @@ NON-STANDARD FEATURES
static int cm_read_source(FILE *source, Local_Data_t *loc)
{
size_t n; /* loop index */
int n; /* loop index */
int i, /* indexing variable */
j, /* indexing variable */
num_tokens; /* number of tokens in a given string */
@ -752,8 +752,8 @@ static int cm_read_source(FILE *source, Local_Data_t *loc)
s = base_address;
/* set storage space for bits in a row and set them to 0*/
loc->all_data[i] = (char*)malloc(sizeof(char) * loc->width);
for (n = 0; n < (unsigned int)loc->width; n++)
loc->all_data[i] = (char*)malloc(sizeof(char) * (size_t) loc->width);
for (n = 0; n < loc->width; n++)
loc->all_data[i][n] = 0;
/** Retrieve each token, analyze, and **/
@ -979,8 +979,8 @@ void cm_d_source(ARGS)
loc->width = PORT_SIZE(out);
/*** allocate storage for **all_data, & *all_timepoints ***/
loc->all_timepoints = (double*)calloc(i, sizeof(double));
loc->all_data = (char**)calloc(i, sizeof(char*));
loc->all_timepoints = (double*)calloc((size_t) i, sizeof(double));
loc->all_data = (char**)calloc((size_t) i, sizeof(char*));
/* Send file pointer and the two array storage pointers */
/* to "cm_read_source()". This will return after */

View File

@ -135,7 +135,7 @@ void cm_lcouple(ARGS) /* structure holding parms,
output_mmf, /* output driving amp-turns to core side. */
num_turns, /* number of turns on inductor */
pout_pin_fake, /* fake partial derivative of output
/*pout_pin_fake,*/ /* fake partial derivative of output
w.r.t. input (for use with integration */
*in_flux, /* current input flux value from core side
(represented as a current). */