mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-08-22 13:57:32 +02:00
xspice, cast so called `STATIC_VAR' pointers to their concrete type
This commit is contained in:
@@ -267,17 +267,17 @@ void cm_pwl(ARGS) /* structure holding parms,
|
||||
|
||||
/* Allocate storage for last_x_value */
|
||||
STATIC_VAR(last_x_value) = (double *) malloc(sizeof(double));
|
||||
last_x_value = STATIC_VAR(last_x_value);
|
||||
last_x_value = (double *) STATIC_VAR(last_x_value);
|
||||
|
||||
/* Allocate storage for breakpoint domain & range values */
|
||||
STATIC_VAR(x) = (double *) calloc(size, sizeof(double));
|
||||
x = STATIC_VAR(x);
|
||||
x = (double *) STATIC_VAR(x);
|
||||
if (!x) {
|
||||
cm_message_send(allocation_error);
|
||||
}
|
||||
|
||||
STATIC_VAR(y) = (double *) calloc(size, sizeof(double));
|
||||
y = STATIC_VAR(y);
|
||||
y = (double *) STATIC_VAR(y);
|
||||
if (!y) {
|
||||
cm_message_send(allocation_error);
|
||||
}
|
||||
@@ -291,11 +291,11 @@ void cm_pwl(ARGS) /* structure holding parms,
|
||||
}
|
||||
else {
|
||||
|
||||
last_x_value = STATIC_VAR(last_x_value);
|
||||
last_x_value = (double *) STATIC_VAR(last_x_value);
|
||||
|
||||
x = STATIC_VAR(x);
|
||||
x = (double *) STATIC_VAR(x);
|
||||
|
||||
y = STATIC_VAR(y);
|
||||
y = (double *) STATIC_VAR(y);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -105,14 +105,14 @@ void spice2poly (ARGS)
|
||||
STATIC_VAR(acgains) = acgains;
|
||||
}
|
||||
else
|
||||
acgains = STATIC_VAR(acgains);
|
||||
acgains = (double *) STATIC_VAR(acgains);
|
||||
|
||||
/* If analysis type is AC, use the previously computed DC partials */
|
||||
/* for the AC gains */
|
||||
|
||||
if(ANALYSIS == MIF_AC) {
|
||||
for(i = 0; i < num_inputs; i++) {
|
||||
acgains = STATIC_VAR(acgains);
|
||||
acgains = (double *) STATIC_VAR(acgains);
|
||||
AC_GAIN(out,in[i]).real = acgains[i];
|
||||
AC_GAIN(out,in[i]).imag = 0.0;
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ void cm_zener(ARGS) /* structure holding parms,
|
||||
|
||||
/* Allocate storage for frequencies */
|
||||
STATIC_VAR(previous_voltage) = (double *) malloc(sizeof(double));
|
||||
previous_voltage = STATIC_VAR(previous_voltage);
|
||||
previous_voltage = (double *) STATIC_VAR(previous_voltage);
|
||||
|
||||
/* Set previous_voltage value to zero... */
|
||||
*previous_voltage = 0.0;
|
||||
@@ -184,7 +184,7 @@ void cm_zener(ARGS) /* structure holding parms,
|
||||
}
|
||||
else {
|
||||
|
||||
previous_voltage = STATIC_VAR(previous_voltage);
|
||||
previous_voltage = (double *) STATIC_VAR(previous_voltage);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user