]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite, tclint] Fix lib/tuiterm.exp
authorTom de Vries <tdevries@suse.de>
Fri, 12 Sep 2025 13:04:50 +0000 (15:04 +0200)
committerTom de Vries <tdevries@suse.de>
Fri, 12 Sep 2025 13:04:50 +0000 (15:04 +0200)
Running tclint on lib/tuiterm.exp shows a few problems:
...
$ tclint --ignore line-length gdb/testsuite/lib/tuiterm.exp
tuiterm.exp:105:3: expression with substitutions should be enclosed by \
  braces [unbraced-expr]
tuiterm.exp:1576:28: unnecessary command substitution within expression \
  [redundant-expr]
tuiterm.exp:1582:25: unnecessary command substitution within expression \
  [redundant-expr]
...

Fix these.

Tested on aarch64-linux.

gdb/testsuite/lib/tuiterm.exp

index e1af2231b9402b0b7018c8b05dbd3c321c079764..97017c779e69a9cde531eab90dbfb355282e0e2e 100644 (file)
@@ -102,8 +102,8 @@ proc Term::_ctl_0x07 {} {
 # Return 1 if tuiterm has the bw/auto_left_margin enabled.
 proc Term::_have_bw {} {
     return [expr \
-               [string equal $Term::_TERM "ansiw"] \
-               || [string equal $Term::_TERM "ansis"]]
+               [string equal $Term::_TERM "ansiw"] \
+                     || [string equal $Term::_TERM "ansis"] }]
 }
 
 # Backspace.
@@ -1573,13 +1573,13 @@ proc Term::get_region { x y width height sep { attrs false } } {
     # Grab the contents of the box, join each line together
     # using $sep.
     set result ""
-    for {set yy $y} {$yy < [expr {$y + $height}]} {incr yy} {
+    for {set yy $y} {$yy < $y + $height} {incr yy} {
        if {$yy > $y} {
            # Add the end of line sequence only if this isn't the
            # first line.
            append result $sep
        }
-       for {set xx $x} {$xx < [expr {$x + $width}]} {incr xx} {
+       for {set xx $x} {$xx < $x + $width} {incr xx} {
            if { $attrs } {
                set char_attrs [lindex $_chars($xx,$yy) 1]
                append result [apply_attrs region_attrs $char_attrs]