From bc5fc3ff0fbffd061cfe39e3506ba8123eadebac Mon Sep 17 00:00:00 2001 From: Jim Monte Date: Sat, 22 Feb 2020 01:27:24 -0500 Subject: [PATCH] Resolution of merge conflicts with pre-master: txfree()->free() in code models. --- src/xspice/cm/cmexport.c | 6 ------ src/xspice/icm/analog/file_source/cfunc.mod | 20 +++++++++---------- src/xspice/icm/analog/oneshot/cfunc.mod | 6 +++--- src/xspice/icm/analog/pwl/cfunc.mod | 6 +++--- src/xspice/icm/analog/s_xfer/cfunc.mod | 12 +++++------ src/xspice/icm/digital/d_genlut/cfunc.mod | 2 +- src/xspice/icm/digital/d_lut/cfunc.mod | 2 +- src/xspice/icm/digital/d_osc/cfunc.mod | 6 +++--- src/xspice/icm/digital/d_source/cfunc.mod | 18 ++++++++--------- src/xspice/icm/digital/d_state/cfunc.mod | 12 +++++------ .../icm/spice2poly/icm_spice2poly/cfunc.mod | 8 ++++---- src/xspice/icm/xtradev/sidiode/cfunc.mod | 2 +- src/xspice/icm/xtradev/zener/cfunc.mod | 2 +- 13 files changed, 48 insertions(+), 54 deletions(-) diff --git a/src/xspice/cm/cmexport.c b/src/xspice/cm/cmexport.c index aabc34fce..0a35eb60e 100644 --- a/src/xspice/cm/cmexport.c +++ b/src/xspice/cm/cmexport.c @@ -11,12 +11,6 @@ static void no_free(const void *p) { } #endif -/* Returns the version string for ngspice */ -static const char *get_ngspice_version(void) -{ - const char *buf = VERSION; - return buf; -} /* end of function get_ngspice_version */ /* Returns stdout, stdin, and stderr */ diff --git a/src/xspice/icm/analog/file_source/cfunc.mod b/src/xspice/icm/analog/file_source/cfunc.mod index e4dcaca11..937875b8a 100644 --- a/src/xspice/icm/analog/file_source/cfunc.mod +++ b/src/xspice/icm/analog/file_source/cfunc.mod @@ -227,7 +227,7 @@ void cm_filesource(ARGS) /* structure holding parms, inputs, outputs, etc. else { sprintf(p, "%s%s%s", lbuffer, DIR_PATHSEP, PARAM(file)); loc->state->fp = fopen(p, "r"); - txfree(p); + free(p); } } if (!loc->state->fp) { @@ -260,12 +260,12 @@ void cm_filesource(ARGS) /* structure holding parms, inputs, outputs, etc. while (*cp && isspace_c(*cp)) ++cp; if (*cp == '*' || *cp == '#' || *cp == ';') { - txfree(cpdel); + free(cpdel); continue; } t = strtod(cp, &cp2); if (cp2 == cp) { - txfree(cpdel); + free(cpdel); continue; } cp = cp2; @@ -306,7 +306,7 @@ void cm_filesource(ARGS) /* structure holding parms, inputs, outputs, etc. t += PARAM(amploffset[i]); loc->indata->datavec[count++] = t; } - txfree(cpdel); + free(cpdel); } loc->indata->maxoccupied = count; @@ -381,25 +381,25 @@ static void cm_filesource_callback(ARGS, Mif_Callback_Reason_t reason) if (loc->state->fp != (FILE *) NULL) { fclose(loc->state->fp); } - txfree(loc->state); + free(loc->state); } if (loc->amplinterval != (double *) NULL) { - txfree(loc->amplinterval); + free(loc->amplinterval); } if (loc->timeinterval != (double *) NULL) { - txfree(loc->timeinterval); + free(loc->timeinterval); } if (loc->indata) { if (loc->indata->datavec) { - txfree(loc->indata->datavec); + free(loc->indata->datavec); } - txfree(loc->indata); + free(loc->indata); } - txfree(loc); + free(loc); STATIC_VAR(locdata) = NULL; break; diff --git a/src/xspice/icm/analog/oneshot/cfunc.mod b/src/xspice/icm/analog/oneshot/cfunc.mod index bf83f2cb4..130a3ddc4 100644 --- a/src/xspice/icm/analog/oneshot/cfunc.mod +++ b/src/xspice/icm/analog/oneshot/cfunc.mod @@ -572,9 +572,9 @@ static void cm_oneshot_callback(ARGS, Mif_Callback_Reason_t reason) if (loc == (Local_Data_t *) NULL) { break; } - txfree(loc->control); - txfree(loc->pw); - txfree(loc); + free(loc->control); + free(loc->pw); + free(loc); STATIC_VAR(locdata) = (Local_Data_t *) NULL; break; } diff --git a/src/xspice/icm/analog/pwl/cfunc.mod b/src/xspice/icm/analog/pwl/cfunc.mod index 62886cab4..ffb53d8e4 100644 --- a/src/xspice/icm/analog/pwl/cfunc.mod +++ b/src/xspice/icm/analog/pwl/cfunc.mod @@ -231,17 +231,17 @@ cm_pwl_callback(ARGS, Mif_Callback_Reason_t reason) case MIF_CB_DESTROY: { void *p = STATIC_VAR(last_x_value); if (p != NULL) { - txfree(p); + free(p); } p = STATIC_VAR(x); if (p != NULL) { - txfree(p); + free(p); } p = STATIC_VAR(y); if (p != NULL) { - txfree(p); + free(p); } STATIC_VAR (last_x_value) = NULL; diff --git a/src/xspice/icm/analog/s_xfer/cfunc.mod b/src/xspice/icm/analog/s_xfer/cfunc.mod index 25c5ffe96..60802a4ad 100644 --- a/src/xspice/icm/analog/s_xfer/cfunc.mod +++ b/src/xspice/icm/analog/s_xfer/cfunc.mod @@ -620,22 +620,22 @@ void cm_s_xfer(ARGS) /* structure holding parms, inputs, outputs, etc. */ EXITPOINT: /* free all allocated memory */ if (old_integrator != (double **) NULL) { - txfree(old_integrator); + free(old_integrator); } if (integrator != (double **) NULL) { - txfree(integrator); + free(integrator); } if (den_coefficient != (double **) NULL) { - txfree(den_coefficient); + free(den_coefficient); } if (old_den_coefficient != (double **) NULL) { - txfree(old_den_coefficient); + free(old_den_coefficient); } if (num_coefficient != (double **) NULL) { - txfree(num_coefficient); + free(num_coefficient); } if (old_num_coefficient != (double **) NULL) { - txfree(old_num_coefficient); + free(old_num_coefficient); } } /* end of function cm_s_xfer */ diff --git a/src/xspice/icm/digital/d_genlut/cfunc.mod b/src/xspice/icm/digital/d_genlut/cfunc.mod index 9d0183ae0..6e6a8c3b5 100644 --- a/src/xspice/icm/digital/d_genlut/cfunc.mod +++ b/src/xspice/icm/digital/d_genlut/cfunc.mod @@ -407,7 +407,7 @@ static void cm_d_genlut_callback(ARGS, Mif_Callback_Reason_t reason) case MIF_CB_DESTROY: { void * const p = STATIC_VAR(locdata); if (p != NULL) { - txfree(p); + free(p); } break; } diff --git a/src/xspice/icm/digital/d_lut/cfunc.mod b/src/xspice/icm/digital/d_lut/cfunc.mod index a9b2b0670..875a57a80 100644 --- a/src/xspice/icm/digital/d_lut/cfunc.mod +++ b/src/xspice/icm/digital/d_lut/cfunc.mod @@ -269,7 +269,7 @@ static void cm_d_lut_callback(ARGS, Mif_Callback_Reason_t reason) case MIF_CB_DESTROY: { void * const p = STATIC_VAR(locdata); if (p != NULL) { - txfree(p); + free(p); } break; } diff --git a/src/xspice/icm/digital/d_osc/cfunc.mod b/src/xspice/icm/digital/d_osc/cfunc.mod index e349aa6c0..88ac7e91d 100644 --- a/src/xspice/icm/digital/d_osc/cfunc.mod +++ b/src/xspice/icm/digital/d_osc/cfunc.mod @@ -286,7 +286,7 @@ void cm_d_osc(ARGS) y = (double *) calloc((size_t) freq_size, sizeof(double)); if (!y) { cm_message_send(d_osc_allocation_error); - txfree(x); + free(x); return; } @@ -394,8 +394,8 @@ void cm_d_osc(ARGS) - txfree(x); - txfree(y); + free(x); + free(y); } diff --git a/src/xspice/icm/digital/d_source/cfunc.mod b/src/xspice/icm/digital/d_source/cfunc.mod index fd79bc209..5c6882aba 100644 --- a/src/xspice/icm/digital/d_source/cfunc.mod +++ b/src/xspice/icm/digital/d_source/cfunc.mod @@ -183,7 +183,7 @@ static char *CNVgettok(char **s) switch(**s) { case '\0': /* End of string found */ - txfree(buf); + free(buf); return (char *) NULL; default: /* Otherwise, we are dealing with a */ @@ -220,7 +220,7 @@ static char *CNVgettok(char **s) return (char *) NULL; } strcpy(ret_str, buf); - txfree(buf); + free(buf); return ret_str; } @@ -737,7 +737,7 @@ static int cm_read_source(FILE *source, Local_Data_t *loc) while ( type != CNV_NO_TOK ) { token = CNVget_token(&s, &type); if (token) - txfree(token); + free(token); j++; } num_tokens = j; @@ -813,7 +813,7 @@ static int cm_read_source(FILE *source, Local_Data_t *loc) } } if (token) - txfree(token); + free(token); } i++; } @@ -945,7 +945,7 @@ void cm_d_source(ARGS) } sprintf(p, "%s%s%s", lbuffer, DIR_PATHSEP, PARAM(input_file)); source = fopen(p, "r"); - txfree(p); + free(p); } if (!source) cm_message_printf("cannot open file %s", PARAM(input_file)); @@ -1229,10 +1229,10 @@ static void free_local_data(Local_Data_t *loc) int i; for (i = 0; i != n; ++i) { /* free individual allocs */ if (all_data[i] != (char *) NULL) { - txfree(all_data[i]); + free(all_data[i]); } } - txfree(all_data); + free(all_data); } } @@ -1240,11 +1240,11 @@ static void free_local_data(Local_Data_t *loc) { void * const p = loc->all_timepoints; if (p != NULL) { - txfree(p); + free(p); } } - txfree(loc); + free(loc); } /* end of function free_local_data */ diff --git a/src/xspice/icm/digital/d_state/cfunc.mod b/src/xspice/icm/digital/d_state/cfunc.mod index 58cf37f64..5f5248589 100644 --- a/src/xspice/icm/digital/d_state/cfunc.mod +++ b/src/xspice/icm/digital/d_state/cfunc.mod @@ -225,7 +225,7 @@ static char *CNVgettok(char **s) switch(**s) { case '\0': /* End of string found */ - txfree(buf); + free(buf); return (char *) NULL; default: /* Otherwise, we are dealing with a */ @@ -262,7 +262,7 @@ static char *CNVgettok(char **s) return (char *) NULL; } strcpy(ret_str, buf); - txfree(buf); + free(buf); return ret_str; } @@ -2136,19 +2136,19 @@ static void free_state_fields(State_Table_t *p_state) { void *p; if ((p = p_state->state) != NULL) { - txfree(p); + free(p); p_state->state = (int *) NULL; } if ((p = p_state->bits) != NULL) { - txfree(p); + free(p); p_state->bits = (short *) NULL; } if ((p = p_state->inputs) != NULL) { - txfree(p); + free(p); p_state->inputs = (short *) NULL; } if ((p = p_state->next_state) != NULL) { - txfree(p); + free(p); p_state->next_state = (int *) NULL; } } /* end of function free_state_fields */ diff --git a/src/xspice/icm/spice2poly/icm_spice2poly/cfunc.mod b/src/xspice/icm/spice2poly/icm_spice2poly/cfunc.mod index b17ae7191..5a941ba45 100644 --- a/src/xspice/icm/spice2poly/icm_spice2poly/cfunc.mod +++ b/src/xspice/icm/spice2poly/icm_spice2poly/cfunc.mod @@ -75,7 +75,7 @@ cm_spice2poly_callback(ARGS, Mif_Callback_Reason_t reason) case MIF_CB_DESTROY: { Mif_Inst_Var_Data_t *p = STATIC_VAR_INST(acgains); if(p->element) { - txfree(p->element); + free(p->element); p->element = NULL; } break; @@ -234,13 +234,13 @@ void spice2poly (ARGS) /* Free the allocated items and return */ EXITPOINT: if (in != (double *) NULL) { - txfree(in); + free(in); } if (coef != (double *) NULL) { - txfree(coef); + free(coef); } if (exp != (int *) NULL) { - txfree(exp); + free(exp); } return; diff --git a/src/xspice/icm/xtradev/sidiode/cfunc.mod b/src/xspice/icm/xtradev/sidiode/cfunc.mod index ed06b16e0..c5c52fa0b 100644 --- a/src/xspice/icm/xtradev/sidiode/cfunc.mod +++ b/src/xspice/icm/xtradev/sidiode/cfunc.mod @@ -94,7 +94,7 @@ static void cm_sidiode_callback(ARGS, Mif_Callback_Reason_t reason) case MIF_CB_DESTROY: { Local_Data_t *loc = (Local_Data_t *) STATIC_VAR(locdata); if (loc != (Local_Data_t *) NULL) { - txfree(loc); + free(loc); } break; } diff --git a/src/xspice/icm/xtradev/zener/cfunc.mod b/src/xspice/icm/xtradev/zener/cfunc.mod index cdcf11ce2..9f520030a 100644 --- a/src/xspice/icm/xtradev/zener/cfunc.mod +++ b/src/xspice/icm/xtradev/zener/cfunc.mod @@ -372,7 +372,7 @@ static void cm_zener_callback(ARGS, Mif_Callback_Reason_t reason) double * const p_prev_voltage = (double *) STATIC_VAR(previous_voltage); if (p_prev_voltage != (double *) NULL) { - txfree(p_prev_voltage); + free(p_prev_voltage); } break; }