From d59b74471b94184860e7027a691e5c4e4d3cf769 Mon Sep 17 00:00:00 2001 From: rlar Date: Wed, 9 Mar 2016 17:57:23 +0100 Subject: [PATCH] xspice/icm, fix some warnings --- src/xspice/icm/analog/file_source/cfunc.mod | 2 +- src/xspice/icm/digital/d_source/cfunc.mod | 10 +++++----- src/xspice/icm/xtradev/lcouple/cfunc.mod | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/xspice/icm/analog/file_source/cfunc.mod b/src/xspice/icm/analog/file_source/cfunc.mod index 7ec3d03c4..cf4f3a4b0 100644 --- a/src/xspice/icm/analog/file_source/cfunc.mod +++ b/src/xspice/icm/analog/file_source/cfunc.mod @@ -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); diff --git a/src/xspice/icm/digital/d_source/cfunc.mod b/src/xspice/icm/digital/d_source/cfunc.mod index 768b82585..6d45a5f46 100644 --- a/src/xspice/icm/digital/d_source/cfunc.mod +++ b/src/xspice/icm/digital/d_source/cfunc.mod @@ -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 */ diff --git a/src/xspice/icm/xtradev/lcouple/cfunc.mod b/src/xspice/icm/xtradev/lcouple/cfunc.mod index 847466da7..dab1daeeb 100644 --- a/src/xspice/icm/xtradev/lcouple/cfunc.mod +++ b/src/xspice/icm/xtradev/lcouple/cfunc.mod @@ -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). */