From 8399106ed416a92c57bc0fff57e3e98630e0f5ee Mon Sep 17 00:00:00 2001 From: stefan schippers Date: Wed, 28 Jun 2023 00:32:56 +0200 Subject: [PATCH] avoid using "string is list" if tclversion <= 8.4 --- XSchemWin/XSchemWix/Product.wxs | 6 +- XSchemWin/XSchemWix/doc.wxs | 12 + XSchemWin/XSchemWix/heat_doc.wxs | 684 +++++++++++++++--------------- doc/xschem_man/xschem_remote.html | 2 +- src/xinit.c | 6 +- src/xschem.tcl | 32 +- 6 files changed, 395 insertions(+), 347 deletions(-) diff --git a/XSchemWin/XSchemWix/Product.wxs b/XSchemWin/XSchemWix/Product.wxs index 53959cd6..d0e1ecf1 100644 --- a/XSchemWin/XSchemWix/Product.wxs +++ b/XSchemWin/XSchemWix/Product.wxs @@ -135,6 +135,9 @@ + + + @@ -330,7 +333,8 @@ - + + diff --git a/XSchemWin/XSchemWix/doc.wxs b/XSchemWin/XSchemWix/doc.wxs index aeb905f5..65f8f3cb 100644 --- a/XSchemWin/XSchemWix/doc.wxs +++ b/XSchemWin/XSchemWix/doc.wxs @@ -111,6 +111,15 @@ + + + + + + + + + @@ -1056,6 +1065,9 @@ + + + diff --git a/XSchemWin/XSchemWix/heat_doc.wxs b/XSchemWin/XSchemWix/heat_doc.wxs index 594cc6fd..6ebde440 100644 --- a/XSchemWin/XSchemWix/heat_doc.wxs +++ b/XSchemWin/XSchemWix/heat_doc.wxs @@ -3,1015 +3,1024 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1055,6 +1064,9 @@ + + + diff --git a/doc/xschem_man/xschem_remote.html b/doc/xschem_man/xschem_remote.html index f9a1d8d2..d0ef7f3c 100644 --- a/doc/xschem_man/xschem_remote.html +++ b/doc/xschem_man/xschem_remote.html @@ -61,7 +61,7 @@ p{padding: 15px 30px 10px;} The nc (netcat) utility is used to pipe the commands to the tcp socket.
When starting xschem a fixed initial port number is always used (2021 by default), so it is always possible to remotely communicate with xschem using this TCP port. Then the following comands can be sent to setup a new port number - for further communications, freeing the initial (2021) potr number. If another xschem process is started it will + for further communications, freeing the initial (2021) port number. If another xschem process is started it will again use the initial port number, so no port number collisions occur.

diff --git a/src/xinit.c b/src/xinit.c
index d4ab4cc6..48feb71e 100644
--- a/src/xinit.c
+++ b/src/xinit.c
@@ -1388,7 +1388,7 @@ static void switch_window(int *window_count, const char *win_path, int tcl_ctx)
 {
   int n;
   char my_win_path[80];
-  Tk_Window tkwin;
+  Tk_Window tkwin=NULL;
   if(!win_path) {
     dbg(0, "switch_window(): no filename or window path given\n");
     return;
@@ -1651,7 +1651,7 @@ static void destroy_window(int *window_count, const char *win_path)
 {
   int i, n;
   Xschem_ctx *savectx;
-  Tk_Window tkwin;
+  Tk_Window tkwin=NULL;
   savectx = xctx;
   if(*window_count) {
     int close = 0;
@@ -1777,7 +1777,7 @@ static void destroy_all_windows(int *window_count, int force)
 {
   int i;
   Xschem_ctx *savectx;
-  Tk_Window tkwin;
+  Tk_Window tkwin=NULL;
   savectx = xctx;
   if(*window_count) {
     int close;
diff --git a/src/xschem.tcl b/src/xschem.tcl
index c35404f3..cd778aa5 100644
--- a/src/xschem.tcl
+++ b/src/xschem.tcl
@@ -912,10 +912,20 @@ proc sim_is_xyce {} {
 # usually as a result of malformed input strings
 proc list_tokens {s} {
   set res [xschem list_tokens $s 0]
-  if {[string is list $res]} {
-    return $res
+
+
+  if { [info tclversion] > 8.4 } {
+    if { [string is list $res]} {
+      return $res
+    } else {
+      return [split $res]
+    }
   } else {
-    return [split $res]
+    if {![catch {llength $res}]} {
+      return $res
+    } else {
+      return [split $res]
+    }
   }
 }
 
@@ -923,10 +933,20 @@ proc list_tokens {s} {
 proc tolist {s} {
   set s [string trim $s]
   regsub -all {[\t\n ]+} $s { } s
-  if {[string is list $s] } {
-    return $s
+
+
+  if { [info tclversion] > 8.4 } {
+    if { [string is list $s]} {
+      return $s
+    } else {
+      return [split $s]
+    }
   } else {
-    return [split $s]
+    if {![catch {llength $s}]} {
+      return $s
+    } else {
+      return [split $s]
+    }
   }
 }