Skip to content

Commit

Permalink
Update deprecated variable trace syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
jmroot committed Jun 4, 2018
1 parent af06495 commit 843b58f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/port1.0/portutil.tcl
Expand Up @@ -472,7 +472,7 @@ proc default {option val} {
if {[info exists option_defaults($option)]} {
ui_debug "Re-registering default for $option"
# remove the old trace
trace vdelete $option rwu default_check
trace remove variable $option {read write unset} default_check
} else {
# If option is already set and we did not set it
# do not reset the value
Expand All @@ -482,7 +482,7 @@ proc default {option val} {
}
set option_defaults($option) $val
set $option $val
trace variable $option rwu default_check
trace add variable $option {read write unset} default_check
}

# default_check
Expand All @@ -491,19 +491,19 @@ proc default {option val} {
proc default_check {optionName index op} {
global option_defaults $optionName
switch $op {
w {
write {
unset option_defaults($optionName)
trace vdelete $optionName rwu default_check
trace remove variable $optionName {read write unset} default_check
return
}
r {
read {
upvar $optionName option
uplevel #0 set $optionName $option_defaults($optionName)
return
}
u {
unset {
unset option_defaults($optionName)
trace vdelete $optionName rwu default_check
trace remove variable $optionName {read write unset} default_check
return
}
}
Expand Down

0 comments on commit 843b58f

Please sign in to comment.