From 95fc95771af0582bed2a36c22bba3095d10801d0 Mon Sep 17 00:00:00 2001 From: Giles Atkinson <“gatk555@gmail.com”> Date: Wed, 4 Jun 2025 09:47:38 +0100 Subject: [PATCH] Fix Bug #793 - "breakp.c error: compling without XSPICE failed". Additional changes to conditional compilation are needed for iplot without XSPICE. --- src/frontend/breakp.c | 4 ++++ src/frontend/plotting/graf.c | 21 +++++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/frontend/breakp.c b/src/frontend/breakp.c index ec50fd068..5dae629bc 100644 --- a/src/frontend/breakp.c +++ b/src/frontend/breakp.c @@ -293,7 +293,11 @@ com_iplot(wordlist *wl) d = TMALLOC(struct dbcomm, 1); d->db_analysis = NULL; d->db_number = debugnumber++; +#ifdef XSPICE d->db_iteration = event_auto_incr ? DB_AUTO_OFFSET : DB_NORMAL; +#else + d->db_iteration = DB_NORMAL; +#endif d->db_op = initial_steps; // Field re-use d->db_value1 = window; // Field re-use diff --git a/src/frontend/plotting/graf.c b/src/frontend/plotting/graf.c index 3fbfcb237..2e29e07fa 100644 --- a/src/frontend/plotting/graf.c +++ b/src/frontend/plotting/graf.c @@ -1329,10 +1329,10 @@ void gr_iplot(struct plot *plot) hit = 0; for (db = dbs; db; db = db->db_next) { if (db->db_type == DB_IPLOT || db->db_type == DB_IPLOTALL) { -#ifdef XSPICE if (db->db_iteration > 0) { - double event_node_offset = 0, event_node_spacing; struct dvec *v; +#ifdef XSPICE + double event_node_offset = 0, event_node_spacing; /* First call: set up event nodes spacing. */ @@ -1348,7 +1348,7 @@ void gr_iplot(struct plot *plot) } else { event_node_spacing = 0; } - +#endif /* Find any XSPICE event nodes in the node * list and set up plotting. There is a parallel path * for pushing new event values into their corresponding @@ -1356,9 +1356,11 @@ void gr_iplot(struct plot *plot) */ for (dc = db; dc; dc = dc->db_also) { - struct dbcomm *dd; - char *offp, save_sign; - int dup = 0; + struct dbcomm *dd; + int dup = 0; +#ifdef XSPICE + char *offp, save_sign; +#endif if (dc->db_nodename1 == NULL) continue; @@ -1374,6 +1376,7 @@ void gr_iplot(struct plot *plot) if (dup) continue; +#ifdef XSPICE /* Check for a nodename that is an expression. */ offp = strchr(dc->db_nodename1, '+'); @@ -1383,7 +1386,7 @@ void gr_iplot(struct plot *plot) save_sign = *offp; *offp = '\0'; // Trim to bare name. } - +#endif v = vec_fromplot(dc->db_nodename1, plot); if (v) { dc->db_nodename2 = (char *)v; // Save link to vector. @@ -1393,6 +1396,7 @@ void gr_iplot(struct plot *plot) dc->db_nodename1, plot->pl_name); } +#ifdef XSPICE if (v && (v->v_flags & VF_EVENT_NODE)) { /* Ask event simulator to call back with new values. */ @@ -1443,10 +1447,11 @@ void gr_iplot(struct plot *plot) "Offset (%s) ignored for analog node %s\n", offp, dc->db_nodename1); } +#endif } db->db_iteration = 0; } -#endif + if (db->db_graphid) { GRAPH *gr;