Suppress some warnings from MSVC.
This commit is contained in:
parent
bfeb845222
commit
cfbe1afa21
|
|
@ -117,7 +117,7 @@ void com_fread(wordlist *wl)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fgets(buf, sizeof buf, Open_Files[fd].fp)) {
|
if (fgets(buf, sizeof buf, Open_Files[fd].fp)) {
|
||||||
length = strlen(buf);
|
length = (int)strlen(buf);
|
||||||
if (length > 0 && buf[length - 1] == '\n') {
|
if (length > 0 && buf[length - 1] == '\n') {
|
||||||
--length;
|
--length;
|
||||||
if (length > 0 && buf[length - 1] == '\r') {
|
if (length > 0 && buf[length - 1] == '\r') {
|
||||||
|
|
|
||||||
|
|
@ -36,11 +36,11 @@ void com_strstr(wordlist *wl)
|
||||||
if (*s2) {
|
if (*s2) {
|
||||||
var = strstr(s1, s2); // Search for s2 in s1
|
var = strstr(s1, s2); // Search for s2 in s1
|
||||||
if (var)
|
if (var)
|
||||||
i = var - s1; // Offset to match
|
i = (int)(var - s1); // Offset to match
|
||||||
else
|
else
|
||||||
i = -1;
|
i = -1;
|
||||||
} else {
|
} else {
|
||||||
i = strlen(s1); // Length
|
i = (int)strlen(s1); // Length
|
||||||
}
|
}
|
||||||
tfree(s1);
|
tfree(s1);
|
||||||
tfree(s2);
|
tfree(s2);
|
||||||
|
|
@ -58,7 +58,7 @@ void com_strslice(wordlist *wl)
|
||||||
wl = wl->wl_next;
|
wl = wl->wl_next;
|
||||||
offset = atoi(wl->wl_word);
|
offset = atoi(wl->wl_word);
|
||||||
length = atoi(wl->wl_next->wl_word);
|
length = atoi(wl->wl_next->wl_word);
|
||||||
actual = strlen(s1);
|
actual = (int)strlen(s1);
|
||||||
if (offset < 0)
|
if (offset < 0)
|
||||||
offset = actual + offset;
|
offset = actual + offset;
|
||||||
if (length + offset > actual)
|
if (length + offset > actual)
|
||||||
|
|
|
||||||
|
|
@ -667,7 +667,7 @@ inp_spsource(FILE *fp, bool comfile, char *filename, bool intfile)
|
||||||
with_params = TRUE;
|
with_params = TRUE;
|
||||||
size = sizeof header + 10; // Allow for %u and close.
|
size = sizeof header + 10; // Allow for %u and close.
|
||||||
for (argc = 0; Copy_of_argv[optind + argc]; ++argc)
|
for (argc = 0; Copy_of_argv[optind + argc]; ++argc)
|
||||||
size += strlen(Copy_of_argv[optind + argc]);
|
size += (int)strlen(Copy_of_argv[optind + argc]);
|
||||||
size += 3 * argc; // Spaces and quotes.
|
size += 3 * argc; // Spaces and quotes.
|
||||||
if (size <= sizeof buf)
|
if (size <= sizeof buf)
|
||||||
p_buf_active = buf;
|
p_buf_active = buf;
|
||||||
|
|
|
||||||
|
|
@ -691,16 +691,16 @@ vec_get(const char *vec_name) {
|
||||||
|
|
||||||
for (v = vv; v; v = v->va_next) {
|
for (v = vv; v; v = v->va_next) {
|
||||||
struct dvec *nd;
|
struct dvec *nd;
|
||||||
char *vec_name, new_name[256];
|
char *new_vec_name, new_name[256];
|
||||||
|
|
||||||
if (multiple) {
|
if (multiple) {
|
||||||
snprintf(new_name, sizeof new_name, "@%s[%s]",
|
snprintf(new_name, sizeof new_name, "@%s[%s]",
|
||||||
name, v->va_name);
|
name, v->va_name);
|
||||||
vec_name = new_name;
|
new_vec_name = new_name;
|
||||||
} else {
|
} else {
|
||||||
vec_name = whole;
|
new_vec_name = whole;
|
||||||
}
|
}
|
||||||
nd = dvec_alloc(copy(vec_name),
|
nd = dvec_alloc(copy(new_vec_name),
|
||||||
SV_NOTYPE,
|
SV_NOTYPE,
|
||||||
VF_REAL, /* No complex values yet... */
|
VF_REAL, /* No complex values yet... */
|
||||||
1, NULL);
|
1, NULL);
|
||||||
|
|
@ -719,7 +719,7 @@ vec_get(const char *vec_name) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"ERROR: can not handle string value "
|
"ERROR: can not handle string value "
|
||||||
"of '%s' in vec_get(%s)\nIgnoring...\n",
|
"of '%s' in vec_get(%s)\nIgnoring...\n",
|
||||||
v->va_name, vec_name);
|
v->va_name, new_vec_name);
|
||||||
dvec_free(nd);
|
dvec_free(nd);
|
||||||
continue;
|
continue;
|
||||||
break;
|
break;
|
||||||
|
|
@ -752,7 +752,7 @@ vec_get(const char *vec_name) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"ERROR: can not handle mixed, string or list "
|
"ERROR: can not handle mixed, string or list "
|
||||||
"value of '%s' in vec_get(%s)\nIgnoring...\n",
|
"value of '%s' in vec_get(%s)\nIgnoring...\n",
|
||||||
v->va_name, vec_name);
|
v->va_name, new_vec_name);
|
||||||
dvec_free(nd);
|
dvec_free(nd);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -250,7 +250,8 @@ int output_paths_from_lst_file(const char *filename)
|
||||||
|
|
||||||
bool f_have_path = false; /* do not have a path to store */
|
bool f_have_path = false; /* do not have a path to store */
|
||||||
FBTYPE fbtype;
|
FBTYPE fbtype;
|
||||||
FBOBJ fbobj;
|
FBOBJ fbobj = { .dbl_value = 0.0}; // Placate MS compiler.
|
||||||
|
|
||||||
for ( ; ; ) { /* Read items until end of file */
|
for ( ; ; ) { /* Read items until end of file */
|
||||||
/* Get the next path if not found yet */
|
/* Get the next path if not found yet */
|
||||||
if (!f_have_path) {
|
if (!f_have_path) {
|
||||||
|
|
@ -378,7 +379,8 @@ static int read_modpath(
|
||||||
|
|
||||||
bool f_have_path = false; /* do not have a path to store */
|
bool f_have_path = false; /* do not have a path to store */
|
||||||
FBTYPE fbtype;
|
FBTYPE fbtype;
|
||||||
FBOBJ fbobj;
|
FBOBJ fbobj = { .dbl_value = 0.0};
|
||||||
|
|
||||||
for ( ; ; ) { /* Read items until end of file */
|
for ( ; ; ) { /* Read items until end of file */
|
||||||
/* Get the next path if not found yet */
|
/* Get the next path if not found yet */
|
||||||
if (!f_have_path) {
|
if (!f_have_path) {
|
||||||
|
|
@ -553,7 +555,7 @@ static int read_udnpath(
|
||||||
|
|
||||||
bool f_have_path = false; /* do not have a path to store */
|
bool f_have_path = false; /* do not have a path to store */
|
||||||
FBTYPE fbtype;
|
FBTYPE fbtype;
|
||||||
FBOBJ fbobj;
|
FBOBJ fbobj = { .dbl_value = 0.0};
|
||||||
|
|
||||||
for ( ; ; ) { /* Read items until end of file */
|
for ( ; ; ) { /* Read items until end of file */
|
||||||
/* Get the next path if not found yet */
|
/* Get the next path if not found yet */
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,6 @@ int EVTload_with_event(
|
||||||
Evt_Node_Data_t *node_data;
|
Evt_Node_Data_t *node_data;
|
||||||
|
|
||||||
Mif_Private_t cm_data;
|
Mif_Private_t cm_data;
|
||||||
void *value_ptr;
|
|
||||||
|
|
||||||
/* ***************************** */
|
/* ***************************** */
|
||||||
/* Prepare the code model inputs */
|
/* Prepare the code model inputs */
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ void cm_bidi_bridge(ARGS)
|
||||||
out = 0.0; /* AtoD, no analogue output. */
|
out = 0.0; /* AtoD, no analogue output. */
|
||||||
svoc = 0.5;
|
svoc = 0.5;
|
||||||
} else {
|
} else {
|
||||||
double target, iota, interval[2], range, partial;
|
double target, iota, interval[2], range, partial = 0.0;
|
||||||
int step, step_count;
|
int step, step_count;
|
||||||
Digital_t drive, *dp;
|
Digital_t drive, *dp;
|
||||||
|
|
||||||
|
|
@ -274,7 +274,6 @@ void cm_bidi_bridge(ARGS)
|
||||||
|
|
||||||
voc = out_low + (out_high - out_low) * voc;
|
voc = out_low + (out_high - out_low) * voc;
|
||||||
target = 0.0;
|
target = 0.0;
|
||||||
partial = 0.0;
|
|
||||||
|
|
||||||
/* Calculate new value for output current. */
|
/* Calculate new value for output current. */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -140,9 +140,9 @@ void accept_output(struct co_info *pinfo, unsigned int bit_num, Digital_t *val)
|
||||||
|
|
||||||
static void output(struct instance *ip, ARGS)
|
static void output(struct instance *ip, ARGS)
|
||||||
{
|
{
|
||||||
double delay;
|
double delay;
|
||||||
Digital_t *out_vals; // XSPICE rotating memory
|
Digital_t *out_vals; // XSPICE rotating memory
|
||||||
int i, j;
|
unsigned int i, j;
|
||||||
|
|
||||||
delay = PARAM(delay) - (TIME - ip->info.vtime);
|
delay = PARAM(delay) - (TIME - ip->info.vtime);
|
||||||
if (delay <= 0) {
|
if (delay <= 0) {
|
||||||
|
|
@ -314,7 +314,7 @@ static bool check_input(struct instance *ip, Digital_t *ovp,
|
||||||
{
|
{
|
||||||
if (ovp->state != rp->what.state ||
|
if (ovp->state != rp->what.state ||
|
||||||
ovp->strength != rp->what.strength) {
|
ovp->strength != rp->what.strength) {
|
||||||
if (++ip->q_index < ip->q_length) {
|
if (++ip->q_index < (int) ip->q_length) {
|
||||||
/* Record this event. */
|
/* Record this event. */
|
||||||
|
|
||||||
ip->q[ip->q_index] = *rp;
|
ip->q[ip->q_index] = *rp;
|
||||||
|
|
@ -345,10 +345,10 @@ void ucm_d_cosim(ARGS)
|
||||||
{
|
{
|
||||||
struct instance *ip;
|
struct instance *ip;
|
||||||
Digital_t *in_vals; // XSPICE rotating memory
|
Digital_t *in_vals; // XSPICE rotating memory
|
||||||
int i, index;
|
unsigned int i, index;
|
||||||
|
|
||||||
if (INIT) {
|
if (INIT) {
|
||||||
int ins, outs, inouts;
|
unsigned int ins, outs, inouts;
|
||||||
unsigned int alloc_size;
|
unsigned int alloc_size;
|
||||||
void *handle;
|
void *handle;
|
||||||
void (*ifp)(struct co_info *);
|
void (*ifp)(struct co_info *);
|
||||||
|
|
@ -380,7 +380,7 @@ void ucm_d_cosim(ARGS)
|
||||||
cm_message_send(dlerror());
|
cm_message_send(dlerror());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ifp = dlsym(handle, "Cosim_setup");
|
ifp = (void (*)(struct co_info *))dlsym(handle, "Cosim_setup");
|
||||||
if (*ifp == NULL) {
|
if (*ifp == NULL) {
|
||||||
cm_message_printf("ERROR: no entry function in %s", fn);
|
cm_message_printf("ERROR: no entry function in %s", fn);
|
||||||
cm_message_send(dlerror());
|
cm_message_send(dlerror());
|
||||||
|
|
@ -468,7 +468,7 @@ void ucm_d_cosim(ARGS)
|
||||||
|
|
||||||
ip = STATIC_VAR(cosim_instance);
|
ip = STATIC_VAR(cosim_instance);
|
||||||
if (!ip) {
|
if (!ip) {
|
||||||
int ports;
|
unsigned int ports;
|
||||||
|
|
||||||
/* Error state. Do nothing at all. */
|
/* Error state. Do nothing at all. */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,6 @@ struct pwl {
|
||||||
|
|
||||||
static void cm_d_osc_callback(ARGS, Mif_Callback_Reason_t reason)
|
static void cm_d_osc_callback(ARGS, Mif_Callback_Reason_t reason)
|
||||||
{
|
{
|
||||||
struct panel_instance *instance;
|
|
||||||
|
|
||||||
if (reason == MIF_CB_DESTROY) {
|
if (reason == MIF_CB_DESTROY) {
|
||||||
struct pwl *table = STATIC_VAR(locdata);
|
struct pwl *table = STATIC_VAR(locdata);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -177,8 +177,8 @@ void cm_pswitch(ARGS) /* structure holding parms,
|
||||||
r_off = (r_off > 1.0e12) ? 1.0e12 : r_off; /* Set maximum 'OFF' resistance */
|
r_off = (r_off > 1.0e12) ? 1.0e12 : r_off; /* Set maximum 'OFF' resistance */
|
||||||
|
|
||||||
|
|
||||||
if(INIT == 1) { /* first time through, allocate memory, set static parameters */
|
if(INIT == 1) {
|
||||||
char *cntl_error = "\n*****ERROR*****\nPSWITCH: CONTROL voltage delta less than 1.0e-12\n";
|
/* First time through, allocate memory, set static parameters. */
|
||||||
|
|
||||||
cntl_on = PARAM(cntl_on);
|
cntl_on = PARAM(cntl_on);
|
||||||
cntl_off = PARAM(cntl_off);
|
cntl_off = PARAM(cntl_off);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue