Commit 61677ae7 authored by Leigh Stoller's avatar Leigh Stoller

Convert all the unsuported error messages into calls to punsup(),

and make that message much more prominent. I think though that these
warnings need to be treated specially so that user sees them.
parent b37d03ed
......@@ -46,7 +46,7 @@ Queue instproc init {link type} {
set red_ 1
set gentle_ 1
} elseif {$type != "DropTail"} {
puts stderr "Unsupported: Link type $type, using DropTail."
punsup "Link type $type, using DropTail!"
}
}
}
......
......@@ -11,8 +11,5 @@ Class NSObject
# This is invoked whenever any method is called on the object that is
# not defined. We display a warning message and otherwise ignore it.
NSObject instproc unknown {m args} {
global ::GLOBALS::verbose
if {${::GLOBALS::verbose}} {
puts stderr "Unsupported: [$self info class] $m"
}
punsup "[$self info class] $m"
}
\ No newline at end of file
......@@ -14,9 +14,5 @@ NullClass instproc init {mytype} {
}
NullClass instproc unknown {m args} {
var_import ::GLOBALS::verbose
$self instvar type
if {$verbose} {
puts stderr "Unsupported: $type $m"
}
punsup "$type $m"
}
\ No newline at end of file
......@@ -63,13 +63,14 @@ proc perror {msg} {
###
# punsup {msg}
# Print an unsupported message if verbose is on.
# Print an unsupported message.
###
proc punsup {msg} {
global ::GLOBALS::verbose
if {${::GLOBALS::verbose}} {
puts stderr "Unsupported: $msg"
}
var_import ::GLOBALS::verbose
if {$verbose == 1} {
puts stderr "*** WARNING: Unsupported NS Statement!"
puts stderr " $msg"
}
}
# Parse Arguments
......@@ -244,20 +245,15 @@ namespace eval GLOBALS {
}
proc new {class args} {
var_import GLOBALS::new_counter
var_import GLOBALS::verbose
var_import GLOBALS::new_classes
if {! [info exists new_classes($class)]} {
if {$verbose} {
puts stderr "Unsupported object: $class"
}
punsup "Object: $class"
set id null[incr new_counter]
NullClass $id
return $id
}
if {$args != {}} {
if {$verbose} {
puts stderr "Unsupported args for $class."
}
punsup "args for $class"
}
set id $class[incr new_counter]
eval $class $id
......
......@@ -51,13 +51,12 @@ Simulator instproc init {args} {
# This method adds a new node to the topology and returns the id
# of the node.
Simulator instproc node {args} {
var_import ::GLOBALS::verbose
var_import ::GLOBALS::last_class
$self instvar id_counter
$self instvar node_list
if {$verbose && ($args != {})} {
puts stderr "Unsupported: Arguments for node: $args"
if {($args != {})} {
punsup "Arguments for node: $args"
}
set curnode n[incr id_counter]
......@@ -73,18 +72,14 @@ Simulator instproc node {args} {
# form accepted by parse_bw and <delay> in any form accepted by
# parse_delay. Currently only the type 'DropTail' is supported.
Simulator instproc duplex-link {n1 n2 bw delay type args} {
var_import ::GLOBALS::verbose
var_import ::GLOBALS::last_class
$self instvar id_counter
$self instvar lanlink_list
$self instvar link_map
if {$verbose && ($args != {})} {
puts stderr "Unsupported: Arguments for duplex-link: $args"
if {($args != {})} {
punsup "Arguments for duplex-link: $args"
}
# if {$verbose && ($type != "DropTail") && ($type != "RED")} {
# puts stderr "Unsupported: Link type $type, using DropTail."
# }
set error 0
if {! [$n1 info class Node]} {
perror "\[duplex-link] $n1 is not a node."
......@@ -116,13 +111,12 @@ Simulator instproc duplex-link {n1 n2 bw delay type args} {
# form accepted by parse_bw and <delay> in any form accepted by
# parse_delay.
Simulator instproc make-lan {nodelist bw delay args} {
var_import ::GLOBALS::verbose
var_import ::GLOBALS::last_class
$self instvar id_counter
$self instvar lanlink_list
if {$verbose && ($args != {})} {
puts stderr "Unsupported: Arguments for make-lan: $args"
if {($args != {})} {
punsup "Arguments for make-lan: $args"
}
set curlan lan[incr id_counter]
......@@ -443,11 +437,8 @@ Simulator instproc at {time eventstring} {
# request to create an object of that type. We create display an
# unsupported message and create a NullClass to fulfill the request.
Simulator instproc unknown {m args} {
global ::GLOBALS::verbose
$self instvar id_counter
if {${::GLOBALS::verbose}} {
puts stderr "Unsupported: Object $m"
}
punsup "Object $m"
NullClass null[incr id_counter] $m
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment