chiark / gitweb /
puts -nonewline => p
authorian <ian>
Tue, 13 Dec 2005 22:08:27 +0000 (22:08 +0000)
committerian <ian>
Tue, 13 Dec 2005 22:08:27 +0000 (22:08 +0000)
detpic/crashread

index 374c93d718b114e79565ee565dc276e187108f04..445168b63a4aad235a8f8be4aa9b070e9153fa3c 100755 (executable)
@@ -133,7 +133,7 @@ set ms [expr {
 
 proc xmit {b} {
     global p
-    puts -nonewline $p [format %c $b]
+    p $p [format %c $b]
 }
 
 proc xmit_s {b} {
@@ -213,9 +213,11 @@ set displine 0
 
 setup_$ms
 
+proc p {s} { puts -nonewline $s }
+
 proc endline {} {
     global inline displine
-    if {$inline} { puts -nonewline "\n"; incr displine }
+    if {$inline} { p "\n"; incr displine }
     set inline 0
 }
 
@@ -223,23 +225,23 @@ proc show {sym} {
     global insection section displine addr shownsection inline
     if {$insection && [string compare $section $shownsection]} {
        endline
-       puts "---------- $section ----------"
+       p "---------- $section ----------\n"
        set shownsection $section
        set displine 0
     } elseif {!$insection && [string length $shownsection]} {
        endline
-       puts "------------------------------"
+       p "------------------------------\n"
        set shownsection {}
        set displine 0
     }
     if {[string length $sym]} {
        if {$displine && $inline && !($displine&3)} {
-           puts -nonewline "\n"
+           p "\n"
        }
        endline
     }
     if {!$inline} {
-       puts -nonewline [format "%08x %-15s %-20s" $addr \
+       p [format "%08x %-15s %-20s" $addr \
                [lindex $sym 0] [lindex $sym 1]]
        set inline 1
     }
@@ -276,7 +278,7 @@ while {$sectionnum < [llength $sections]} {
     show {}
     set bytes [readbytes $addr $now]
     foreach b $bytes {
-       puts -nonewline [format " %02x" [expr {$b & 0xff}]]
+       p [format " %02x" [expr {$b & 0xff}]]
        incr addr
     }
     set inline 1