xspice/icm, fix some warnings
This commit is contained in:
parent
72d7bb9c8a
commit
d59b74471b
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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). */
|
||||
|
|
|
|||
Loading…
Reference in New Issue