|
From: <ai...@us...> - 2013-11-12 10:16:42
|
Revision: 12683
http://sourceforge.net/p/plplot/code/12683
Author: airwin
Date: 2013-11-12 10:16:40 +0000 (Tue, 12 Nov 2013)
Log Message:
-----------
Change the two-argument min and max functions used in various examples
to the exact variable number of argument min and max used in
bindings/tk/pltools.tcl. This prevents a clash (found under plserver
when editing the cmap1 colour palette for example 8) in min and
max function definitions when these examples are running
in examples/tk under plserver.
Modified Paths:
--------------
trunk/examples/tcl/x20.tcl
trunk/examples/tcl/x21.tcl
trunk/examples/tcl/x33.tcl
Modified: trunk/examples/tcl/x20.tcl
===================================================================
--- trunk/examples/tcl/x20.tcl 2013-11-12 08:15:37 UTC (rev 12682)
+++ trunk/examples/tcl/x20.tcl 2013-11-12 10:16:40 UTC (rev 12683)
@@ -514,11 +514,20 @@
#----------------------------------------------------------------------------
# proc max and min
-proc max {x y} {
- expr {$x > $y? $x : $y}
+proc min {args} {
+ set x [lindex $args 0]
+ foreach i $args {
+ if {$i<$x} {set x $i}
+ }
+ return $x
}
-proc min {x y} {
- expr {$x > $y? $y : $x}
+
+proc max {args} {
+ set x [lindex $args 0]
+ foreach i $args {
+ if {$i>$x} {set x $i}
+ }
+ return $x
}
Modified: trunk/examples/tcl/x21.tcl
===================================================================
--- trunk/examples/tcl/x21.tcl 2013-11-12 08:15:37 UTC (rev 12682)
+++ trunk/examples/tcl/x21.tcl 2013-11-12 10:16:40 UTC (rev 12683)
@@ -269,14 +269,22 @@
#----------------------------------------------------------------------------
# proc max and min
-proc max {x y} {
- expr {$x > $y? $x : $y}
+proc min {args} {
+ set x [lindex $args 0]
+ foreach i $args {
+ if {$i<$x} {set x $i}
+ }
+ return $x
}
-proc min {x y} {
- expr {$x > $y? $y : $x}
+
+proc max {args} {
+ set x [lindex $args 0]
+ foreach i $args {
+ if {$i>$x} {set x $i}
+ }
+ return $x
}
-
#----------------------------------------------------------------------------
# proc cmap1_init
# Set up the colour map
Modified: trunk/examples/tcl/x33.tcl
===================================================================
--- trunk/examples/tcl/x33.tcl 2013-11-12 08:15:37 UTC (rev 12682)
+++ trunk/examples/tcl/x33.tcl 2013-11-12 10:16:40 UTC (rev 12683)
@@ -975,10 +975,18 @@
}
# Auxiliary routines
-proc max {a b} {
- expr {$a > $b? $a : $b}
+proc min {args} {
+ set x [lindex $args 0]
+ foreach i $args {
+ if {$i<$x} {set x $i}
+ }
+ return $x
}
-proc min {a b} {
- expr {$a < $b? $a : $b}
+proc max {args} {
+ set x [lindex $args 0]
+ foreach i $args {
+ if {$i>$x} {set x $i}
+ }
+ return $x
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|