shut down some gcc false warnings (uninitialized vars), add read_more_rawfile()
This commit is contained in:
parent
f10555917e
commit
5da81a7aea
|
|
@ -2085,7 +2085,7 @@ int graph_fullyzoom(xRect *r, Graph_ctx *gr, int dataset)
|
|||
int sweepvar_wrap = 0; /* incremented on new dataset or sweep variable wrap */
|
||||
int ofs = 0, ofs_end;
|
||||
for(dset = 0 ; dset < raw->datasets; dset++) {
|
||||
double xx, xx0;
|
||||
double xx, xx0 = 0.0; /* gcc gives false warnings if xx0 not initialized here */
|
||||
int cnt=0, wrap;
|
||||
register SPICE_DATA *gv = raw->values[sweep_idx];
|
||||
ofs_end = ofs + raw->npoints[dset];
|
||||
|
|
@ -3121,7 +3121,7 @@ int find_closest_wave(int i, Graph_ctx *gr)
|
|||
*/
|
||||
void draw_graph(int i, const int flags, Graph_ctx *gr, void *ct)
|
||||
{
|
||||
int wc = 4, wave_color;
|
||||
int wc = 4, wave_color = 4;
|
||||
char *node = NULL, *color = NULL, *sweep = NULL;
|
||||
int sweep_idx = 0;
|
||||
int n_nodes; /* number of variables to display in a single graph */
|
||||
|
|
|
|||
28
src/save.c
28
src/save.c
|
|
@ -802,6 +802,34 @@ int raw_read(const char *f, Raw **rawptr, const char *type)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* what == 1: read another raw file
|
||||
* what == 2: switch raw file
|
||||
* what == 3: remove a raw file
|
||||
* what == 4: remove all additional raw files
|
||||
*/
|
||||
void read_more_rawfile(int what, const char *f, const char *type)
|
||||
{
|
||||
static int cnt = 1;
|
||||
static Raw *raw[50];
|
||||
static int nraw = 0;
|
||||
|
||||
if(nraw == 0) {
|
||||
raw[nraw] = xctx->raw;
|
||||
nraw++;
|
||||
}
|
||||
if(what == 1 && f && type) {
|
||||
xctx->raw = NULL;
|
||||
raw_read(f, &xctx->raw, type);
|
||||
raw[nraw] = xctx->raw;
|
||||
nraw++;
|
||||
cnt = (cnt + 1) % nraw;
|
||||
draw();
|
||||
} else if(what == 2) {
|
||||
cnt = (cnt + 1) % nraw;
|
||||
xctx->raw = raw[cnt];
|
||||
}
|
||||
}
|
||||
|
||||
/* Read data organized as a table
|
||||
* First line is the header line containing variable names.
|
||||
* data is presented in column format after the header line
|
||||
|
|
|
|||
|
|
@ -1851,7 +1851,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
xSymbol *symbol;
|
||||
short flip, rot;
|
||||
double x0,y0;
|
||||
int n, i;
|
||||
int n, i = 0;
|
||||
int user_inst = -1;
|
||||
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
|
||||
if(argc > 2) {
|
||||
|
|
@ -1868,6 +1868,7 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
if(user_inst >=0 || xctx->sel_array[n].type == ELEMENT) {
|
||||
char srot[16], sflip[16], sx0[70], sy0[70];
|
||||
if(user_inst == -1) i = xctx->sel_array[n].n;
|
||||
else i = user_inst;
|
||||
x0 = xctx->inst[i].x0;
|
||||
y0 = xctx->inst[i].y0;
|
||||
rot = xctx->inst[i].rot;
|
||||
|
|
@ -4531,26 +4532,9 @@ int xschem(ClientData clientdata, Tcl_Interp *interp, int argc, const char * arg
|
|||
* testmode */
|
||||
else if(!strcmp(argv[1], "test"))
|
||||
{
|
||||
static int cnt = 1;
|
||||
static Raw *raw[10];
|
||||
static int nraw = 0;
|
||||
|
||||
if(nraw == 0) {
|
||||
raw[nraw] = xctx->raw;
|
||||
nraw++;
|
||||
}
|
||||
if(!xctx) {Tcl_SetResult(interp, not_avail, TCL_STATIC); return TCL_ERROR;}
|
||||
if(argc > 3) {
|
||||
xctx->raw = NULL;
|
||||
raw_read(argv[2], &xctx->raw, argv[3]);
|
||||
raw[nraw] = xctx->raw;
|
||||
nraw++;
|
||||
cnt = (cnt + 1) % nraw;
|
||||
draw();
|
||||
} else {
|
||||
xctx->raw = raw[cnt];
|
||||
cnt = (cnt + 1) % nraw;
|
||||
}
|
||||
if(argc > 3) read_more_rawfile(1, argv[2], argv[3]);
|
||||
else read_more_rawfile(2, NULL, NULL);
|
||||
Tcl_ResetResult(interp);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1202,6 +1202,7 @@ extern char *base64_encode(const unsigned char *data, const size_t input_length,
|
|||
extern unsigned char *ascii85_encode(const unsigned char *data, const size_t input_length, size_t *output_length);
|
||||
extern int get_raw_index(const char *node);
|
||||
extern void free_rawfile(Raw **rawptr, int dr);
|
||||
extern void read_more_rawfile(int what, const char *f, const char *type);
|
||||
extern int raw_read(const char *f, Raw **rawptr, const char *type);
|
||||
extern int table_read(const char *f);
|
||||
extern double get_raw_value(int dataset, int idx, int point);
|
||||
|
|
|
|||
Loading…
Reference in New Issue